CARMA C++
carma::services::Matrix< type > Class Template Reference

This class handles standard mathematical matrix operations. More...

#include <carma/services/Matrix.h>

Public Member Functions

Matrix< type > adj ()
 
Matrix< type > adjoint ()
 Define an adjoint operator. More...
 
type cofactor (unsigned iRow, unsigned iCol)
 Return the cofactor of an element. More...
 
type det ()
 Determinant of a matrix. More...
 
type det (unsigned i, unsigned j)
 Determinant of a matrix formed by deleting row i and column j. More...
 
type determinant ()
 Get the determinant of a matrix. More...
 
type determinant (unsigned i, unsigned j)
 Determinant of a matrix formed by deleting row i and column j. More...
 
Matrix< type > inv ()
 
Matrix< type > inverse ()
 Define an inverse operator. More...
 
 Matrix ()
 Constructor. More...
 
 Matrix (const Matrix< type > &mat)
 Copy constructor. More...
 
 Matrix (unsigned nRow, unsigned nCol)
 Constructor. More...
 
Matrix< type > operator* (Matrix< type > &mat)
 Define a matrix multiplication operator. More...
 
template<class T >
Matrix< type > operator* (T)
 Define matrix multiplication operators. More...
 
Vector< type > operator* (Vector< type > &vec)
 Define a vector right-multiplication operator. More...
 
template<class T >
Matrix< type > operator+ (T)
 Define a matrix addition operator. More...
 
template<class T >
Matrix< type > operator- (T)
 Define a matrix subtraction operator. More...
 
template<class T >
Matrix< type > operator/ (T)
 Define a matrix division operator. More...
 
void operator= (const Matrix< type > &mat)
 Assignment operator. More...
 
Vector< type > & operator[] (unsigned iRow)
 Define an operator for accessing rows of the matrix. More...
 
Matrix< type > reduce (unsigned iRow, unsigned iCol)
 Define a reduction operator. More...
 
type trace ()
 Get the trace of a matrix (sum of the diagonals) More...
 
Matrix< type > trans ()
 
Matrix< type > transpose ()
 Define a transpose operator. More...
 
virtual ~Matrix ()
 Destructor. More...
 

Friends

Vector< type > carma::services::operator* (Vector< type > &vec, Matrix< type > &mat)
 A left-multiplication operator. More...
 
std::ostream & carma::services::operator<< (std::ostream &os, Matrix< type > &mat)
 Declare a matrix printing method. More...
 
std::ostringstream & carma::services::operator<< (std::ostringstream &os, Matrix< type > &mat)
 Declare a matrix printing method. More...
 

Detailed Description

template<class type>
class carma::services::Matrix< type >

This class handles standard mathematical matrix operations.

See Also
carma::services::Vector

Definition at line 26 of file Matrix.h.

Constructor & Destructor Documentation

template<class type >
carma::services::Matrix< type >::Matrix ( )

Constructor.

Definition at line 212 of file Matrix.h.

template<class type >
carma::services::Matrix< type >::Matrix ( const Matrix< type > &  mat)

Copy constructor.

Definition at line 222 of file Matrix.h.

template<class type >
carma::services::Matrix< type >::Matrix ( unsigned  nRow,
unsigned  nCol 
)

Constructor.

Definition at line 257 of file Matrix.h.

template<class type >
carma::services::Matrix< type >::~Matrix ( )
virtual

Destructor.

Definition at line 272 of file Matrix.h.

Member Function Documentation

template<class type >
Matrix< type > carma::services::Matrix< type >::adjoint ( )

Define an adjoint operator.

Adjoint of a matrix.

Definition at line 576 of file Matrix.h.

template<class type >
type carma::services::Matrix< type >::cofactor ( unsigned  iRow,
unsigned  iCol 
)

Return the cofactor of an element.

Cofactor of a matrix element.

Definition at line 644 of file Matrix.h.

template<class type >
type carma::services::Matrix< type >::det ( )

Determinant of a matrix.

Definition at line 699 of file Matrix.h.

template<class type >
type carma::services::Matrix< type >::det ( unsigned  i,
unsigned  j 
)

Determinant of a matrix formed by deleting row i and column j.

Definition at line 731 of file Matrix.h.

template<class type >
type carma::services::Matrix< type >::determinant ( )

Get the determinant of a matrix.

Determinant of a matrix.

Definition at line 667 of file Matrix.h.

template<class type >
type carma::services::Matrix< type >::determinant ( unsigned  i,
unsigned  j 
)

Determinant of a matrix formed by deleting row i and column j.

Definition at line 708 of file Matrix.h.

template<class type >
Matrix< type > carma::services::Matrix< type >::inverse ( )

Define an inverse operator.

Inverse of a matrix.

Definition at line 600 of file Matrix.h.

template<class type >
Matrix< type > carma::services::Matrix< type >::operator* ( Matrix< type > &  mat)

Define a matrix multiplication operator.

Define multiplication operators.

Definition at line 297 of file Matrix.h.

template<class type >
template<class T >
Matrix< type > carma::services::Matrix< type >::operator* ( fac)

Define matrix multiplication operators.

Definition at line 392 of file Matrix.h.

template<class type >
Vector< type > carma::services::Matrix< type >::operator* ( Vector< type > &  vec)

Define a vector right-multiplication operator.

Definition at line 353 of file Matrix.h.

template<class type >
template<class T >
Matrix< type > carma::services::Matrix< type >::operator+ ( fac)

Define a matrix addition operator.

Definition at line 418 of file Matrix.h.

template<class type >
template<class T >
Matrix< type > carma::services::Matrix< type >::operator- ( fac)

Define a matrix subtraction operator.

Definition at line 431 of file Matrix.h.

template<class type >
template<class T >
Matrix< type > carma::services::Matrix< type >::operator/ ( fac)

Define a matrix division operator.

Definition at line 405 of file Matrix.h.

template<class type >
void carma::services::Matrix< type >::operator= ( const Matrix< type > &  mat)

Assignment operator.

Definition at line 237 of file Matrix.h.

template<class type >
Vector< type > & carma::services::Matrix< type >::operator[] ( unsigned  iRow)

Define an operator for accessing rows of the matrix.

Index operator.

Definition at line 278 of file Matrix.h.

template<class type >
Matrix< type > carma::services::Matrix< type >::reduce ( unsigned  iRow,
unsigned  iCol 
)

Define a reduction operator.

Return the reduced matrix of the specified element.

Definition at line 740 of file Matrix.h.

template<class type >
type carma::services::Matrix< type >::trace ( )

Get the trace of a matrix (sum of the diagonals)

Trace of a matrix.

Definition at line 624 of file Matrix.h.

template<class type >
Matrix< type > carma::services::Matrix< type >::transpose ( )

Define a transpose operator.

Transpose of a matrix.

Definition at line 555 of file Matrix.h.

Friends And Related Function Documentation

template<class type>
Vector<type> carma::services::operator* ( Vector< type > &  vec,
Matrix< type > &  mat 
)
friend

A left-multiplication operator.

template<class type>
std::ostream& carma::services::operator<< ( std::ostream &  os,
Matrix< type > &  mat 
)
friend

Declare a matrix printing method.

template<class type>
std::ostringstream& carma::services::operator<< ( std::ostringstream &  os,
Matrix< type > &  mat 
)
friend

Declare a matrix printing method.


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