CSIBCMatrixMNd Class Reference

Class representing matricies with M rows, and N columns. More...

#include <SIBCMatrixMNd.h>

List of all members.

Public Member Functions

  CSIBCMatrixMNd ()
bool  SetDimensions (const int in_M, const int in_N)
bool  Set (const CSIBCMatrixMNd &in_mat)
void  Copy (const CSIBCMatrixMNd &in_mat)
CSIBCMatrixMNd Transpose (const CSIBCMatrixMNd &in_mat)
int  GetNbRow (void) const
int  GetNbCol (void) const
double  Get (const int in_nRow, const int in_nCol) const
void  Set (int in_nRow, int in_nCol, const double in_dVal)
void  SetIdentity (void)
CSIBCMatrixMNd Mul (const CSIBCMatrixMNd &in_mat1, const CSIBCMatrixMNd &in_mat2)
bool  Mul (const CSIBCMatrixMNd &in_mat)
bool  LeftMul (const CSIBCMatrixMNd &in_mat)
bool  GrevilleInverse (const CSIBCMatrixMNd &in_mat)
bool  GrevilleInverse (const CSIBCMatrixMNd &in_mat, const unsigned int in_NbRow, const unsigned int in_NbCol)
CSIBCMatrixMNd Add (const CSIBCMatrixMNd &in_mat1, const CSIBCMatrixMNd &in_mat2)
CSIBCMatrixMNd Sub (const CSIBCMatrixMNd &in_mat1, const CSIBCMatrixMNd &in_mat2)
CSIBCMatrixMNd Add (const CSIBCMatrixMNd &in_mat)
CSIBCMatrixMNd Sub (const CSIBCMatrixMNd &in_mat)


Detailed Description

Class representing matricies with M rows, and N columns.

CSIBCMatrixMNd objects represent matricies of arbitrary size, which are not necessarily square (as with other matrix classes). Because the matricies represented by CSIBCMatrixMNd are of arbitrary size, there are considerably less operations that are available through this class, as compared to other matrix classes.

This class uses double precision floating point numbers to store element values. There exists three other matrix classes, CSIBCMatrix44d, CSIBCMatrix33d and CSIBCMatrixMNd. They are used to represent 4x4 matricies with double precision floating-point numbers, 3x3 matricies with double precision floating-point numbers, and MxN matricies with double precision floating-point numbers, respectively.


Constructor & Destructor Documentation

CSIBCMatrixMNd (  ) 

Default Constructor. Sets this matrix to be a zero row, zero column matrix (null).


Member Function Documentation

bool SetDimensions ( const int  in_M,
const int  in_N  
)

Sets the dimensions of this matrix to in_M rows, and in_N columns. If the dimensions of the matrix are the same as they previously were, nothing is done. Otherwise, the matrix is resized, and all element values are lost.

Parameters:
in_M  The number of rows to resize the matrix to.
in_N  The number of columns to resize the matrix to.
Returns:
bool Always true.
See also:
CSIBCMatrixMNd::Set

CSIBCMatrixMNd::GetNbRow

CSIBCMatrixMNd::GetNbCol

bool Set ( const CSIBCMatrixMNd in_mat  ) 

Sets this matrix to be a duplicate of in_mat.

Parameters:
in_mat  The matrix to copy data from.
Returns:
bool Always true.
See also:
CSIBCMatrixMNd::SetDimensions

CSIBCMatrixMNd::Copy

void Copy ( const CSIBCMatrixMNd in_mat  ) 

Sets this matrix's elements equal to the corresponding elements in in_mat. This function should only be used if this matrix and in_mat have the same dimensions.

Parameters:
in_mat  Matrix to copy element values from.
See also:
CSIBCMatrixMNd::Set

CSIBCMatrixMNd& Transpose ( const CSIBCMatrixMNd in_mat  ) 

Sets this matrix to be the transpose of in_mat.

Parameters:
in_mat  Matrix containing the desired matrix to transpose.
Returns:
CSIBCMatrixMNd& Reference to this matrix.

int GetNbRow ( void   )  const

Returns the number of rows in this matrix.

Returns:
int The number of rows in this matrix.
See also:
CSIBCMatrixMNd::GetNbCol

CSIBCMatrixMNd::SetDimensions

int GetNbCol ( void   )  const

Returns the number of columns in this matrix.

Returns:
int The number of columns in this matrix.
See also:
CSIBCMatrixMNd::GetNbRow

CSIBCMatrixMNd::SetDimensions

double Get ( const int  in_nRow,
const int  in_nCol  
) const

Returns the element value at row in_nRow, column in_nCol.

Parameters:
in_nRow  The index of the row of the element to retrieve (zero-indexed).
in_nCol  The index of the column of the element to retrieve (zero-indexed).
Returns:
double The value of the element at row in_nRow, column in_nCol.
See also:
CSIBCMatrixMNd::Set

void Set ( int  in_nRow,
int  in_nCol,
const double  in_dVal  
)

Sets the element at row in_nRow, column in_nCol to in_dVal.

Parameters:
in_nRow  The index of the row of the element to set (zero-indexed).
in_nCol  The index of the column of the element to set (zero-indexed).
in_dVal  The value to set.
See also:
CSIBCMatrixMNd::Get

CSIBCMatrixMNd::SetIdentity

void SetIdentity ( void   ) 

Sets this matrix to the identity matrix, if it is a square matrix.

See also:
CSIBCMatrixMNd::Set

CSIBCMatrixMNd& Mul ( const CSIBCMatrixMNd in_mat1,
const CSIBCMatrixMNd in_mat2  
)

Computes the matrix-multiplication of in_mat1 and in_mat2, (in_mat1 * in_mat2) and stores the result in this matrix. It is up to the user to ensure that matrix multiplication can be performed (in_mat1's number of columns is equal to in_mat2's number of rows).

Parameters:
in_mat1  First matrix to multiply (on the left).
in_mat2  Second matrix to multiply (on the right).
Returns:
CSIBCMatrixMNd& Reference to this matrix.
See also:
CSIBCMatrixMNd::Mul

CSIBCMatrixMNd::LeftMul

bool Mul ( const CSIBCMatrixMNd in_mat  ) 

Computes the matrix-multiplication of this matrix and in_mat, (this * in_mat), and stores the result in this matrix. It is up to the user to ensure that matrix multiplication can be performed (this matrix's number of columns is equal to in_mat's number of rows).

Parameters:
in_mat  The matrix to right-multiply this matrix by.
Returns:
bool Always true.
See also:
CSIBCMatrixMNd::Mul

CSIBCMatrixMNd::LeftMul

bool LeftMul ( const CSIBCMatrixMNd in_mat  ) 

Computes the matrix-multiplication of in_mat and this matrix, (in_mat * this), and stores the result in this matrix. It is up to the user to ensure that matrix multiplication can be performed (in_mat's number of columns is equal to this matrix's number of rows).

Parameters:
in_mat  The matrix to left-multiply this matrix by.
Returns:
bool Always true.
See also:
CSIBCMatrixMNd::Mul

bool GrevilleInverse ( const CSIBCMatrixMNd in_mat  ) 

Sets this matrix to the Moore-Penrose pseudo-inverse using Greville's method.

Parameters:
in_mat  Matrix containing the matrix to take the Moore-Penrose pseudo-inverse of.
Returns:
bool Always true.
See also:
CSIBCMatrixMNd::GrevilleInverse

bool GrevilleInverse ( const CSIBCMatrixMNd in_mat,
const unsigned int  in_NbRow,
const unsigned int  in_NbCol  
)

Sets this matrix to the Moore-Penrose pseudo-inverse using Greville's method, using only the first in_NbRow rows, and the first in_NbCol columns of of in_mat.

Parameters:
in_mat  Matrix containing the matrix to take the Moore-Penrose pseudo-inverse of.
in_NbRow  Number of rows to use from the beginning in_mat.
in_NbCol  Number of columns to use from the beginning of in_mat.
Returns:
bool Always true.
See also:
CSIBCMatrixMNd::GrevilleInverse

CSIBCMatrixMNd& Add ( const CSIBCMatrixMNd in_mat1,
const CSIBCMatrixMNd in_mat2  
)

Computes the matrix-addition of in_mat1 and in_mat2. The result is stored in this matrix. Note that this matrix, in_mat1 and in_mat2 should all be of the same dimensions.

Parameters:
in_mat1  The first matrix in the addition.
in_mat2  The second matrix in the addition.
Returns:
CSIBCMatrixMNd& Reference to this matrix.
See also:
CSIBCMatrixMNd::Add

CSIBCMatrixMNd::Sub

CSIBCMatrixMNd& Sub ( const CSIBCMatrixMNd in_mat1,
const CSIBCMatrixMNd in_mat2  
)

Computes the matrix-subtraction of in_mat1 - in_mat2. The result is stored in this matrix. Note that this matrix, in_mat1 and in_mat2 should all be of the same dimensions.

Parameters:
in_mat1  The first matrix in the subtraction.
in_mat2  The second matrix in the subtraction.
Returns:
CSIBCMatrixMNd& Reference to this matrix.
See also:
CSIBCMatrixMNd::Add

CSIBCMatrixMNd::Sub

CSIBCMatrixMNd& Add ( const CSIBCMatrixMNd in_mat  ) 

Computes the matrix-addition of this matrix and in_mat. The result is stored in this matrix. Note that this matrix and in_mat should both be of the same dimensions.

Parameters:
in_mat  The matrix to add to this matrix.
Returns:
CSIBCMatrixMNd& Reference to this matrix.
See also:
CSIBCMatrixMNd::Add

CSIBCMatrixMNd::Sub

CSIBCMatrixMNd& Sub ( const CSIBCMatrixMNd in_mat  ) 

Computes the matrix-subtraction of this matrix - in_mat. The result is stored in this matrix. Note that this matrix and in_mat should both be of the same dimensions.

Parameters:
in_mat  The matrix to subtract from this matrix.
Returns:
CSIBCMatrixMNd& Reference to this matrix.
See also:
CSIBCMatrixMNd::Add

CSIBCMatrixMNd::Sub


The documentation for this class was generated from the following file: