Navigation
API > API/Runtime > API/Runtime/Chaos
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.
| Name | TDenseMatrix |
| Type | class |
| Header File | /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/DenseMatrix.h |
| Include Path | #include "Chaos/DenseMatrix.h" |
Syntax
template<int32 T_MAXELEMENTS>
class TDenseMatrix
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TDenseMatrix
(
const int32 InNRows, |
Chaos/DenseMatrix.h | ||
TDenseMatrix
(
const TDenseMatrix< MaxElements >& A |
Chaos/DenseMatrix.h | ||
TDenseMatrix
(
const int32 InNRows, |
Chaos/DenseMatrix.h | ||
TDenseMatrix
(
const int32 InNRows, |
Chaos/DenseMatrix.h | ||
TDenseMatrix () |
Chaos/DenseMatrix.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| MaxElements | const int32 | Chaos/DenseMatrix.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| M | FReal | Chaos/DenseMatrix.h | ||
| NCols | int32 | Chaos/DenseMatrix.h | ||
| NRows | int32 | Chaos/DenseMatrix.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 AddRows
(
const int32 InNumRows |
Add uninitialized rows to the matrix. | Chaos/DenseMatrix.h | |
FReal & At
(
const int32 RowIndex, |
Return a writable reference to the element at the specified row and column. | Chaos/DenseMatrix.h | |
const FReal & At
(
const int32 RowIndex, |
Return a read-only reference to the element at the specified row and column. | Chaos/DenseMatrix.h | |
void Init
(
const int32 InNRows, |
Set the dimensions and initial values of the matrix. | Chaos/DenseMatrix.h | |
int32 NumColumns() |
The number of columns in the matrix. | Chaos/DenseMatrix.h | |
int32 NumElements() |
The number of elements in the matrix. | Chaos/DenseMatrix.h | |
int32 NumRows() |
The number of rows in the matrix. | Chaos/DenseMatrix.h | |
void Set
(
FReal V |
Set all elements to 'V'. | Chaos/DenseMatrix.h | |
void SetAt
(
const int32 RowIndex, |
Set the element | Chaos/DenseMatrix.h | |
void SetBlockAt
(
const int32 RowOffset, |
Set the block starting at ("RowOffset", "ColumnOffset") from the specified matrix "V" | Chaos/DenseMatrix.h | |
void SetBlockAt
(
const int32 RowOffset, |
Set the 3x3 block starting at ("RowOffset", "ColumnOffset") from the specified 3x3 matrix "V" (note: assumes the input UE matrix is column-major order) | Chaos/DenseMatrix.h | |
void SetBlockAtDiagonal33
(
const int32 RowOffset, |
Set the specified 3x3 block to a diagonal matrix with the specified diagonal and off-diagonal values. | Chaos/DenseMatrix.h | |
void SetColumnAt
(
const int32 RowIndex, |
Chaos/DenseMatrix.h | ||
void SetColumnAt
(
const int32 RowIndex, |
Starting from element ("RowIndex", "ColumnIndex"), set the next "NumV" elements in the column to the values in "V". | Chaos/DenseMatrix.h | |
void SetDiagonal
(
FReal V |
Set the diagonal elements to 'V'. Does not set off-diagonal elements. /see MakeDiagonal | Chaos/DenseMatrix.h | |
void SetDiagonalAt
(
int32 Start, |
Set the "Num" diagonal elements starting from ("Start", "Start") to "V". | Chaos/DenseMatrix.h | |
void SetDimensions
(
const int32 InNumRows, |
Set the dimensions of the matrix, but do not initialize any values. | Chaos/DenseMatrix.h | |
void SetRowAt
(
const int32 RowIndex, |
Chaos/DenseMatrix.h | ||
void SetRowAt
(
const int32 RowIndex, |
Chaos/DenseMatrix.h | ||
void SetRowAt
(
const int32 RowIndex, |
Starting from element ("RowIndex", "ColumnIndex"), set the next "NumV" elements in the row to the values in "V". | Chaos/DenseMatrix.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TDenseMatrix< MaxElements > Add
(
const TDenseMatrix< T_EA >& A, |
Return C = A + B | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Add_Symmetric
(
const TDenseMatrix< T_EA >& A, |
Return C = A + B, where A and B are symetric. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Divide
(
const TDenseMatrix< T_EA >& A, |
Return C = A / V, where A is an MxN matrix, and V a real number. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > DotProduct
(
const TDenseMatrix< T_EA >& A, |
Return C = At x B. If A and B are column vectors (Nx1 matrices), this is a vector dot product. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Make
(
const FVec3& InM |
Create a copy of the 3x1 columns vector. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Make
(
const FMatrix33& InM |
Create a copy of the 3x3 matrix. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Make
(
const int32 InNumRows, |
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). | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Make
(
const int32 InNumRows, |
Create a matrix with the specified dimensions, and initialize all elements with "V". | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Make
(
const int32 InNumRows, |
Factory methods Create a matrix with the specified dimensions, but all elements are uninitialized. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MakeDiagonal
(
const int32 InNumRows, |
Create a matrix with all elemets set to zero, except the diagonal elements. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MakeIdentity
(
const int32 InDim |
Create an identity matrix. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Multiply
(
const FReal V, |
Return C = A x V, where A is an MxN matrix, and V a real number. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Multiply
(
const TDenseMatrix< T_EA >& A, |
Return C = A x V, where A is an MxN matrix, and V a real number. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MultiplyAB
(
const FMassMatrix& A, |
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). | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MultiplyAB
(
const TDenseMatrix< T_EA >& A, |
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). | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MultiplyAB
(
const TDenseMatrix< T_EA >& A, |
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)). | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MultiplyAB_Symmetric
(
const TDenseMatrix< T_EA >& A, |
Return C = A x B, where the results is known to be symmetric. /see MultiplyAtB. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MultiplyABt
(
const FMassMatrix& A, |
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). | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MultiplyABt
(
const TDenseMatrix< T_EA >& A, |
Return C = A x Transpose(B). /see MultiplyAB, MultiplyAtB, MultipltAtBt. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MultiplyAtB
(
const TDenseMatrix< T_EA >& A, |
Return C = Transpose(A) x B. /see MultiplyAB, MultiplyABt, MultipltAtBt. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MultiplyAtBt
(
const TDenseMatrix< T_EA >& A, |
Return C = Transpose(A) x Transpose(B). /see MultiplyAB, MultiplyAtB, MultipltABt. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > MultiplyBCAddA_Symmetric
(
const TDenseMatrix< T_EA >& A, |
Return C = A + B x C, where the A and (B x C) are known to be symmetric. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Negate
(
const TDenseMatrix< T_EA >& A |
Copy a matrix and set each element to its negative. | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Subtract
(
const TDenseMatrix< T_EA >& A, |
Return C = A - B | Chaos/DenseMatrix.h | |
static TDenseMatrix< MaxElements > Transpose
(
const TDenseMatrix< T_EA >& A |
Math operations Return the transpose of 'A'. | Chaos/DenseMatrix.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TDenseMatrix< MaxElements > & operator=
(
const TDenseMatrix< MaxElements >& A |
Chaos/DenseMatrix.h |