MaterialX 1.39.1
|
The class template for square matrices of scalar values. More...
#include <Types.h>
Public Types | |
using | RowArray = typename std::array< S, N > |
using | Iterator = typename std::array< RowArray, N >::iterator |
using | ConstIterator = typename std::array< RowArray, N >::const_iterator |
Public Member Functions | |
MatrixN (Uninit) | |
MatrixN (S s) | |
MatrixN (const S *begin, const S *end) | |
Comparison Operators | |
bool | operator== (const M &rhs) const |
Return true if the given matrix is identical to this one. | |
bool | operator!= (const M &rhs) const |
Return true if the given matrix differs from this one. | |
bool | isEquivalent (const M &rhs, S tolerance) const |
Return true if the given matrix is equivalent to this one within a given floating-point tolerance. | |
Indexing Operators | |
RowArray & | operator[] (size_t i) |
Return the row array at the given index. | |
const RowArray & | operator[] (size_t i) const |
Return the const row array at the given index. | |
Component-wise Operators | |
M | operator+ (const M &rhs) const |
Component-wise addition of two matrices. | |
MatrixN & | operator+= (const M &rhs) |
Component-wise addition of two matrices. | |
M | operator- (const M &rhs) const |
Component-wise subtraction of two matrices. | |
MatrixN & | operator-= (const M &rhs) |
Component-wise subtraction of two matrices. | |
M | operator* (S s) const |
Component-wise multiplication of a matrix and a scalar. | |
MatrixN & | operator*= (S s) |
Component-wise multiplication of a matrix and a scalar. | |
M | operator/ (S s) const |
Component-wise division of a matrix by a scalar. | |
MatrixN & | operator/= (S s) |
Component-wise division of a matrix by a scalar. | |
Matrix Algebra | |
M | operator* (const M &rhs) const |
Compute the matrix product. | |
MatrixN & | operator*= (const M &rhs) |
Compute the matrix product. | |
M | operator/ (const M &rhs) const |
Divide the first matrix by the second (computed as the product of the first matrix and the inverse of the second). | |
MatrixN & | operator/= (const M &rhs) |
Divide the first matrix by the second (computed as the product of the first matrix and the inverse of the second). | |
Iterators | |
Iterator | begin () |
ConstIterator | begin () const |
Iterator | end () |
ConstIterator | end () const |
Utility | |
S * | data () |
Return a pointer to the underlying data array. | |
const S * | data () const |
Return a const pointer to the underlying data array. | |
Protected Attributes | |
std::array< RowArray, N > | _arr |
The class template for square matrices of scalar values.
Inherited by Matrix33 and Matrix44.
The elements of a MatrixN are stored in row-major order, and may be accessed using the syntax matrix[row][column]
.
Template parameter M is the matrix subclass, S is the scalar element type, and N is the number of rows and columns in the matrix.