FEMSuite
Public Member Functions | List of all members
Matrix< T, Dimensions > Class Template Reference

This class models a matrix More...

#include <Matrix.h>

Public Member Functions

Matrix< T > CalculateTransponse () const
 
Returns
Transposed version of this matrix

 
bool IsInvertible () const
 Determines if this matrix is invertible More...
 
Matrix< T > CalculateInverse () const
 
Returns
Inverted version of this matrix

 
Matrix< T > CalculateIdentity (const Complex &multiplicand=1) const
 Calculates the identity matrix corresponding to this matrix. More...
 
Matrix< std::string > CalculateIdentity (const std::string &multiplicand="") const
 Calculates the identity matrix, in symbolic form, corresponding to the dimensions of this matrix. More...
 
Matrix< T > ToPower (const int power) const
 
MatrixColumn< T > GetColumn (const int columnIndex) const
 Retrieves a column of a given index More...
 
void InsertColumn (const int columnIndex, const MatrixColumn< T > &column)
 Inserts a column at a given index More...
 
void DeleteColumn (const int columnIndex)
 Deletes an entire column More...
 
MatrixRow< T > GetRow (const int rowIndex) const
 Retrieves a row of a given index More...
 
void InsertRow (const int rowIndex, const MatrixRow< T > &row)
 Inserts a row at a given index More...
 
void DeleteRow (const int rowIndex)
 Deletes an entire row More...
 
void MultiplyRow (const int rowIndex, const T factor)
 Multiplies a row by a given factor More...
 
GetCell (const size_t column, const size_t row) const
 Retrieves a particular cell More...
 
size_t GetWidth () const
 
Returns
Width of matrix

 
size_t GetHeight () const
 
Returns
Height of matrix

 
std::array< size_t, Dimensions > GetDimensionSize (const size_t dimension) const
 
std::pair< std::vector< T >, std::vector< MatrixRow< T > > > CalculateEigens () const
 Calculates both eigenvalues and eigenvectors. More...
 
std::vector< T > CalculateEigenValues () const
 
T & operator() (const size_t column, const size_t row)
 
operator() (const size_t column, const size_t row) const
 
 Matrix (const size_t columns, const size_t rows)
 This initializes a matrix with N=2 dimensions More...
 
 Matrix (const std::vector< size_t > sizes)
 This initializes a matrix with N>2 dimensions More...
 

Detailed Description

template<typename T = Complex, size_t Dimensions = 2>
class Matrix< T, Dimensions >

This class models a matrix

Constructor & Destructor Documentation

template<typename T = Complex, size_t Dimensions = 2>
Matrix< T, Dimensions >::Matrix ( const size_t  columns,
const size_t  rows 
)
inline

This initializes a matrix with N=2 dimensions

template<typename T = Complex, size_t Dimensions = 2>
Matrix< T, Dimensions >::Matrix ( const std::vector< size_t >  sizes)
inline

This initializes a matrix with N>2 dimensions

Member Function Documentation

template<typename T = Complex, size_t Dimensions = 2>
std::pair< std::vector<T>, std::vector< MatrixRow<T> > > Matrix< T, Dimensions >::CalculateEigens ( ) const

Calculates both eigenvalues and eigenvectors.

Returns
A pair of std::vector, corresponding to the eigenvalues, and a vector of MatrixRow, corresponding to the eigenvectors.
template<typename T = Complex, size_t Dimensions = 2>
Matrix<T> Matrix< T, Dimensions >::CalculateIdentity ( const Complex multiplicand = 1) const

Calculates the identity matrix corresponding to this matrix.

Parameters
Multiplicandoptional value to multiply the identity matrix by.
template<typename T = Complex, size_t Dimensions = 2>
Matrix<std::string> Matrix< T, Dimensions >::CalculateIdentity ( const std::string &  multiplicand = "") const

Calculates the identity matrix, in symbolic form, corresponding to the dimensions of this matrix.

Parameters
Multiplicandoptional symbolic value to multiply the identity matrix by.
template<typename T = Complex, size_t Dimensions = 2>
void Matrix< T, Dimensions >::DeleteColumn ( const int  columnIndex)

Deletes an entire column

template<typename T = Complex, size_t Dimensions = 2>
void Matrix< T, Dimensions >::DeleteRow ( const int  rowIndex)

Deletes an entire row

template<typename T = Complex, size_t Dimensions = 2>
T Matrix< T, Dimensions >::GetCell ( const size_t  column,
const size_t  row 
) const

Retrieves a particular cell

<param name"column index">Column index of required cell

<param name"row index">Row index of required cell

template<typename T = Complex, size_t Dimensions = 2>
MatrixColumn<T> Matrix< T, Dimensions >::GetColumn ( const int  columnIndex) const

Retrieves a column of a given index

Parameters
columnIndexColumn index
template<typename T = Complex, size_t Dimensions = 2>
std::array<size_t, Dimensions> Matrix< T, Dimensions >::GetDimensionSize ( const size_t  dimension) const
inline
Returns
Size of a specific dimension
Parameters
dimensionDimension to access
template<typename T = Complex, size_t Dimensions = 2>
MatrixRow<T> Matrix< T, Dimensions >::GetRow ( const int  rowIndex) const

Retrieves a row of a given index

Parameters
columnIndexrow index
template<typename T = Complex, size_t Dimensions = 2>
void Matrix< T, Dimensions >::InsertColumn ( const int  columnIndex,
const MatrixColumn< T > &  column 
)

Inserts a column at a given index

template<typename T = Complex, size_t Dimensions = 2>
void Matrix< T, Dimensions >::InsertRow ( const int  rowIndex,
const MatrixRow< T > &  row 
)

Inserts a row at a given index

template<typename T = Complex, size_t Dimensions = 2>
bool Matrix< T, Dimensions >::IsInvertible ( ) const

Determines if this matrix is invertible

template<typename T = Complex, size_t Dimensions = 2>
void Matrix< T, Dimensions >::MultiplyRow ( const int  rowIndex,
const T  factor 
)

Multiplies a row by a given factor

template<typename T = Complex, size_t Dimensions = 2>
Matrix<T> Matrix< T, Dimensions >::ToPower ( const int  power) const
Returns
This matrix taken to given power
Parameters
powerPower to take this matrix to

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