Mat_i (struct)¶
The Mat_i represents a dense matrix.
/*
** Example: Mat_i
*/
// create a 4 row, 3 column matrix
Mat_i mat(4, 3);
Methods¶
Mat_i ( in Integer rows, in Integer cols ) | |
Mat_i ( in Mat_i that ) | |
Mat_i () | |
Boolean | almostEqual ? ( in Mat_i that ) |
Boolean | almostEqual ? ( in Mat_i that, in SInt32 precision ) |
appendDesc ? ( io String string ) | |
Mat_i | clone ? () |
Integer | cols ? () |
Boolean | equal ? ( in Mat_i that ) |
SInt32 | get ? ( in Integer row, in Integer col ) |
UInt32 | hash ? () |
Mat_i | linearInterpolate ? ( in Mat_i that, in SInt32 t ) |
resize ! ( in Integer rows, in Integer cols ) | |
Integer | rows ? () |
set ! ( in Integer row, in Integer col, in SInt32 val ) | |
setAll ! ( in SInt32 val ) | |
setDiagonal ! ( in Integer size, in SInt32 val ) | |
setDiagonal ! ( in Vec_i vec ) | |
setIdentity ! ( in Integer size ) | |
setNull ! () | |
String | sizeDesc ? () |
Mat_i | sub ? ( in Integer rs, in Integer re, in Integer cs, in Integer ce ) |
Mat_i | topLeft ? ( in Integer rows, in Integer cols ) |
SInt32 | trace ? () |
Mat_i | transpose ? () |
Methods in detail¶
Mat_i ( in Integer rows, in Integer cols )
Construct a matrix with rows
and cols
dimensions
Construct a matrix from the matrix that
Mat_i ()
default constructor
Boolean Mat_i.almostEqual? ( in Mat_i that )
Returns true if this matrix is almost the same as another one (using a default precision)
Boolean Mat_i.almostEqual? ( in Mat_i that, in SInt32 precision )
Returns true if this matrix is almost the same as another one
Mat_i.appendDesc? ( io String string )
Append a String description of this matrix and its element
values to the io String string
clone method
Integer Mat_i.cols? ()
Boolean Mat_i.equal? ( in Mat_i that )
Returns true if this matrix is the same as another one
SInt32 Mat_i.get? ( in Integer row, in Integer col )
Return the element value at row
and col
Hash for this matrix
Mat_i Mat_i.linearInterpolate? ( in Mat_i that, in SInt32 t )
Linearly interpolates this matrix with another one based on a scalar blend value (0.0 to 1.0)
Mat_i.resize! ( in Integer rows, in Integer cols )
Resize the matrix to rows
and cols
dimensions
Integer Mat_i.rows? ()
Mat_i.set! ( in Integer row, in Integer col, in SInt32 val )
Set the element value at row
and col
Mat_i.setAll! ( in SInt32 val )
Set all the matrix element values to val
Mat_i.setDiagonal! ( in Integer size, in SInt32 val )
setting the diagonal components of this matrix to a scalar
Mat_i.setDiagonal! ( in Vec_i vec )
Set to a diagonal matrix given the diagonal elements
Mat_i.setIdentity! ( in Integer size )
Set the matrix to an identity matrix of size
rows and cols
Mat_i.setNull! ()
Set the values of all matrix elements to zero
Return a String description of this matrix and its dimensions
Mat_i Mat_i.sub? ( in Integer rs, in Integer re, in Integer cs, in Integer ce )
Mat_i Mat_i.topLeft? ( in Integer rows, in Integer cols )
Compute the trace of the matrix. The matrix must be square.