A matrix with run-time variable dimensions, up to an element limit defined at compile-time. 更多...
#include <DenseMatrix.h>
Public 成员函数 | |
| FORCEINLINE int32 | AddRows (const int32 InNumRows) |
| Add uninitialized rows to the matrix. 更多... | |
| FORCEINLINE FReal & | At (const int32 RowIndex, const int32 ColumnIndex) |
| Return a writable reference to the element at the specified row and column. | |
| FORCEINLINE const FReal & | At (const int32 RowIndex, const int32 ColumnIndex) const |
| Return a read-only reference to the element at the specified row and column. | |
| void | Init (const int32 InNRows, const int32 InNCols, FReal V) |
| Set the dimensions and initial values of the matrix. | |
| FORCEINLINE int32 | NumColumns () const |
| The number of columns in the matrix. | |
| FORCEINLINE int32 | NumElements () const |
| The number of elements in the matrix. | |
| FORCEINLINE int32 | NumRows () const |
| The number of rows in the matrix. | |
| void | Set (FReal V) |
| Set all elements to 'V'. | |
| FORCEINLINE void | SetAt (const int32 RowIndex, const int32 ColumnIndex, const FReal V) |
| Set the element | |
| void | SetBlockAt (const int32 RowOffset, const int32 ColumnOffset, const FMatrix33 &V) |
| Set the 3x3 block starting at ("RowOffset", "ColumnOffset") from the specified 3x3 matrix "V" (note: assumes the input UE matrix is column-major order) | |
| template<int32 T_EA> | |
| void | SetBlockAt (const int32 RowOffset, const int32 ColumnOffset, const TDenseMatrix< T_EA > &V) |
| Set the block starting at ("RowOffset", "ColumnOffset") from the specified matrix "V" | |
| void | SetBlockAtDiagonal33 (const int32 RowOffset, const int32 ColumnOffset, const FReal VDiag, const FReal VOffDiag) |
| Set the specified 3x3 block to a diagonal matrix with the specified diagonal and off-diagonal values. | |
| void | SetColumnAt (const int32 RowIndex, const int32 ColumnIndex, const FReal *V, const int32 NumV) |
| Starting from element ("RowIndex", "ColumnIndex"), set the next "NumV" elements in the column to the values in "V". | |
| void | SetDiagonal (FReal V) |
| Set the diagonal elements to 'V'. 更多... | |
| void | SetDiagonalAt (int32 Start, int32 Num, FReal V) |
| Set the "Num" diagonal elements starting from ("Start", "Start") to "V". 更多... | |
| FORCEINLINE void | SetDimensions (const int32 InNumRows, const int32 InNumColumns) |
| Set the dimensions of the matrix, but do not initialize any values. 更多... | |
| void | SetRowAt (const int32 RowIndex, const int32 ColumnIndex, const FReal *V, const int32 NumV) |
| Starting from element ("RowIndex", "ColumnIndex"), set the next "NumV" elements in the row to the values in "V". | |
静态 Public 成员函数 | |
| template<int32 T_EA, int32 T_EB> | |
| static TDenseMatrix< MaxElements > | Add (const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B) |
| Return C = A + B | |
| template<int32 T_EA, int32 T_EB> | |
| static TDenseMatrix< MaxElements > | Add_Symmetric (const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B) |
| Return C = A + B, where A and B are symetric. | |
| template<int32 T_EA> | |
| static TDenseMatrix< MaxElements > | Divide (const TDenseMatrix< T_EA > &A, const FReal V) |
| Return C = A / V, where A is an MxN matrix, and V a real number. | |
| template<int32 T_EA, int32 T_EB> | |
| static TDenseMatrix< MaxElements > | DotProduct (const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B) |
| Return C = At x B. 更多... | |
| static TDenseMatrix< MaxElements > | Make (const FMatrix33 &InM) |
| Create a copy of the 3x3 matrix. | |
| static TDenseMatrix< MaxElements > | Make (const FVec3 &InM) |
| Create a copy of the 3x1 columns vector. | |
| static TDenseMatrix< MaxElements > | Make (const int32 InNumRows, const int32 InNumCols) |
| Create a matrix with the specified dimensions, but all elements are uninitialized. | |
| static TDenseMatrix< MaxElements > | Make (const int32 InNumRows, const int32 InNumCols, const FReal *V, const int32 VLen) |
| Create a matrix with the specified elements supplied as an array in row-major order (i.e., the first N elements are for Row 0, the next N for Row 1, etc., where N is the number of columns). | |
| static TDenseMatrix< MaxElements > | Make (const int32 InNumRows, const int32 InNumCols, const FReal V) |
| Create a matrix with the specified dimensions, and initialize all elements with "V". | |
| static TDenseMatrix< MaxElements > | MakeDiagonal (const int32 InNumRows, const int32 InNumCols, const FReal D) |
| Create a matrix with all elemets set to zero, except the diagonal elements. | |
| static TDenseMatrix< MaxElements > | MakeIdentity (const int32 InDim) |
| Create an identity matrix. | |
| template<int32 T_EA> | |
| static TDenseMatrix< MaxElements > | Multiply (const FReal V, const TDenseMatrix< T_EA > &A) |
| Return C = A x V, where A is an MxN matrix, and V a real number. | |
| template<int32 T_EA> | |
| static TDenseMatrix< MaxElements > | Multiply (const TDenseMatrix< T_EA > &A, const FReal V) |
| Return C = A x V, where A is an MxN matrix, and V a real number. | |
| template<int32 T_EB> | |
| static TDenseMatrix< MaxElements > | MultiplyAB (const FMassMatrix &A, const TDenseMatrix< T_EB > &B) |
| Return C = A x B, where B is an 6xN matrix, and A is a 6x6 mass matrix (Mass in upper left 3x3 diagonals, Inertia in lower right 3x3). 更多... | |
| template<int32 T_EA> | |
| static TDenseMatrix< MaxElements > | MultiplyAB (const TDenseMatrix< T_EA > &A, const FMassMatrix &B) |
| Return C = A x B, where A is an Nx6 matrix, and B is a 6x6 mass matrix (Mass in upper left 3x3 diagonals, Inertia in lower right 3x3). 更多... | |
| template<int32 T_EA, int32 T_EB> | |
| static TDenseMatrix< MaxElements > | MultiplyAB (const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B) |
| Return C = A x B, the product of A and B where each element of C is Cij = DotProduct(A.GetRow(i), B.GetColumns(j)). 更多... | |
| template<int32 T_EA, int32 T_EB> | |
| static TDenseMatrix< MaxElements > | MultiplyAB_Symmetric (const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B) |
| Return C = A x B, where the results is known to be symmetric. 更多... | |
| template<int32 T_EB> | |
| static TDenseMatrix< MaxElements > | MultiplyABt (const FMassMatrix &A, const TDenseMatrix< T_EB > &B) |
| Return C = A x Transpose(B), where B is an Nx6 matrix, and A is a 6x6 mass matrix (Mass in upper left 3x3 diagonals, Inertia in lower right 3x3). 更多... | |
| template<int32 T_EA, int32 T_EB> | |
| static TDenseMatrix< MaxElements > | MultiplyABt (const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B) |
| Return C = A x Transpose(B). 更多... | |
| template<int32 T_EA, int32 T_EB> | |
| static TDenseMatrix< MaxElements > | MultiplyAtB (const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B) |
| Return C = Transpose(A) x B. 更多... | |
| template<int32 T_EA, int32 T_EB> | |
| static TDenseMatrix< MaxElements > | MultiplyAtBt (const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B) |
| Return C = Transpose(A) x Transpose(B). 更多... | |
| template<int32 T_EA, int32 T_EB, int32 T_EC> | |
| static TDenseMatrix< MaxElements > | MultiplyBCAddA_Symmetric (const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B, const TDenseMatrix< T_EC > &C) |
| Return C = A + B x C, where the A and (B x C) are known to be symmetric. 更多... | |
| template<int32 T_EA> | |
| static TDenseMatrix< MaxElements > | Negate (const TDenseMatrix< T_EA > &A) |
| Copy a matrix and set each element to its negative. | |
| template<int32 T_EA, int32 T_EB> | |
| static TDenseMatrix< MaxElements > | Subtract (const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B) |
| Return C = A - B | |
| template<int32 T_EA> | |
| static TDenseMatrix< MaxElements > | Transpose (const TDenseMatrix< T_EA > &A) |
| Return the transpose of 'A'. | |
A matrix with run-time variable dimensions, up to an element limit defined at compile-time.
Elements are stored in row-major order (i.e., elements in a row are adjacent in memory). Note that FMatrix stores elements in column-major order so that we can access the columns quickly which is handy when you have rotation matrices and want the spatial axes. We don't care about that so we use the more conventional row-major indexing and matching storage.
|
inline |
Add uninitialized rows to the matrix.
This will not invalidate data in any previously added rows, so it can be used to build NxM matrices where M is known, but N is calculated later. /return the index of the first new row.
|
inlinestatic |
Return C = At x B.
If A and B are column vectors (Nx1 matrices), this is a vector dot product.
|
inlinestatic |
Return C = A x B, where B is an 6xN matrix, and A is a 6x6 mass matrix (Mass in upper left 3x3 diagonals, Inertia in lower right 3x3).
C = |M 0| * |B0| = |M.B0| |0 I| |B1| |I.B1|
|
inlinestatic |
Return C = A x B, where A is an Nx6 matrix, and B is a 6x6 mass matrix (Mass in upper left 3x3 diagonals, Inertia in lower right 3x3).
C = |A0 A1| * |M 0| = |A0.M A1.I| |0 I|
|
inlinestatic |
Return C = A x B, the product of A and B where each element of C is Cij = DotProduct(A.GetRow(i), B.GetColumns(j)).
/see MultiplyAtB, MultiplyABt, MultipltAtBt.
|
inlinestatic |
Return C = A x B, where the results is known to be symmetric.
/see MultiplyAtB.
|
inlinestatic |
Return C = A x Transpose(B), where B is an Nx6 matrix, and A is a 6x6 mass matrix (Mass in upper left 3x3 diagonals, Inertia in lower right 3x3).
C = |M 0| * |B0 B1|(T) = |M.B0(T)| |0 I| |I.B1(T)|
|
inlinestatic |
Return C = A x Transpose(B).
/see MultiplyAB, MultiplyAtB, MultipltAtBt.
|
inlinestatic |
Return C = Transpose(A) x B.
/see MultiplyAB, MultiplyABt, MultipltAtBt.
|
inlinestatic |
Return C = Transpose(A) x Transpose(B).
/see MultiplyAB, MultiplyAtB, MultipltABt.
|
inlinestatic |
Return C = A + B x C, where the A and (B x C) are known to be symmetric.
/see MultiplyAtB, Add_Symmetric.
|
inline |
Set the diagonal elements to 'V'.
Does not set off-diagonal elements. /see MakeDiagonal
|
inline |
Set the "Num" diagonal elements starting from ("Start", "Start") to "V".
Does not set off-diagonal elements.
|
inline |
Set the dimensions of the matrix, but do not initialize any values.
This will invalidate any existing data.