29 # pragma warning (disable : 4127)
61 for (
int r = 0; r < 3; ++r) {
71 for (
int c = 0; c < 3; ++c) {
86 Matrix3 (
const float aafEntry[3][3]);
88 Matrix3 (
float fEntry00,
float fEntry01,
float fEntry02,
89 float fEntry10,
float fEntry11,
float fEntry12,
90 float fEntry20,
float fEntry21,
float fEntry22);
114 void set(
float fEntry00,
float fEntry01,
float fEntry02,
115 float fEntry10,
float fEntry11,
float fEntry12,
116 float fEntry20,
float fEntry21,
float fEntry22);
124 return (
float*)&elt[iRow][0];
130 return (
const float*)&elt[iRow][0];
133 inline operator float* () {
134 return (
float*)&elt[0][0];
137 inline operator const float* ()
const{
138 return (
const float*)&elt[0][0];
149 memcpy(elt, rkMatrix.
elt, 9 *
sizeof(
float));
173 for (
int r = 0; r < 3; ++r) {
214 if ((&out == &A) || (&out == &B)) {
245 bool inverse (
Matrix3& rkInverse,
float fTolerance = 1e-06f)
const;
315 float& rfRAngle)
const;
317 float& rfRAngle)
const;
319 float& rfRAngle)
const;
321 float& rfRAngle)
const;
323 float& rfRAngle)
const;
325 float& rfRAngle)
const;
335 Vector3 akEigenvector[3])
const;
367 void tridiagonal (
float afDiag[3],
float afSubDiag[3]);
368 bool qLAlgorithm (
float afDiag[3],
float afSubDiag[3]);
389 for (
int r = 0; r < 3; ++r) {
391 rkPoint[0] * rkMatrix.
elt[0][r] +
392 rkPoint[1] * rkMatrix.
elt[1][r] +
393 rkPoint[2] * rkMatrix.
elt[2][r];
static const int ms_iSvdMaxIterations
Definition: Matrix3.h:372
bool fuzzyEq(const Matrix3 &b) const
Definition: Matrix3.cpp:83
bool toEulerAnglesZXY(float &rfYAngle, float &rfPAngle, float &rfRAngle) const
Definition: Matrix3.cpp:1499
void tridiagonal(float afDiag[3], float afSubDiag[3])
Definition: Matrix3.cpp:1684
void qDUDecomposition(Matrix3 &rkQ, Vector3 &rkD, Vector3 &rkU) const
Definition: Matrix3.cpp:901
static float maxCubicRoot(float afCoeff[3])
Definition: Matrix3.cpp:1106
float x
Definition: Vector3.h:62
void orthonormalize()
Definition: Matrix3.cpp:838
bool toEulerAnglesXYZ(float &rfYAngle, float &rfPAngle, float &rfRAngle) const
Definition: Matrix3.cpp:1383
bool toEulerAnglesXZY(float &rfYAngle, float &rfPAngle, float &rfRAngle) const
Definition: Matrix3.cpp:1412
void setRow(int iRow, const Vector3 &vector)
Definition: Matrix3.cpp:224
static const float ms_fSvdEpsilon
Definition: Matrix3.h:371
static Matrix3 fromEulerAnglesYXZ(float fYAngle, float fPAngle, float fRAngle)
Definition: Matrix3.cpp:1598
static Matrix3 diagonal(float e00, float e11, float e22)
Definition: Matrix3.h:99
Matrix3 operator+(const Matrix3 &rkMatrix) const
Definition: Matrix3.cpp:250
void deserialize(class BinaryInput &b)
Definition: Matrix3.cpp:182
static void golubKahanStep(Matrix3 &kA, Matrix3 &kL, Matrix3 &kR)
Definition: Matrix3.cpp:577
void singularValueComposition(const Matrix3 &rkL, const Vector3 &rkS, const Matrix3 &rkR)
Definition: Matrix3.cpp:815
bool any(float x)
Definition: g3dmath.h:424
Matrix3 & operator/=(float k)
Definition: Matrix3.cpp:354
Matrix3 & operator=(const Matrix3 &rkMatrix)
Definition: Matrix3.h:148
static Matrix3 fromUnitAxisAngle(const Vector3 &rkAxis, float fRadians)
Definition: Matrix3.cpp:1350
static void _transpose(const Matrix3 &A, Matrix3 &out)
Definition: Matrix3.cpp:1919
float spectralNorm() const
Definition: Matrix3.cpp:1157
float * operator[](int iRow)
Definition: Matrix3.h:121
float y
Definition: Vector3.h:62
static Matrix3 fromAxisAngle(const Vector3 &rkAxis, float fRadians)
Definition: Matrix3.cpp:1346
Any toAny() const
Definition: Matrix3.cpp:53
static const float EPSILON
Definition: Matrix3.h:341
float frobeniusNorm() const
Definition: Matrix3.cpp:1210
float lInfNorm() const
Definition: Matrix3.cpp:1230
void eigenSolveSymmetric(float afEigenvalue[3], Vector3 akEigenvector[3]) const
Definition: Matrix3.cpp:1825
static void _mul(const Matrix3 &A, const Matrix3 &B, Matrix3 &out)
Definition: Matrix3.cpp:1869
Matrix3 & operator-=(const Matrix3 &rkMatrix)
Definition: Matrix3.cpp:303
bool isRightHanded() const
Definition: Matrix3.cpp:95
bool qLAlgorithm(float afDiag[3], float afSubDiag[3])
Definition: Matrix3.cpp:1740
bool operator>=(const Matrix3 &) const
Easy loading and saving of human-readable configuration files.
Definition: Any.h:184
float squaredFrobeniusNorm() const
Definition: Matrix3.cpp:1198
void setColumn(int iCol, const Vector3 &vector)
Definition: Matrix3.cpp:216
#define debugAssert(exp)
Definition: debugAssert.h:160
static Matrix3 fromEulerAnglesZXY(float fYAngle, float fPAngle, float fRAngle)
Definition: Matrix3.cpp:1644
static Matrix3 fromEulerAnglesXZY(float fYAngle, float fPAngle, float fRAngle)
Definition: Matrix3.cpp:1577
bool inverse(Matrix3 &rkInverse, float fTolerance=1e-06f) const
Definition: Matrix3.cpp:404
void toAxisAngle(Vector3 &rkAxis, float &rfRadians) const
Definition: Matrix3.cpp:1262
bool toEulerAnglesYZX(float &rfYAngle, float &rfPAngle, float &rfRAngle) const
Definition: Matrix3.cpp:1470
bool toEulerAnglesYXZ(float &rfYAngle, float &rfPAngle, float &rfRAngle) const
Definition: Matrix3.cpp:1441
static Matrix3 fromRows(const Vector3 &r0, const Vector3 &r1, const Vector3 &r2)
Definition: Matrix3.h:69
G3D::int16 y
Definition: Vector2int16.h:38
bool operator<=(const Matrix3 &) const
bool operator!=(const Matrix3 &rkMatrix) const
Definition: Matrix3.cpp:245
bool isOrthonormal() const
Definition: Matrix3.cpp:107
static Matrix3 fromColumns(const Vector3 &c0, const Vector3 &c1, const Vector3 &c2)
Definition: Matrix3.h:59
std::string toString() const
Definition: Matrix3.cpp:1932
float diffOneNorm(const Matrix3 &y) const
Definition: Matrix3.cpp:1246
static void transpose(const Matrix3 &A, Matrix3 &out)
Definition: Matrix3.h:233
static const Matrix3 & zero()
Definition: Matrix3.cpp:65
Matrix3 operator-() const
Definition: Matrix3.cpp:329
Vector3 column(int c) const
Definition: Matrix3.cpp:203
float z
Definition: Vector3.h:62
void singularValueDecomposition(Matrix3 &rkL, Vector3 &rkS, Matrix3 &rkR) const
Definition: Matrix3.cpp:708
static Matrix3 fromDiagonal(const Vector3 &d)
Definition: Matrix3.h:297
Definition: BinaryOutput.h:52
bool operator==(const Matrix3 &rkMatrix) const
Definition: Matrix3.cpp:233
Matrix3 transpose() const
Definition: Matrix3.cpp:391
void polarDecomposition(Matrix3 &R, Matrix3 &S) const
Definition: Matrix3.cpp:1015
void set(float fEntry00, float fEntry01, float fEntry02, float fEntry10, float fEntry11, float fEntry12, float fEntry20, float fEntry21, float fEntry22)
Definition: Matrix3.cpp:165
static void bidiagonalize(Matrix3 &kA, Matrix3 &kL, Matrix3 &kR)
Definition: Matrix3.cpp:470
Matrix3 & operator*=(const Matrix3 &rkMatrix)
Definition: Matrix3.cpp:313
bool operator<(const Matrix3 &) const
float l1Norm() const
Definition: Matrix3.cpp:1215
static void mul(const Matrix3 &A, const Matrix3 &B, Matrix3 &out)
Definition: Matrix3.h:213
static Matrix3 fromEulerAnglesZYX(float fYAngle, float fPAngle, float fRAngle)
Definition: Matrix3.cpp:1664
const Vector3 & row(int r) const
Definition: Matrix3.cpp:210
static Matrix3 fromEulerAnglesYZX(float fYAngle, float fPAngle, float fRAngle)
Definition: Matrix3.cpp:1621
float elt[3][3]
Definition: Matrix3.h:41
bool toEulerAnglesZYX(float &rfYAngle, float &rfPAngle, float &rfRAngle) const
Definition: Matrix3.cpp:1528
bool operator>(const Matrix3 &) const
Matrix3 operator*(const Matrix3 &rkMatrix) const
Definition: Matrix3.cpp:278
G3D::Color3 operator*(float s, const G3D::Color3 &c)
Definition: Color3.h:275
float determinant() const
Definition: Matrix3.cpp:453
static const Matrix3 & identity()
Definition: Matrix3.cpp:70
static void tensorProduct(const Vector3 &rkU, const Vector3 &rkV, Matrix3 &rkProduct)
Definition: Matrix3.cpp:1851
Matrix3()
Definition: Matrix3.h:83
static Matrix3 fromEulerAnglesXYZ(float fYAngle, float fPAngle, float fRAngle)
Definition: Matrix3.cpp:1557
Matrix3 & operator+=(const Matrix3 &rkMatrix)
Definition: Matrix3.cpp:293
void serialize(class BinaryOutput &b) const
Definition: Matrix3.cpp:192