ALBA
|
#include <albaMatrix3x3.h>
Public Member Functions | |
albaTypeMacro (albaMatrix3x3, albaObject) | |
virtual void | Print (std::ostream &os, const int indent=0) const |
albaMatrix3x3 () | |
virtual | ~albaMatrix3x3 () |
albaMatrix3x3 & | operator= (const albaMatrix3x3 &mat) |
albaMatrix3x3 (albaMatrix3x3 &mat) | |
void | DeepCopy (albaMatrix3x3 *mat) |
void | MultiplyVector (const double in[3], double out[3]) |
albaMatrix3x3Elements | GetElements () const |
void | SetElement (int i, int j, double value) |
double | GetElement (int i, int j) const |
void | GetVersor (int axis, double versor[3]) |
void | Zero () |
void | Identity () |
void | Transpose () |
void | Invert () |
void | Orthogonalize () |
double | Determinant () |
void | QuaternionToMatrix (const double quat[4]) |
void | MatrixToQuaternion (double quat[4]) |
void | SingularValueDecomposition (double U[3][3], double w[3], double VT[3][3]) |
void | LUFactor (int index[3]) |
void | LUSolve (const int index[3], double x[3]) |
double * | operator[] (const unsigned int i) |
const double * | operator[] (unsigned int i) const |
Public Member Functions inherited from albaObject | |
albaObject () | |
virtual | ~albaObject () |
virtual void | Delete () |
virtual const char * | GetTypeName () const |
virtual bool | IsA (const char *type_name) const |
virtual bool | IsA (const albaTypeID &type_id) const |
virtual albaObject * | NewObjectInstance () const =0 |
virtual const albaTypeID & | GetTypeId () const |
virtual void | Print (std::ostream &os, const int indent=0) const |
albaObject (const albaObject &c) | |
Public Member Functions inherited from albaTimeStamped | |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
Static Public Member Functions | |
static void | MultiplyVector (const float A[3][3], const float in[3], float out[3]) |
static void | MultiplyVector (const double A[3][3], const double in[3], double out[3]) |
static void | Multiply (const double A[3][3], const double B[3][3], double C[3][3]) |
static void | Multiply (const albaMatrix3x3 &A, albaMatrix3x3 &B, albaMatrix3x3 &C) |
static void | GetVersor (int axis, const albaMatrix3x3 &matrix, double versor[3]) |
static void | Zero (double elements[9]) |
static void | Identity (double A[3][3]) |
static void | Transpose (const double A[3][3], double AT[3][3]) |
static void | Invert (const double A[3][3], double AI[3][3]) |
static void | Orthogonalize (const double A[3][3], double B[3][3]) |
static void | Diagonalize (const double A[3][3], double w[3], double V[3][3]) |
static double | Determinant (double A[3][3]) |
static double | Determinant (const double c1[3], const double c2[3], const double c3[3]) |
static double | Determinant (double a1, double a2, double a3, double b1, double b2, double b3, double c1, double c2, double c3) |
static void | QuaternionToMatrix (const double quat[4], double A[3][3]) |
static void | MatrixToQuaternion (const double A[3][3], double quat[4]) |
static void | SingularValueDecomposition (const double A[3][3], double U[3][3], double w[3], double VT[3][3]) |
static int | Jacobi (const double A[3][3], double w[3], double v[3][3]) |
static int | JacobiN (double **a, int n, double *w, double **v) |
static void | LUFactor (double A[3][3], int index[3]) |
static void | LUSolve (const double A[3][3], const int index[3], double x[3]) |
static double | DegreesToRadians () |
static double | Pi () |
static double | RadiansToDegrees () |
static double | Determinant2x2 (double a, double b, double c, double d) |
static double | Determinant2x2 (const double c1[2], const double c2[2]) |
static double | Norm (const double x[3]) |
static void | Cross (const double x[3], const double y[3], double z[3]) |
static double | Normalize (double x[3]) |
Static Public Member Functions inherited from albaObject | |
static const char * | GetStaticTypeName () |
static bool | IsStaticType (const char *type_name) |
static bool | IsStaticType (const albaTypeID &type_id) |
static const albaTypeID & | GetStaticTypeId () |
static albaObject * | SafeDownCast (albaObject *o) |
Protected Attributes | |
double | m_Elements [3][3] |
Protected Attributes inherited from albaObject | |
bool | m_HeapFlag |
Protected Attributes inherited from albaTimeStamped | |
albaMTime | m_MTime |
albaMatrix3x3 - Simple 3x3 Matrix.
This class defines a simple 3x3 Matrix class, and some operators over it. This is typically used for internal algorithms, use albaMatrix for complex usage.
Definition at line 32 of file albaMatrix3x3.h.
albaMatrix3x3::albaMatrix3x3 | ( | ) |
|
virtual |
albaMatrix3x3::albaMatrix3x3 | ( | albaMatrix3x3 & | mat | ) |
albaMatrix3x3::albaTypeMacro | ( | albaMatrix3x3 | , |
albaObject | |||
) |
|
virtual |
print debug information for this object
Reimplemented from albaObject.
albaMatrix3x3 & albaMatrix3x3::operator= | ( | const albaMatrix3x3 & | mat | ) |
void albaMatrix3x3::DeepCopy | ( | albaMatrix3x3 * | mat | ) |
copy the given matrix content
|
static |
Multiply a vector by a 3x3 matrix.
The result is placed in out.
|
static |
Multiply a vector by a 3x3 matrix.
The result is placed in out.
|
inline |
Multiply a vector by this matrix.
The result is placed in out.
Definition at line 55 of file albaMatrix3x3.h.
References MultiplyVector().
Referenced by MultiplyVector().
|
static |
Multiply one 3x3 matrix by another according to C = AB.
|
inlinestatic |
Multiply this matrix by another according to C = AB.
Definition at line 62 of file albaMatrix3x3.h.
|
inline |
Definition at line 65 of file albaMatrix3x3.h.
|
inline |
Sets the element i,j in the matrix.
Remember to call explicitly Modified when using this function.
Definition at line 70 of file albaMatrix3x3.h.
|
inline |
Returns the element i,j from the matrix.
Definition at line 73 of file albaMatrix3x3.h.
|
static |
Get the given matrix versor.
Static version.
|
inline |
Get the given matrix versor.
Definition at line 78 of file albaMatrix3x3.h.
References GetVersor().
Referenced by GetVersor().
|
inline |
Set all of the elements to zero.
Static version.
Definition at line 81 of file albaMatrix3x3.h.
References albaTimeStamped::Modified(), and Zero().
Referenced by Zero().
|
static |
Set all of the elements to zero.
|
inline |
Set equal to Identity matrix.
Definition at line 86 of file albaMatrix3x3.h.
References Identity(), and albaTimeStamped::Modified().
Referenced by Identity().
|
static |
|
static |
Transpose the 3x3 matrix.
|
inline |
Definition at line 91 of file albaMatrix3x3.h.
References albaTimeStamped::Modified(), and Transpose().
Referenced by Transpose().
|
static |
Invert the 3x3 matrix.
|
inline |
Definition at line 95 of file albaMatrix3x3.h.
References Invert(), and albaTimeStamped::Modified().
Referenced by Invert().
|
static |
Orthogonalize a 3x3 matrix and put the result in B.
If matrix A has a negative determinant, then B will be a rotation plus a flip i.e. it will have a determinant of -1.
|
inline |
Orthogonalize this matrix in place.
If this matrix has a negative determinant, then the result will be a rotation plus a flip i.e. it will have a determinant of -1.
Definition at line 107 of file albaMatrix3x3.h.
References albaTimeStamped::Modified(), and Orthogonalize().
Referenced by Orthogonalize().
|
static |
Diagonalize a symmetric 3x3 matrix and return the eigenvalues in w and the eigenvectors in the columns of V.
The matrix V will have a positive determinant, and the three eigenvectors will be aligned as closely as possible with the x, y, and z axes.
|
inlinestatic |
Return the determinant of a 3x3 matrix.
Definition at line 235 of file albaMatrix3x3.h.
|
inline |
Compute the determinant of the matrix and return it.
Definition at line 120 of file albaMatrix3x3.h.
References Determinant().
Referenced by Determinant().
|
inlinestatic |
Definition at line 243 of file albaMatrix3x3.h.
|
inlinestatic |
Definition at line 252 of file albaMatrix3x3.h.
References Determinant2x2().
|
static |
Convert a quaternion to a 3x3 rotation matrix.
The quaternion does not have to be normalized beforehand.
|
inline |
Convert a quaternion to a 3x3 rotation matrix.
The quaternion does not have to be normalized beforehand.
Definition at line 138 of file albaMatrix3x3.h.
References QuaternionToMatrix().
Referenced by QuaternionToMatrix().
|
static |
Convert a 3x3 matrix into a quaternion.
This will provide the best possible answer even if the matrix is not a pure rotation matrix. The method used is that of B.K.P. Horn.
|
inline |
Convert a 3x3 matrix into a quaternion.
This will provide the best possible answer even if the matrix is not a pure rotation matrix. The method used is that of B.K.P. Horn.
Definition at line 150 of file albaMatrix3x3.h.
References MatrixToQuaternion().
Referenced by MatrixToQuaternion().
|
static |
Perform singular value decomposition on a 3x3 matrix.
This is not done using a conventional SVD algorithm, instead it is done using Orthogonalize3x3 and Diagonalize3x3. Both output matrices U and VT will have positive determinants, and the w values will be arranged such that the three rows of VT are aligned as closely as possible with the x, y, and z axes respectively. If the determinant of A is negative, then the three w values will be negative.
|
inline |
Perform singular value decomposition on a 3x3 matrix.
See the static version.
Definition at line 165 of file albaMatrix3x3.h.
|
static |
|
static |
Jacobi iteration for the solution of eigenvectors/eigenvalues of this 3x3 real symmetric matrix.
Output eigenvalues in w; and output eigenvectors in v. Resulting eigenvalues/vectors are sorted in decreasing order; eigenvectors are normalized. JacobiN iteration for the solution of eigenvectors/eigenvalues of a nxn real symmetric matrix. Square nxn matrix a; size of matrix in n; output eigenvalues in w; and output eigenvectors in v. Resulting eigenvalues/vectors are sorted in decreasing order; eigenvectors are normalized. w and v need to be allocated previously
|
static |
LU Factorization of a 3x3 matrix.
The diagonal elements are the multiplicative inverse of those in the standard LU factorization.
|
inline |
Definition at line 194 of file albaMatrix3x3.h.
References LUFactor().
Referenced by LUFactor().
|
static |
LU back substitution for a 3x3 matrix.
The diagonal elements are the multiplicative inverse of those in the standard LU factorization.
|
inline |
Definition at line 200 of file albaMatrix3x3.h.
|
inlinestatic |
|
inlinestatic |
Definition at line 206 of file albaMatrix3x3.h.
|
inlinestatic |
Definition at line 207 of file albaMatrix3x3.h.
|
inline |
bracket operator to access & write single elements
Definition at line 210 of file albaMatrix3x3.h.
|
inline |
bracket operator to access single elements
Definition at line 213 of file albaMatrix3x3.h.
|
inlinestatic |
Calculate the determinant of a 2x2 matrix: | a b | | c d |.
Definition at line 216 of file albaMatrix3x3.h.
Referenced by Determinant().
|
inlinestatic |
Calculate the determinant of a 2x2 matrix with columns c1 and c2.
Definition at line 219 of file albaMatrix3x3.h.
|
inlinestatic |
Compute the norm of 3-vector (double-precision version).
Definition at line 223 of file albaMatrix3x3.h.
Referenced by Normalize().
|
inlinestatic |
Definition at line 263 of file albaMatrix3x3.h.
|
inlinestatic |
Definition at line 272 of file albaMatrix3x3.h.
References Norm().
|
protected |
internal representation
Definition at line 231 of file albaMatrix3x3.h.