21 template <
typename Real>
30 GMatrix(
int numRow,
int numCols);
36 GMatrix(
int numRows,
int numCols,
int r,
int c);
46 void SetSize(
int numRows,
int numCols);
47 inline void GetSize(
int& numRows,
int& numCols)
const;
51 inline Real
const&
operator()(
int r,
int c)
const;
82 static GMatrix Unit(
int numRows,
int numCols,
int r,
int c);
93 template <
typename Real>
96 template <
typename Real>
100 template <
typename Real>
103 template <
typename Real>
106 template <
typename Real>
109 template <
typename Real>
112 template <
typename Real>
115 template <
typename Real>
118 template <
typename Real>
121 template <
typename Real>
124 template <
typename Real>
128 template <
typename Real>
131 template <
typename Real>
134 template <
typename Real>
137 template <
typename Real>
139 bool* reportInvertibility =
nullptr);
141 template <
typename Real>
145 template <
typename Real>
149 template <
typename Real>
153 template <
typename Real>
157 template <
typename Real>
160 template <
typename Real>
164 template <
typename Real>
168 template <
typename Real>
172 template <
typename Real>
176 template <
typename Real>
180 template <
typename Real>
184 template <
typename Real>
189 template <
typename Real>
193 template <
typename Real>
201 template <
typename Real>
208 template <
typename Real>
215 template <
typename Real>
218 if (numRows > 0 && numCols > 0)
232 template <
typename Real>
inline 239 template <
typename Real>
inline 245 template <
typename Real>
inline 251 template <
typename Real>
inline 254 return static_cast<int>(
mElements.size());
257 template <
typename Real>
inline 260 #if defined(GTE_ASSERT_ON_GMATRIX_INDEX_OUT_OF_RANGE) 265 #if defined(GTE_USE_ROW_MAJOR) 272 template <
typename Real>
inline 275 #if defined(GTE_ASSERT_ON_GMATRIX_INDEX_OUT_OF_RANGE) 280 #if defined(GTE_USE_ROW_MAJOR) 287 template <
typename Real>
290 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 299 template <
typename Real>
302 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 311 template <
typename Real>
322 template <
typename Real>
333 template <
typename Real>
inline 339 template <
typename Real>
inline 345 template <
typename Real>
inline 352 template <
typename Real>
inline 358 template <
typename Real>
inline 365 template <
typename Real>
inline 372 template <
typename Real>
inline 379 template <
typename Real>
inline 386 template <
typename Real>
392 template <
typename Real>
402 template <
typename Real>
407 for (
int i = 0; i < numDiagonal; ++i)
413 template <
typename Real>
421 template <
typename Real>
429 template <
typename Real>
439 template <
typename Real>
445 template <
typename Real>
456 template <
typename Real>
463 template <
typename Real>
470 template <
typename Real>
474 return result *= scalar;
477 template <
typename Real>
481 return result *= scalar;
484 template <
typename Real>
488 return result /= scalar;
491 template <
typename Real>
494 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 506 template <
typename Real>
509 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 521 template <
typename Real>
531 template <
typename Real>
534 if (scalar != (Real)0)
536 Real invScalar = ((Real)1) / scalar;
552 template <
typename Real>
563 template <
typename Real>
566 Real sum = M[0] * M[0];
567 for (
int i = 1; i < M.GetNumElements(); ++i)
574 template <
typename Real>
577 Real maxAbsElement = M[0];
581 if (absElement > maxAbsElement)
583 maxAbsElement = absElement;
586 return maxAbsElement;
589 template <
typename Real>
597 &invM[0], determinant,
nullptr,
nullptr,
nullptr, 0,
nullptr);
598 if (reportInvertibility)
600 *reportInvertibility = invertible;
605 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 609 if (reportInvertibility)
611 *reportInvertibility =
false;
617 template <
typename Real>
624 determinant,
nullptr,
nullptr,
nullptr, 0,
nullptr);
628 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 631 determinant = (Real)0;
636 template <
typename Real>
650 template <
typename Real>
653 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 668 template <
typename Real>
671 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 686 template <
typename Real>
692 template <
typename Real>
695 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 700 for (
int r = 0;
r <
result.GetNumRows(); ++
r)
702 for (
int c = 0;
c <
result.GetNumCols(); ++
c)
705 for (
int i = 0; i < numCommon; ++i)
714 template <
typename Real>
717 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 722 for (
int r = 0;
r <
result.GetNumRows(); ++
r)
724 for (
int c = 0;
c <
result.GetNumCols(); ++
c)
727 for (
int i = 0; i < numCommon; ++i)
736 template <
typename Real>
739 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 744 for (
int r = 0;
r <
result.GetNumRows(); ++
r)
746 for (
int c = 0;
c <
result.GetNumCols(); ++
c)
749 for (
int i = 0; i < numCommon; ++i)
758 template <
typename Real>
761 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 766 for (
int r = 0;
r <
result.GetNumRows(); ++
r)
768 for (
int c = 0;
c <
result.GetNumCols(); ++
c)
771 for (
int i = 0; i < numCommon; ++i)
780 template <
typename Real>
783 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 787 for (
int r = 0;
r <
result.GetNumRows(); ++
r)
789 for (
int c = 0;
c <
result.GetNumCols(); ++
c)
797 template <
typename Real>
800 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 804 for (
int r = 0;
r <
result.GetNumRows(); ++
r)
806 for (
int c = 0;
c <
result.GetNumCols(); ++
c)
814 template <
typename Real>
818 for (
int r = 0;
r <
result.GetNumRows(); ++
r)
820 for (
int c = 0;
c <
result.GetNumCols(); ++
c)
828 template <
typename Real>
831 #if defined(GTE_ASSERT_ON_GMATRIX_SIZE_MISMATCH) 835 for (
int i = 0; i < N*N; ++i)
840 for (
int i = 0; i < N; ++i)
std::vector< Real > mElements
static GMatrix Unit(int numRows, int numCols, int r, int c)
void SetSize(int numRows, int numCols)
bool operator==(GMatrix const &mat) const
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
#define LogAssert(condition, message)
DualQuaternion< Real > & operator*=(DualQuaternion< Real > &d, Real scalar)
Real const & operator[](int i) const
void MakeDiagonal(GVector< Real > const &D, GMatrix< Real > &M)
GVector< Real > GetRow(int r) const
GMatrix< Real > MultiplyMD(GMatrix< Real > const &M, GVector< Real > const &D)
int GetNumElements() const
bool operator>=(GMatrix const &mat) const
bool operator!=(GMatrix const &mat) const
void SetCol(int c, GVector< Real > const &vec)
void SetRow(int r, GVector< Real > const &vec)
GMatrix< Real > MultiplyATB(GMatrix< Real > const &A, GMatrix< Real > const &B)
GMatrix< Real > Transpose(GMatrix< Real > const &M)
DualQuaternion< Real > operator+(DualQuaternion< Real > const &d)
#define LogError(message)
DualQuaternion< Real > & operator-=(DualQuaternion< Real > &d0, DualQuaternion< Real > const &d1)
bool operator>(GMatrix const &mat) const
Real const & operator()(int r, int c) const
GMatrix< Real > MultiplyAB(GMatrix< Real > const &A, GMatrix< Real > const &B)
void GetSize(int &numRows, int &numCols) const
void MakeUnit(int r, int c)
GMatrix< Real > MultiplyATBT(GMatrix< Real > const &A, GMatrix< Real > const &B)
Real LInfinityNorm(GMatrix< Real > const &M)
GMatrix< Real > MultiplyABT(GMatrix< Real > const &A, GMatrix< Real > const &B)
DualQuaternion< Real > operator-(DualQuaternion< Real > const &d)
static GMatrix Identity(int numRows, int numCols)
static GMatrix Zero(int numRows, int numCols)
DualQuaternion< Real > & operator+=(DualQuaternion< Real > &d0, DualQuaternion< Real > const &d1)
bool operator<(GMatrix const &mat) const
Quaternion< Real > Inverse(Quaternion< Real > const &d)
Real L2Norm(GMatrix< Real > const &M)
Real Determinant(GMatrix< Real > const &M)
DualQuaternion< Real > & operator/=(DualQuaternion< Real > &d, Real scalar)
GVector< Real > GetCol(int c) const
Vector4< float > operator*(Transform const &M, Vector4< float > const &V)
GMatrix< Real > OuterProduct(GVector< Real > const &U, GVector< Real > const &V)
bool operator<=(GMatrix const &mat) const
Real L1Norm(GMatrix< Real > const &M)
DualQuaternion< Real > operator/(DualQuaternion< Real > const &d, Real scalar)
GMatrix< Real > MultiplyDM(GVector< Real > const &D, GMatrix< Real > const &M)