Documentation 6b54b78464
Loading...
Searching...
No Matches
CSquareMatrixCM Class Reference

Class to store a dense general square matrix that uses the Column Major order storage format. The code should be compiled with LAPACK to use optimized matrix inversion and multiplication routines. More...

#include <CSquareMatrixCM.hpp>

Public Member Functions

 CSquareMatrixCM ()=default
 Default constructor. Nothing to be done.
 
 CSquareMatrixCM (int N)
 Overloaded constructor, which allocates the memory to store the matrix.
 
passivedouble & operator() (int i, int j)
 Operator, which makes available the given matrix element as a reference.
 
const passivedouble & operator() (int i, int j) const
 Operator, which makes available the given matrix element as a const reference.
 
ColMajorMatrix< passivedouble > & GetMat ()
 Function, which makes available a reference to the actual matrix.
 
const ColMajorMatrix< passivedouble > & GetMat () const
 Function, which makes available a const reference to the actual matrix.
 
void Initialize (int N)
 Function, which allocates the memory for the matrix.
 
int Size () const
 Function, which makes available the size of the matrix.
 
void MatMatMult (const char side, const ColMajorMatrix< passivedouble > &mat_in, ColMajorMatrix< passivedouble > &mat_out) const
 Function, which carries out the matrix produc of the current matrix with mat_in and stores the result in mat_out.
 
template<class ForwardIt >
void MatVecMult (ForwardIt vec_in, ForwardIt vec_out) const
 Naive matrix-vector multiplication with general type.
 
void Invert ()
 Function, which inverts the matrix in-place.
 
void Transpose ()
 Function, which transposes the matrix in-place.
 

Detailed Description

Class to store a dense general square matrix that uses the Column Major order storage format. The code should be compiled with LAPACK to use optimized matrix inversion and multiplication routines.

Constructor & Destructor Documentation

◆ CSquareMatrixCM() [1/2]

CSquareMatrixCM::CSquareMatrixCM ( )
default

Default constructor. Nothing to be done.

◆ CSquareMatrixCM() [2/2]

CSquareMatrixCM::CSquareMatrixCM ( int  N)
inline

Overloaded constructor, which allocates the memory to store the matrix.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]N- Number of rows and colums of the matrix.

Member Function Documentation

◆ GetMat() [1/2]

ColMajorMatrix< passivedouble > & CSquareMatrixCM::GetMat ( )
inline

Function, which makes available a reference to the actual matrix.

Returns
A reference to mat.

◆ GetMat() [2/2]

const ColMajorMatrix< passivedouble > & CSquareMatrixCM::GetMat ( ) const
inline

Function, which makes available a const reference to the actual matrix.

Returns
A const reference to mat.

◆ Initialize()

void CSquareMatrixCM::Initialize ( int  N)
inline

Function, which allocates the memory for the matrix.

Parameters
[in]N- Number of rows and colums of the matrix.

◆ Invert()

void CSquareMatrixCM::Invert ( )

Function, which inverts the matrix in-place.

◆ MatMatMult()

void CSquareMatrixCM::MatMatMult ( const char  side,
const ColMajorMatrix< passivedouble > &  mat_in,
ColMajorMatrix< passivedouble > &  mat_out 
) const

Function, which carries out the matrix produc of the current matrix with mat_in and stores the result in mat_out.

Parameters
[in]side- left: mat_out = this * mat_in, right: mat_out = mat_in * this
[in]mat_in- Matrix to be multiplied by the current matrix.
[out]mat_out- Matrix to store the result of the multiplication.

◆ MatVecMult()

template<class ForwardIt >
void CSquareMatrixCM::MatVecMult ( ForwardIt  vec_in,
ForwardIt  vec_out 
) const
inline

Naive matrix-vector multiplication with general type.

◆ operator()() [1/2]

passivedouble & CSquareMatrixCM::operator() ( int  i,
int  j 
)
inline

Operator, which makes available the given matrix element as a reference.

Parameters
[in]i- Row index of the matrix element.
[in]j- Column index of the matrix element.
Returns
Reference to element (i,j).

◆ operator()() [2/2]

const passivedouble & CSquareMatrixCM::operator() ( int  i,
int  j 
) const
inline

Operator, which makes available the given matrix element as a const reference.

Parameters
[in]i- Row index of the matrix element.
[in]j- Column index of the matrix element.
Returns
Constant reference to element (i,j).

◆ Size()

int CSquareMatrixCM::Size ( ) const
inline

Function, which makes available the size of the matrix.

Returns
The number of rows, columns of the matrix.

◆ Transpose()

void CSquareMatrixCM::Transpose ( )

Function, which transposes the matrix in-place.


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