Ocean
|
This class implements a 3x3 square matrix. More...
Public Types | |
typedef T | Type |
Definition of the used data type. More... | |
Public Member Functions | |
SquareMatrixT3 () | |
Creates a new SquareMatrixT3 object with undefined elements. More... | |
SquareMatrixT3 (const SquareMatrixT3< T > &matrix)=default | |
Copy constructor. More... | |
template<typename U > | |
SquareMatrixT3 (const SquareMatrixT3< U > &matrix) | |
Copy constructor for a matrix with difference element data type than T. More... | |
SquareMatrixT3 (const bool setToIdentity) | |
Creates a new SquareMatrixT3 object. More... | |
SquareMatrixT3 (const EulerT< T > &euler) | |
Creates a new SquareMatrixT3 rotation matrix by a given Euler rotation. More... | |
SquareMatrixT3 (const RotationT< T > &rotation) | |
Creates a new 3x3 matrix object by a given angle-axis rotation. More... | |
SquareMatrixT3 (const QuaternionT< T > &quaternion) | |
Creates a new 3x3 matrix object by a given quaternion rotation. More... | |
SquareMatrixT3 (const VectorT3< T > &xAxis, const VectorT3< T > &yAxis, const VectorT3< T > &zAxis) | |
Creates a new SquareMatrixT3 object by three axes. More... | |
SquareMatrixT3 (const VectorT3< T > &diagonal) | |
Creates a new SquareMatrixT3 object by a given diagonal vector. More... | |
template<typename U > | |
SquareMatrixT3 (const U *arrayValues) | |
Creates a new SquareMatrixT3 object by nine elements of float type U. More... | |
SquareMatrixT3 (const T *arrayValues) | |
Creates a new SquareMatrixT3 object by nine elements. More... | |
template<typename U > | |
SquareMatrixT3 (const U *arrayValues, const bool valuesRowAligned) | |
Creates a new SquareMatrixT3 object by nine elements. More... | |
SquareMatrixT3 (const T *arrayValues, const bool valuesRowAligned) | |
Creates a new SquareMatrixT3 object by nine elements. More... | |
SquareMatrixT3 (const HomogenousMatrixT4< T > &transformation) | |
Creates a 3x3 rotation matrix by a given 4x4 homogeneous transformation. More... | |
SquareMatrixT3 (const SquareMatrixT4< T > &transformation) | |
Creates a 3x3 square matrix by a given 4x4 square transformation. More... | |
SquareMatrixT3 (const T &m00, const T &m10, const T &m20, const T &m01, const T &m11, const T &m21, const T &m02, const T &m12, const T &m22) | |
Creates a 3x3 rotation matrix by 9 given matrix elements. More... | |
SquareMatrixT3< T > | transposed () const |
Returns the transposed of this matrix. More... | |
void | transpose () |
Transposes the matrix. More... | |
SquareMatrixT3< T > | inverted () const |
Returns the inverted matrix of this matrix. More... | |
bool | invert () |
Inverts this matrix in place. More... | |
bool | invert (SquareMatrixT3< T > &invertedMatrix) const |
Inverts the matrix and returns the result as parameter. More... | |
T | determinant () const |
Returns the determinant of the matrix. More... | |
T | trace () const |
Returns the trace of the matrix which is the sum of the diagonal elements. More... | |
void | toIdentity () |
Sets the matrix to the identity matrix. More... | |
void | toNull () |
Sets the matrix to a zero matrix. More... | |
bool | isIdentity () const |
Returns whether this matrix is an identity matrix. More... | |
bool | isNull () const |
Returns whether this matrix is a zero matrix. More... | |
bool | isSingular () const |
Returns whether this matrix is singular (and thus cannot be inverted). More... | |
bool | isSimilarity () const |
Returns true if this matrix is a similarity transformation. More... | |
bool | isAffine () const |
Returns true if this matrix is a affine transformation. More... | |
bool | isHomography () const |
Returns true if this matrix is perspective transform/homography. More... | |
bool | isOrthonormal (const T epsilon=NumericT< T >::eps()) const |
Returns whether this matrix is an orthonormal matrix. More... | |
bool | isSymmetric (const T epsilon=NumericT< T >::eps()) const |
Returns whether this matrix is symmetric. More... | |
bool | isEqual (const SquareMatrixT3< T > &matrix, const T eps=NumericT< T >::eps()) const |
Returns whether two matrices are almost identical up to a specified epsilon. More... | |
VectorT3< T > | xAxis () const |
Returns the x axis which is the first column of the matrix. More... | |
VectorT3< T > | yAxis () const |
Returns the y axis which is the middle column of the matrix. More... | |
VectorT3< T > | zAxis () const |
Returns the z axis which is the last column of the matrix. More... | |
SquareMatrixT3< T > | orthonormalMatrix () const |
Returns the orthonormal matrix of this matrix by scaling the x-axis and adjusting y- and z-axis. More... | |
bool | eigenValues (T *eigenValues) const |
Determines the eigen values of this matrix. More... | |
bool | eigenSystem (T *eigenValues, VectorT3< T > *eigenVectors) const |
Performs an eigen value analysis. More... | |
VectorT3< T > | diagonal () const |
Returns a 3d vector with values of the matrix diagonal. More... | |
bool | solve (const VectorT3< T > &b, VectorT3< T > &x) const |
Solve a simple 3x3 system of linear equations: Ax = b Beware: The system of linear equations is assumed to be fully determined. More... | |
T | absSum () const |
Calculates the sum of absolute value of elements. More... | |
T | sum () const |
Calculates the sum of elements. More... | |
const T * | data () const |
Returns a pointer to the internal values. More... | |
T * | data () |
Returns a pointer to the internal values. More... | |
template<typename U > | |
void | copyElements (U *arrayValues, const bool valuesRowAligned=false) const |
Copies the elements of this matrix to an array with floating point values of type U. More... | |
void | copyElements (T *arrayValues, const bool valuesRowAligned=false) const |
Copies the elements of this matrix to an array with floating point values of type T. More... | |
bool | multiply (const VectorT2< T > &vector, VectorT2< T > &result) const |
Multiplies a 2D vector with this matrix (from the right). More... | |
SquareMatrixT3< T > | transposedMultiply (const SquareMatrixT3< T > &right) const |
Multiplies this transposed matrix with a second matrix. More... | |
SquareMatrixT3< T > & | operator= (const SquareMatrixT3< T > &)=default |
Default copy assignment operator. More... | |
bool | operator== (const SquareMatrixT3< T > &matrix) const |
Returns whether two matrices are identical up to a small epsilon. More... | |
bool | operator!= (const SquareMatrixT3< T > &matrix) const |
Returns whether two matrices are not identical up to a small epsilon. More... | |
SquareMatrixT3< T > | operator+ (const SquareMatrixT3< T > &matrix) const |
Adds two matrices. More... | |
SquareMatrixT3< T > & | operator+= (const SquareMatrixT3< T > &matrix) |
Adds and assigns two matrices. More... | |
SquareMatrixT3< T > | operator- (const SquareMatrixT3< T > &matrix) const |
Subtracts two matrices. More... | |
SquareMatrixT3< T > & | operator-= (const SquareMatrixT3< T > &matrix) |
Subtracts and assigns two matrices. More... | |
SquareMatrixT3< T > | operator- () const |
Returns the negative matrix of this matrix (all matrix elements are multiplied by -1). More... | |
OCEAN_FORCE_INLINE SquareMatrixT3< T > | operator* (const SquareMatrixT3< T > &matrix) const |
Multiplies two matrices. More... | |
OCEAN_FORCE_INLINE SquareMatrixT3< T > & | operator*= (const SquareMatrixT3< T > &matrix) |
Multiplies and assigns two matrices. More... | |
OCEAN_FORCE_INLINE VectorT2< T > | operator* (const VectorT2< T > &vector) const |
Multiply operator for a 2D vector. More... | |
OCEAN_FORCE_INLINE VectorT3< T > | operator* (const VectorT3< T > &vector) const |
Multiply operator for a 3D vector. More... | |
OCEAN_FORCE_INLINE SquareMatrixT3< T > | operator* (const T value) const |
Multiplies this matrix with a scalar value. More... | |
SquareMatrixT3< T > & | operator*= (const T value) |
Multiplies and assigns this matrix with a scalar value. More... | |
T | operator[] (const unsigned int index) const |
Element operator. More... | |
T & | operator[] (const unsigned int index) |
Element operator. More... | |
T | operator() (const unsigned int row, const unsigned int column) const |
Element operator. More... | |
T & | operator() (const unsigned int row, const unsigned int column) |
Element operator. More... | |
T | operator() (const unsigned int index) const |
Element operator. More... | |
T & | operator() (const unsigned int index) |
Element operator. More... | |
const T * | operator() () const |
Access operator. More... | |
T * | operator() () |
Access operator. More... | |
size_t | operator() (const SquareMatrixT3< T > &matrix) const |
Hash function. More... | |
OCEAN_FORCE_INLINE VectorT3< double > | operator* (const VectorT3< double > &vector) const |
OCEAN_FORCE_INLINE VectorT3< float > | operator* (const VectorT3< float > &vector) const |
void | multiply (const SquareMatrixT3< float > &matrix, const VectorT3< float > *vectors, VectorT3< float > *results, const size_t number) |
std::vector< SquareMatrixT3< float > > | matrices2matrices (const std::vector< SquareMatrixT3< float > > &matrices) |
std::vector< SquareMatrixT3< double > > | matrices2matrices (const std::vector< SquareMatrixT3< double > > &matrices) |
template<typename U > | |
std::vector< SquareMatrixT3< T > > | matrices2matrices (const SquareMatrixT3< U > *matrices, const size_t size) |
Static Public Member Functions | |
static SquareMatrixT3< T > | skewSymmetricMatrix (const VectorT3< T > &vector) |
Creates a skew symmetric 3x3 matrix for a specific vector. More... | |
static size_t | elements () |
Returns the number of elements this matrix has. More... | |
static void | multiply (const SquareMatrixT3< T > &matrix, const VectorT2< T > *vectors, VectorT2< T > *results, const size_t number) |
Multiplies several 2D vectors with a given 3x3 matrix. More... | |
static void | multiply (const SquareMatrixT3< T > &matrix, const VectorT3< T > *vectors, VectorT3< T > *results, const size_t number) |
Multiplies several 3D vectors with a given 3x3 matrix. More... | |
template<typename U > | |
static SquareMatricesT3< T > | matrices2matrices (const SquareMatricesT3< U > &matrices) |
Converts matrices with specific data type to matrices with different data type. More... | |
template<typename U > | |
static SquareMatricesT3< T > | matrices2matrices (const SquareMatrixT3< U > *matrices, const size_t size) |
Converts matrices with specific data type to matrices with different data type. More... | |
Protected Attributes | |
T | values_ [9] |
The nine values of the matrix. More... | |
Friends | |
template<typename U > | |
class | SquareMatrixT3 |
This class implements a 3x3 square matrix.
The matrix can be applied as e.g., rotation matrix for 3D vectors or can represent a Homography and so on.
The values are stored in a column aligned order with indices:
| 0 3 6 | | 1 4 7 | | 2 5 8 |
T | Data type of matrix elements |
typedef T Ocean::SquareMatrixT3< T >::Type |
Definition of the used data type.
|
inline |
Creates a new SquareMatrixT3 object with undefined elements.
Beware: This matrix is neither a zero nor an entity matrix!
|
default |
Copy constructor.
matrix | The matrix to copy |
|
inlineexplicit |
Copy constructor for a matrix with difference element data type than T.
matrix | The matrix to copy |
U | The element data type of the second matrix |
|
explicit |
Creates a new SquareMatrixT3 object.
setToIdentity | Determines whether a entity matrix will be created, otherwise the matrix is initialized with zeros |
|
explicit |
Creates a new SquareMatrixT3 rotation matrix by a given Euler rotation.
euler | Euler rotation to create a rotation matrix from, must be valid |
Rotation matrix around x-axis R(x): [ 1 0 0 ] [ 0 cos -sin ] [ 0 sin cos ]
Rotation matrix around y-axis R(y): [ cos 0 sin ] [ 0 1 0 ] [ -sin 0 cos ]
Rotation matrix around z-axis R(z): [ cos -sin 0 ] [ sin cos 0 ] [ 0 0 1 ]
Combined rotation matrix for R(y)R(x)R(z) [ cy cz + sx sy sz cz sx sy - cy sz cx sy ] [ cx sz cx cz -sx ] [ -cz sy + cy sx sz cy cz sx + sy sz cx cy ]
|
explicit |
Creates a new 3x3 matrix object by a given angle-axis rotation.
rotation | The angle-axis rotation to create a matrix from, must be valid |
|
explicit |
Creates a new 3x3 matrix object by a given quaternion rotation.
quaternion | The quaternion rotation to create a matrix from, must be valid |
Ocean::SquareMatrixT3< T >::SquareMatrixT3 | ( | const VectorT3< T > & | xAxis, |
const VectorT3< T > & | yAxis, | ||
const VectorT3< T > & | zAxis | ||
) |
Creates a new SquareMatrixT3 object by three axes.
xAxis | First column of the matrix |
yAxis | Middle column of the matrix |
zAxis | Last column of the matrix |
|
explicit |
Creates a new SquareMatrixT3 object by a given diagonal vector.
diagonal | The diagonal vector for the new matrix |
|
explicit |
Creates a new SquareMatrixT3 object by nine elements of float type U.
arrayValues | The nine matrix elements defining the new matrix, must be valid |
U | The floating point type of the given elements |
|
explicit |
Creates a new SquareMatrixT3 object by nine elements.
arrayValues | The nine matrix elements defining the new matrix, must be valid |
Ocean::SquareMatrixT3< T >::SquareMatrixT3 | ( | const U * | arrayValues, |
const bool | valuesRowAligned | ||
) |
Creates a new SquareMatrixT3 object by nine elements.
arrayValues | The nine matrix elements defining the new matrix, must be valid |
valuesRowAligned | True, if the given values are stored in a row aligned order; False, if the values are stored in a column aligned order (which is the default case for this matrix) |
U | The floating point type of the given elements |
Ocean::SquareMatrixT3< T >::SquareMatrixT3 | ( | const T * | arrayValues, |
const bool | valuesRowAligned | ||
) |
Creates a new SquareMatrixT3 object by nine elements.
arrayValues | The nine matrix elements defining the new matrix, must be valid |
valuesRowAligned | True, if the given values are stored in a row aligned order; False, if the values are stored in a column aligned order (which is the default case for this matrix) |
|
explicit |
Creates a 3x3 rotation matrix by a given 4x4 homogeneous transformation.
transformation | The transformation to create a 3x3 rotation matrix from |
|
explicit |
Creates a 3x3 square matrix by a given 4x4 square transformation.
transformation | The transformation to create a 3x3 square matrix from |
|
explicit |
Creates a 3x3 rotation matrix by 9 given matrix elements.
m00 | Element of the first row and first column |
m10 | Element of the second row and first column |
m20 | Element of the third row and first column |
m01 | Element of the first row and second column |
m11 | Element of the second row and second column |
m21 | Element of the third row and second column |
m02 | Element of the first row and third column |
m12 | Element of the second row and third column |
m22 | Element of the third row and third column |
|
inline |
Calculates the sum of absolute value of elements.
void Ocean::SquareMatrixT3< T >::copyElements | ( | T * | arrayValues, |
const bool | valuesRowAligned = false |
||
) | const |
Copies the elements of this matrix to an array with floating point values of type T.
arrayValues | Array with 9 floating point values of type T receiving the elements of this matrix |
valuesRowAligned | True, if the target values are stored in a row aligned order; False, if the target values are stored in a column aligned order |
void Ocean::SquareMatrixT3< T >::copyElements | ( | U * | arrayValues, |
const bool | valuesRowAligned = false |
||
) | const |
Copies the elements of this matrix to an array with floating point values of type U.
arrayValues | Array with 9 floating point values of type U receiving the elements of this matrix |
valuesRowAligned | True, if the target values are stored in a row aligned order; False, if the target values are stored in a column aligned order |
U | Floating point type |
|
inline |
Returns a pointer to the internal values.
|
inline |
Returns a pointer to the internal values.
T Ocean::SquareMatrixT3< T >::determinant |
Returns the determinant of the matrix.
VectorT3< T > Ocean::SquareMatrixT3< T >::diagonal |
Returns a 3d vector with values of the matrix diagonal.
bool Ocean::SquareMatrixT3< T >::eigenSystem | ( | T * | eigenValues, |
VectorT3< T > * | eigenVectors | ||
) | const |
Performs an eigen value analysis.
eigenValues | The three resulting eigen values, sorted: the highest first |
eigenVectors | The three corresponding eigen vectors |
Computation of the characteristic polynomial
[ a b c ] A = [ d e f ] [ g h i ] [ a-x b c ] A - x * E = [ d e-x f ] [ g h i-x ] Polynomial = Det|A - x * E| = 0 = (a - x) * (e - x) * (i - x) + bfg + cdh - g * (e - x) * c - h * f * (a - x) - (i - x) * d * b = (ae - a * x - e * x + x^2) * (i - x) + bfg + cdh - g * (ec - c * x) - h * (fa - f * x) - d * (ib - x * b) = aei - ae * x - ai * x + a * x^2 - ei * x + e * x^2 + i * x^2 - x^3 + bfg + cdh - gec + gc * x - hfa + hf * x - dib + db * x = -x^3 + (a + e + i) * x^2 + (-ae - ai - ei + gc + hf + db) * x + aei + bfg + cdh - gec - hfa - dib = x^3 - (a + e + i) * x^2 - (-ae - ai - ei + gc + hf + db) * x - aei - bfg - cdh + gec + hfa + dib = a1x^3 + a2x^2 + a3x + a4 = 0
Determination of the eigen vectors (vx, vy, vz): [ a-x b c ] [ vx ] A - x * E = [ d e-x f ] * [ vy ] = 0 [ g h i-x ] [ vz ] We can apply the cross product to find a vector that is perpendicular to the two top rows of the matrix A - x * E
bool Ocean::SquareMatrixT3< T >::eigenValues | ( | T * | eigenValues | ) | const |
Determines the eigen values of this matrix.
eigenValues | The three resulting eigen values, sorted: the highest first |
Computation of the characteristic polynomial
[ a b c ] A = [ d e f ] [ g h i ] [ a-x b c ] A - x * E = [ d e-x f ] [ g h i-x ] Polynomial = Det|A - x * E| = 0 = (a - x) * (e - x) * (i - x) + bfg + cdh - g * (e - x) * c - h * f * (a - x) - (i - x) * d * b = (ae - a * x - e * x + x^2) * (i - x) + bfg + cdh - g * (ec - c * x) - h * (fa - f * x) - d * (ib - x * b) = aei - ae * x - ai * x + a * x^2 - ei * x + e * x^2 + i * x^2 - x^3 + bfg + cdh - gec + gc * x - hfa + hf * x - dib + db * x = -x^3 + (a + e + i) * x^2 + (-ae - ai - ei + gc + hf + db) * x + aei + bfg + cdh - gec - hfa - dib = x^3 - (a + e + i) * x^2 - (-ae - ai - ei + gc + hf + db) * x - aei - bfg - cdh + gec + hfa + dib = a1x^3 + a2x^2 + a3x + a4 = 0
|
inlinestatic |
Returns the number of elements this matrix has.
bool Ocean::SquareMatrixT3< T >::invert |
Inverts this matrix in place.
bool Ocean::SquareMatrixT3< T >::invert | ( | SquareMatrixT3< T > & | invertedMatrix | ) | const |
Inverts the matrix and returns the result as parameter.
invertedMatrix | The resulting inverted matrix |
SquareMatrixT3< T > Ocean::SquareMatrixT3< T >::inverted |
Returns the inverted matrix of this matrix.
This matrix must not be singular.
Beware: This function does not throw an exception if the matrix cannot be inverted.
Thus, ensure that the matrix is invertible before calling this function.
Even better: avoid the usage of this function and call invert() instead.
In case, this matrix is not invertible, this matrix will be returned instead.
|
inline |
Returns true if this matrix is a affine transformation.
In order to be considered affine, the matrix mustn't be singular and the last row must be equivalent to [0 0 1].
|
inline |
Returns whether two matrices are almost identical up to a specified epsilon.
matrix | Second matrix that will be checked |
eps | The epsilon threshold to be used, with range [0, infinity) |
|
inline |
Returns true if this matrix is perspective transform/homography.
In order to be considered a homography, the matrix mustn't be singular and the bottom-right matrix element must be nonzero.
bool Ocean::SquareMatrixT3< T >::isIdentity |
bool Ocean::SquareMatrixT3< T >::isNull |
bool Ocean::SquareMatrixT3< T >::isOrthonormal | ( | const T | epsilon = NumericT<T>::eps() | ) | const |
Returns whether this matrix is an orthonormal matrix.
epsilon | The epsilon threshold to be used, with range [0, infinity) |
|
inline |
Returns true if this matrix is a similarity transformation.
A similarity transformation has four degrees of freedom and contains a rotation, a scale, and a 2D translation and is not singular.
The 3x3 matrix representing the similarity transformation has the following layout:
| a -b tx | | b a ty | | 0 0 1 |
|
inline |
Returns whether this matrix is singular (and thus cannot be inverted).
A matrix is singular if the determinant of a matrix is 0.
|
inline |
Returns whether this matrix is symmetric.
epsilon | The epsilon threshold to be used, with range [0, infinity) |
|
inlinestatic |
Converts matrices with specific data type to matrices with different data type.
matrices | The matrices to convert |
U | The element data type of the matrices to convert |
|
inlinestatic |
Converts matrices with specific data type to matrices with different data type.
matrices | The matrices to convert |
size | The number of matrices to convert |
U | The element data type of the matrices to convert |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Multiplies several 2D vectors with a given 3x3 matrix.
Each 2D vector is interpreted as a 3D vector with third component equal to 1.
The final result will be de-homogenized to provide a 2D vector result.
matrix | The matrix to be used for multiplication |
vectors | The input vectors that will be multiplied, may be nullptr if number is 0 |
results | The resulting output (multiplied/transformed) vectors, with same number as the provided input vectors |
number | The number of provided vectors (input and output), with range [0, infinity) |
|
static |
Multiplies several 3D vectors with a given 3x3 matrix.
matrix | The matrix to be used for multiplication |
vectors | The input vectors that will be multiplied, may be nullptr if number is 0 |
results | The resulting output (multiplied/transformed) vectors, with same number as the provided input vectors |
number | The number of provided vectors (input and output), with range [0, infinity) |
|
inline |
Multiplies a 2D vector with this matrix (from the right).
The 2D vector is interpreted as a 3D vector with third component equal to 1.
This function is equivalent with the corresponding multiplication operator but returns False if the dot product between the augmented vector and the last row is zero.
The multiplication result will be de-homogenized to provide a 2D vector result, if possible.
Actually this function does:
vector | The vector to be multiplied/transformed |
result | The de-homogenized resulting 2D vector, if this function succeeds |
| x' | | 0 3 6 | | x | | y' | = | 1 4 7 | * | y | | 1 | | 2 5 8 | | 1 |
|
inline |
Returns whether two matrices are not identical up to a small epsilon.
matrix | Right operand |
|
inline |
Access operator.
|
inline |
Access operator.
|
inline |
Hash function.
matrix | The matrix for which the hash value will be determined |
|
inline |
Element operator.
Beware: No range check will be done!
index | The index of the element to return [0, 8] |
|
inline |
Element operator.
Beware: No range check will be done!
index | The index of the element to return [0, 8] |
|
inline |
Element operator.
Beware: No range check will be done!
row | The row of the element to return [0, 2] |
column | The column of the element to return [0, 2] |
|
inline |
Element operator.
Beware: No range check will be done!
row | The row of the element to return [0, 2] |
column | The column of the element to return [0, 2] |
OCEAN_FORCE_INLINE SquareMatrixT3< T > Ocean::SquareMatrixT3< T >::operator* | ( | const SquareMatrixT3< T > & | matrix | ) | const |
Multiplies two matrices.
matrix | Right operand |
SquareMatrixT3< T > Ocean::SquareMatrixT3< T >::operator* | ( | const T | value | ) | const |
Multiplies this matrix with a scalar value.
value | Right operand |
OCEAN_FORCE_INLINE VectorT2< T > Ocean::SquareMatrixT3< T >::operator* | ( | const VectorT2< T > & | vector | ) | const |
Multiply operator for a 2D vector.
The 2D vector is interpreted as a 3D vector with third component equal to 1.
The final result will be de-homogenized to provide a 2D vector result.
Beware the dot product between the last row and the (augmented) vector must not be zero!
vector | Right operand, vector to be multiplied from the right |
| x' | | 0 3 6 | | x | | y' | = | 1 4 7 | * | y | | 1 | | 2 5 8 | | 1 |
OCEAN_FORCE_INLINE VectorT3< double > Ocean::SquareMatrixT3< double >::operator* | ( | const VectorT3< double > & | vector | ) | const |
OCEAN_FORCE_INLINE VectorT3< float > Ocean::SquareMatrixT3< float >::operator* | ( | const VectorT3< float > & | vector | ) | const |
OCEAN_FORCE_INLINE VectorT3< T > Ocean::SquareMatrixT3< T >::operator* | ( | const VectorT3< T > & | vector | ) | const |
Multiply operator for a 3D vector.
vector | Right operand |
|
inline |
Multiplies and assigns two matrices.
matrix | Right operand |
SquareMatrixT3< T > & Ocean::SquareMatrixT3< T >::operator*= | ( | const T | value | ) |
Multiplies and assigns this matrix with a scalar value.
value | right operand |
SquareMatrixT3< T > Ocean::SquareMatrixT3< T >::operator+ | ( | const SquareMatrixT3< T > & | matrix | ) | const |
Adds two matrices.
matrix | Right operand |
SquareMatrixT3< T > & Ocean::SquareMatrixT3< T >::operator+= | ( | const SquareMatrixT3< T > & | matrix | ) |
Adds and assigns two matrices.
matrix | Right operand |
|
inline |
Returns the negative matrix of this matrix (all matrix elements are multiplied by -1).
SquareMatrixT3< T > Ocean::SquareMatrixT3< T >::operator- | ( | const SquareMatrixT3< T > & | matrix | ) | const |
Subtracts two matrices.
matrix | Right operand |
SquareMatrixT3< T > & Ocean::SquareMatrixT3< T >::operator-= | ( | const SquareMatrixT3< T > & | matrix | ) |
Subtracts and assigns two matrices.
matrix | Right operand |
|
default |
Default copy assignment operator.
bool Ocean::SquareMatrixT3< T >::operator== | ( | const SquareMatrixT3< T > & | matrix | ) | const |
Returns whether two matrices are identical up to a small epsilon.
matrix | Right operand |
|
inline |
Element operator.
Beware: No range check will be done!
index | The index of the element to return [0, 8] |
|
inline |
Element operator.
Beware: No range check will be done!
index | The index of the element to return [0, 8] |
SquareMatrixT3< T > Ocean::SquareMatrixT3< T >::orthonormalMatrix |
Returns the orthonormal matrix of this matrix by scaling the x-axis and adjusting y- and z-axis.
This matrix must not be singular.
|
inlinestatic |
Creates a skew symmetric 3x3 matrix for a specific vector.
The skew symmetric matrix allows to calculate the cross product of the specified vector with a second vector by a matrix multiplication.
That means: skewSymmetricMatrix(vectorA) * vectorB == vectorA.cross(vectorB)
The final matrix has the following form for a vector (v0, v1, v2):
| 0 -v2 v1 | | v2 0 -v0 | | -v1 v0 0 |
vector | The vector for which the skew symmetric matrix will be created |
|
inline |
Solve a simple 3x3 system of linear equations: Ax = b Beware: The system of linear equations is assumed to be fully determined.
b | The right-hand side vector |
x | The resulting solution vector |
|
inline |
Calculates the sum of elements.
|
inline |
Sets the matrix to the identity matrix.
|
inline |
Sets the matrix to a zero matrix.
T Ocean::SquareMatrixT3< T >::trace |
Returns the trace of the matrix which is the sum of the diagonal elements.
void Ocean::SquareMatrixT3< T >::transpose |
Transposes the matrix.
SquareMatrixT3< T > Ocean::SquareMatrixT3< T >::transposed |
Returns the transposed of this matrix.
SquareMatrixT3< T > Ocean::SquareMatrixT3< T >::transposedMultiply | ( | const SquareMatrixT3< T > & | right | ) | const |
Multiplies this transposed matrix with a second matrix.
Actually, the following matrix will be returned: (*this).transposed() * right.
right | Matrix to multiply |
VectorT3< T > Ocean::SquareMatrixT3< T >::xAxis |
Returns the x axis which is the first column of the matrix.
VectorT3< T > Ocean::SquareMatrixT3< T >::yAxis |
Returns the y axis which is the middle column of the matrix.
VectorT3< T > Ocean::SquareMatrixT3< T >::zAxis |
Returns the z axis which is the last column of the matrix.
|
protected |
The nine values of the matrix.