Mat (struct)

The Mat represents a dense matrix.

/*
** Example: Mat
*/

// create a 4 row, 3 column matrix
Mat mat(4, 3);

Mat Mat Mat

Members

Integer rows  
Scalar[] vals  

Methods

  Mat ( in Integer rows, in Integer cols )
  Mat ( in Mat that )
  Mat ()
Boolean almostEqual ? ( in Mat that )
Boolean almostEqual ? ( in Mat that, in Scalar precision )
  appendDesc ? ( io String string )
Mat clone ? ()
Integer cols ? ()
Boolean equal ? ( in Mat that )
Scalar get ? ( in Integer row, in Integer col )
UInt32 hash ? ()
Mat linearInterpolate ? ( in Mat that, in Scalar t )
  resize ! ( in Integer rows, in Integer cols )
Integer rows ? ()
  set ! ( in Integer row, in Integer col, in Scalar val )
  setAll ! ( in Scalar val )
  setDiagonal ! ( in Integer size, in Scalar val )
  setDiagonal ! ( in Vec vec )
  setIdentity ! ( in Integer size )
  setNull ! ()
String sizeDesc ? ()
Mat sub ? ( in Integer rs, in Integer re, in Integer cs, in Integer ce )
Mat topLeft ? ( in Integer rows, in Integer cols )
Scalar trace ? ()
Mat transpose ? ()

Operators

  - Mat
Mat = ( Param other )

Methods in detail

Mat ( in Integer rows, in Integer cols )

Construct a matrix with rows and cols dimensions


Mat ( in Mat that )

Construct a matrix from the matrix that


Mat ()

default constructor


Boolean Mat.almostEqual? ( in Mat that )

Returns true if this matrix is almost the same as another one (using a default precision)


Boolean Mat.almostEqual? ( in Mat that, in Scalar precision )

Returns true if this matrix is almost the same as another one


Mat.appendDesc? ( io String string )

Append a String description of this matrix and its element values to the io String string


Mat Mat.clone? ()

clone method


Integer Mat.cols? ()


Boolean Mat.equal? ( in Mat that )

Returns true if this matrix is the same as another one


Scalar Mat.get? ( in Integer row, in Integer col )

Return the element value at row and col


UInt32 Mat.hash? ()

Hash for this matrix


Mat Mat.linearInterpolate? ( in Mat that, in Scalar t )

Linearly interpolates this matrix with another one based on a scalar blend value (0.0 to 1.0)


Mat.resize! ( in Integer rows, in Integer cols )

Resize the matrix to rows and cols dimensions


Integer Mat.rows? ()


Mat.set! ( in Integer row, in Integer col, in Scalar val )

Set the element value at row and col


Mat.setAll! ( in Scalar val )

Set all the matrix element values to val


Mat.setDiagonal! ( in Integer size, in Scalar val )

setting the diagonal components of this matrix to a scalar


Mat.setDiagonal! ( in Vec vec )

Set to a diagonal matrix given the diagonal elements


Mat.setIdentity! ( in Integer size )

Set the matrix to an identity matrix of size rows and cols


Mat.setNull! ()

Set the values of all matrix elements to zero


String Mat.sizeDesc? ()

Return a String description of this matrix and its dimensions


Mat Mat.sub? ( in Integer rs, in Integer re, in Integer cs, in Integer ce )


Mat Mat.topLeft? ( in Integer rows, in Integer cols )


Scalar Mat.trace? ()

Compute the trace of the matrix. The matrix must be square.


Mat Mat.transpose? ()

Operators in detail

unary -


Mat = ( Param other )

Add another matrix in place