a simple 3x3 matrix More...
#include <mia/3d/matrix.hh>
Public Member Functions | |
T | get_det () const |
int | get_eigenvalues (C3DFVector &v) const |
int | get_eigenvector (float ev, C3DFVector &v) const |
int | get_rank () const |
T3DMatrix< T > & | operator-= (const T3DMatrix< T > &other) |
void | print (std::ostream &os) const |
T3DMatrix ()=default | |
T3DMatrix (const T3DMatrix< T > &o)=default | |
template<typename I > | |
T3DMatrix (const T3DMatrix< I > &o) | |
T3DMatrix (const T3DVector< T3DVector< T > > &other) | |
T3DMatrix (const T3DVector< T > &x, const T3DVector< T > &y, const T3DVector< T > &z) | |
T3DMatrix< T > | transposed () const |
![]() | |
void | fill (T3DVector< T >v) |
Fill the vector elements with value v. More... | |
double | norm () const |
double | norm2 () const |
square of Euclidian norm of the vector More... | |
T3DVector< T3DVector< T > > & | operator*= (const double a) |
inplace multiplication More... | |
T3DVector< T3DVector< T > > & | operator*= (const T3DVector< T3DVector< T > > &a) |
inplace component wise multiplication More... | |
T3DVector< T3DVector< T > > & | operator+= (const T3DVector< T3DVector< T > > &a) |
inplace addition More... | |
T3DVector< T3DVector< T > > & | operator-= (const T3DVector< T3DVector< T > > &a) |
inplace subtraction More... | |
T3DVector< T3DVector< T > > & | operator/= (const double a) |
inplace divisison by a scalar More... | |
T3DVector< T3DVector< T > > & | operator= (const T3DVector< T3DVector< T > > &other)=default |
we provide the default copy mechanisms More... | |
T3DVector< T3DVector< T > > & | operator= (const T3DVector< in > &org) |
assignment from different vector type More... | |
const T3DVector< T > | operator[] (size_t i) const |
T3DVector< T > & | operator[] (size_t i) |
double | product () const |
void | read (std::istream &is) |
read the vector from a formatted string More... | |
int | size () const |
T3DVector () | |
standart constructor More... | |
T3DVector (int dim) | |
create a zero-vector, dim must be 3 More... | |
T3DVector (const T3DVector< T3DVector< T > > &other)=default | |
we provide the default copy mechanisms More... | |
T3DVector (const T3DVector< T > &x_, const T3DVector< T > &y_, const T3DVector< T > &z_) | |
constructor to construct vector from values More... | |
T3DVector (const T3DVector< in > &org) | |
type casting copy constructor More... | |
void | write (std::ostream &os) const |
print out the formatted vector to the stream More... | |
const T3DVector< T3DVector< T > > & | xyz () const |
swizzle operator More... | |
const T3DVector< T3DVector< T > > | xzy () const |
swizzle operator More... | |
const T3DVector< T3DVector< T > > | yxz () const |
swizzle operator More... | |
const T3DVector< T3DVector< T > > | yzx () const |
swizzle operator More... | |
const T3DVector< T3DVector< T > > | zxy () const |
swizzle operator More... | |
const T3DVector< T3DVector< T > > | zyx () const |
swizzle operator More... | |
Static Public Member Functions | |
static T3DMatrix< T > | diagonal (T value) |
static T3DMatrix< T > | diagonal (const T3DVector< T > &values) |
Static Public Attributes | |
static const T3DMatrix | _0 = T3DMatrix<T>() |
The zero matrix. More... | |
static const T3DMatrix | _1 |
The unity matrix. More... | |
![]() | |
static T3DVector< T3DVector< T > > | _0 |
declare the vector (0,0,0) More... | |
static T3DVector< T3DVector< T > > | _1 |
declare the vector (1,1,1) More... | |
static const unsigned int | elements |
the number of elements this vector holds (=3) More... | |
Additional Inherited Members | |
![]() | |
typedef T3DVector< T > | value_type |
typedef for generic programming More... | |
![]() | |
T3DVector< T > | x |
vector element More... | |
T3DVector< T > | y |
vector element More... | |
T3DVector< T > | z |
vector element More... | |
a simple 3x3 matrix
This si a simple implementation of a 3x3 matrix that supports the evaluation of certain properties and operations with vectors
T | the data type of the elements of the matrix |
Definition at line 39 of file 3d/matrix.hh.
Construct a matrix by copying from a differenty typed matrix
I | the element type of the original matrix |
o | the matrix to be copied |
Definition at line 178 of file 3d/matrix.hh.
Construct the matrix by giving a 3D vector of 3D vectors
other | the input matrix |
Definition at line 184 of file 3d/matrix.hh.
T3DMatrix< T >::T3DMatrix | ( | const T3DVector< T > & | x, |
const T3DVector< T > & | y, | ||
const T3DVector< T > & | z | ||
) |
Construct the matrix by giving the rows as 3D vectors
x | 1st row |
y | 2st row |
z | 3rd row |
Definition at line 190 of file 3d/matrix.hh.
Create a diagonal matrix
value | the value to set the diagonal elements to |
Definition at line 161 of file 3d/matrix.hh.
Referenced by T3DMatrix< T >::get_eigenvector().
|
static |
Create a diagonal matrix
values | the values to set the diagonal elements to a(0,0) = values.x, a(1,1) = values.y, ... |
Definition at line 169 of file 3d/matrix.hh.
References T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.
T T3DMatrix< T >::get_det | ( | ) | const |
int T3DMatrix< T >::get_eigenvalues | ( | C3DFVector & | v) | const |
calculated the eigenvalues of the matrix using the caracteristic polynome, and Cardans formula
result | stores the three eigenvalues, interprete dependend on returns |
Definition at line 287 of file 3d/matrix.hh.
References cubrt(), cvdebug(), fabs(), T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.
int T3DMatrix< T >::get_eigenvector | ( | float | ev, |
C3DFVector & | v | ||
) | const |
Calculate the eigenvector to a given eigenvalues. If the eigenvalue is complex, the matrix has to be propagated to a complex one using the type converting copy constructor
[in] | ev | the eigenvalue |
[out] | v | the estimated eigenvector |
Definition at line 378 of file 3d/matrix.hh.
References solve_lines_t::a, solve_lines_t::b, T3DMatrix< T >::diagonal(), solve_2x2(), T3DVector< T3DVector< T > >::x, T3DVector< T >::x, T3DVector< T >::y, T3DVector< T3DVector< T > >::y, T3DVector< T >::z, and T3DVector< T3DVector< T > >::z.
int T3DMatrix< T >::get_rank | ( | ) | const |
Definition at line 254 of file 3d/matrix.hh.
References cvdebug(), T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.
inplace subtract
other |
Definition at line 208 of file 3d/matrix.hh.
References T3DVector< T3DVector< T > >::x, T3DVector< T3DVector< T > >::y, and T3DVector< T3DVector< T > >::z.
void T3DMatrix< T >::print | ( | std::ostream & | os) | const |
print the matrix to an ostream
os | the output stream |
Definition at line 195 of file 3d/matrix.hh.
Definition at line 217 of file 3d/matrix.hh.
The zero matrix.
Definition at line 142 of file 3d/matrix.hh.
The unity matrix.
Definition at line 139 of file 3d/matrix.hh.