ASL  0.1.7
Advanced Simulation Library
Public Member Functions | Related Functions | List of all members
asl::AMatr< T > Class Template Reference

#include <aslMatrices.h>

Inheritance diagram for asl::AMatr< T >:
Inheritance graph
[legend]

Public Member Functions

 AMatr ()
 
 AMatr (unsigned int nR, unsigned int nC)
 
 AMatr (const AMatr< T > &a)
 
 AMatr (unsigned int nR, unsigned int nC, AVec< T > v)
 
template<typename T1 >
 AMatr (const AMatr< T1 > &a)
 
const AMatr< T > & operator= (const AMatr &a)
 
T & operator() (int i, int j)
 doesn't chek boundaries More...
 
const T & operator() (int i, int j) const
 doesn't chek boundaries More...
 
T & operator[] (int i)
 doesn't chek boundaries More...
 
const T & operator[] (int i) const
 doesn't chek boundaries More...
 
unsigned int getNRow () const
 
unsigned int getNCol () const
 
void resize (unsigned int nR, unsigned int nCol)
 
const AVec< T > & getInternalVec () const
 
AVec< T > & getInternalVec ()
 
void setRow (unsigned int r, const AVec< T > &a)
 
void setColumn (unsigned int c, const AVec< T > &a)
 

Related Functions

(Note that these are not member functions.)

template<typename T >
std::ostream & operator<< (std::ostream &f, const AMatr< T > &a)
 
template<typename T >
const AMatr< T > & operator+= (AMatr< T > &a, const AMatr< T > &b)
 
template<typename T >
const AMatr< T > operator+ (const AMatr< T > &a, const AMatr< T > &b)
 
template<typename T >
const AMatr< T > operator- (const AMatr< T > &a, const AMatr< T > &b)
 
template<typename T >
const AMatr< T > operator* (const AMatr< T > &a, const AMatr< T > &b)
 
template<typename T >
const AVec< T > operator* (const AMatr< T > &a, const AVec< T > &b)
 
template<typename T >
const AVec< T > operator* (const AVec< T > &a, const AMatr< T > &b)
 
template<typename T >
const AMatr< T > operator* (const AMatr< T > &a, const T &b)
 
template<typename T >
const AMatr< T > operator* (const T &a, const AMatr< T > &b)
 
template<typename T >
const T trace (const AMatr< T > &a)
 Trace of a matrix \(Tr(A)\equiv A_{ii}\). More...
 
template<typename T >
const T trace (const AMatr< T > &a, const AMatr< T > &b)
 Trace of a matrix product \(Tr(A B)\equiv A_{ij}B_{ji}\). More...
 
template<typename T >
const AMatr< T > operator/ (const AMatr< T > &b, const T &a)
 
template<typename T >
AMatr< T > elementProduct (const AVec< T > &a, const AVec< T > &b)
 element product of two vectors More...
 
template<typename T >
AMatr< T > makeAMatr (const AVec< T > &a)
 generates a matrix with a row More...
 
template<typename T >
AMatr< T > makeAMatr (const AVec< T > &a, const AVec< T > &b)
 generates a matrix with two rows More...
 
template<typename T >
AMatr< T > makeAMatr (const AVec< T > &a, const AVec< T > &b, const AVec< T > &c)
 generates a matrix with three rows More...
 
template<typename T >
AMatr< T > makeAMatr (AVec< T > *a, unsigned int n)
 generates a matrix with n rows More...
 
template<typename T = int>
AMatr< T > makeAMatrUnit (unsigned int n)
 
template<typename T >
AVec< T > getDiagonal (const AMatr< T > &a)
 returns AVec containing the diagonal elements More...
 
template<typename T >
AVec< T > getOffDiagonalUp (const AMatr< T > &a)
 returns AVec<T> containing the uper off diagonal elements More...
 
template<typename T >
det (const AMatr< T > &m)
 computes determinant expression fo cases 2x2 and 3x3 only More...
 
template<typename T >
AMatr< T > replaceRow (const AMatr< T > &a, const AVec< T > &b, unsigned int r)
 generate matrix with content of the matrix a but with replaced row r by vector b More...
 
template<typename T >
AMatr< T > replaceColumn (const AMatr< T > &a, const AVec< T > &b, unsigned int c)
 generate matrix with content of the matrix a but with replaced column c by vector b More...
 
template<typename T >
AMatr< T > inverseMatrix (const AMatr< T > &a)
 returns inverse matrix for cases 2x2 and 3x3 More...
 

Detailed Description

template<typename T = double>
class asl::AMatr< T >

class algebraic matrix. The class is an implementation of a dynamic matrix with defined algebraic operations

Definition at line 38 of file aslMatrices.h.

Constructor & Destructor Documentation

◆ AMatr() [1/5]

template<typename T >
asl::AMatr< T >::AMatr ( )
inline

Definition at line 191 of file aslMatrices.h.

◆ AMatr() [2/5]

template<typename T >
asl::AMatr< T >::AMatr ( unsigned int  nR,
unsigned int  nC 
)
inline

Definition at line 197 of file aslMatrices.h.

◆ AMatr() [3/5]

template<typename T>
asl::AMatr< T >::AMatr ( const AMatr< T > &  a)
inline

Definition at line 203 of file aslMatrices.h.

◆ AMatr() [4/5]

template<typename T>
asl::AMatr< T >::AMatr ( unsigned int  nR,
unsigned int  nC,
AVec< T >  v 
)
inline

Definition at line 209 of file aslMatrices.h.

◆ AMatr() [5/5]

template<typename T = double>
template<typename T1 >
asl::AMatr< T >::AMatr ( const AMatr< T1 > &  a)

Member Function Documentation

◆ getInternalVec() [1/2]

template<typename T >
const AVec< T > & asl::AMatr< T >::getInternalVec ( ) const
inline

Definition at line 221 of file aslMatrices.h.

◆ getInternalVec() [2/2]

template<typename T >
AVec< T > & asl::AMatr< T >::getInternalVec ( )
inline

Definition at line 216 of file aslMatrices.h.

◆ getNCol()

template<typename T >
unsigned int asl::AMatr< T >::getNCol ( ) const
inline

Definition at line 231 of file aslMatrices.h.

◆ getNRow()

template<typename T >
unsigned int asl::AMatr< T >::getNRow ( ) const
inline

Definition at line 226 of file aslMatrices.h.

◆ operator()() [1/2]

template<typename T = double>
T& asl::AMatr< T >::operator() ( int  i,
int  j 
)
inline

doesn't chek boundaries

Definition at line 52 of file aslMatrices.h.

◆ operator()() [2/2]

template<typename T = double>
const T& asl::AMatr< T >::operator() ( int  i,
int  j 
) const
inline

doesn't chek boundaries

Definition at line 54 of file aslMatrices.h.

◆ operator=()

template<typename T = double>
const AMatr<T>& asl::AMatr< T >::operator= ( const AMatr< T > &  a)

◆ operator[]() [1/2]

template<typename T = double>
T& asl::AMatr< T >::operator[] ( int  i)
inline

doesn't chek boundaries

Definition at line 56 of file aslMatrices.h.

◆ operator[]() [2/2]

template<typename T = double>
const T& asl::AMatr< T >::operator[] ( int  i) const
inline

doesn't chek boundaries

Definition at line 58 of file aslMatrices.h.

◆ resize()

template<typename T >
void asl::AMatr< T >::resize ( unsigned int  nR,
unsigned int  nCol 
)
inline

Definition at line 237 of file aslMatrices.h.

◆ setColumn()

template<typename T = double>
void asl::AMatr< T >::setColumn ( unsigned int  c,
const AVec< T > &  a 
)

◆ setRow()

template<typename T = double>
void asl::AMatr< T >::setRow ( unsigned int  r,
const AVec< T > &  a 
)

Friends And Related Function Documentation

◆ det()

template<typename T >
T det ( const AMatr< T > &  m)
related

computes determinant expression fo cases 2x2 and 3x3 only

◆ elementProduct()

template<typename T >
AMatr< T > elementProduct ( const AVec< T > &  a,
const AVec< T > &  b 
)
related

element product of two vectors

\( elementProduct\left( \left[\begin{array}{c} a_1\\ \vdots \\ a_n \end{array}\right], \left[\begin{array}{c} b_1\\ \vdots \\ b_n \end{array}\right] = \left[\begin{array}{ccc} a_1b_1 & \cdots & a_1b_n\\ \vdots & \ddots & \vdots\\ a_nb_1 & \cdots & a_nb_n\\ \end{array}\right] \right) \)

◆ getDiagonal()

template<typename T >
AVec< T > getDiagonal ( const AMatr< T > &  a)
related

returns AVec containing the diagonal elements

the finction is valid only for square matrices

◆ getOffDiagonalUp()

template<typename T >
AVec< T > getOffDiagonalUp ( const AMatr< T > &  a)
related

returns AVec<T> containing the uper off diagonal elements

the function is valid only for square matrices

Todo:
implement

◆ inverseMatrix()

template<typename T >
AMatr< T > inverseMatrix ( const AMatr< T > &  a)
related

returns inverse matrix for cases 2x2 and 3x3

<T>

◆ makeAMatr() [1/4]

template<typename T >
AMatr< T > makeAMatr ( const AVec< T > &  a)
related

generates a matrix with a row

◆ makeAMatr() [2/4]

template<typename T >
AMatr< T > makeAMatr ( const AVec< T > &  a,
const AVec< T > &  b 
)
related

generates a matrix with two rows

◆ makeAMatr() [3/4]

template<typename T >
AMatr< T > makeAMatr ( const AVec< T > &  a,
const AVec< T > &  b,
const AVec< T > &  c 
)
related

generates a matrix with three rows

◆ makeAMatr() [4/4]

template<typename T >
AMatr< T > makeAMatr ( AVec< T > *  a,
unsigned int  n 
)
related

generates a matrix with n rows

◆ makeAMatrUnit()

template<typename T = int>
AMatr< T > makeAMatrUnit ( unsigned int  n)
related

◆ operator*() [1/5]

template<typename T >
const AMatr< T > operator* ( const AMatr< T > &  a,
const AMatr< T > &  b 
)
related

◆ operator*() [2/5]

template<typename T >
const AVec< T > operator* ( const AMatr< T > &  a,
const AVec< T > &  b 
)
related

◆ operator*() [3/5]

template<typename T >
const AVec< T > operator* ( const AVec< T > &  a,
const AMatr< T > &  b 
)
related

◆ operator*() [4/5]

template<typename T >
const AMatr< T > operator* ( const AMatr< T > &  a,
const T &  b 
)
related

◆ operator*() [5/5]

template<typename T >
const AMatr< T > operator* ( const T &  a,
const AMatr< T > &  b 
)
related

◆ operator+()

template<typename T >
const AMatr< T > operator+ ( const AMatr< T > &  a,
const AMatr< T > &  b 
)
related

Definition at line 252 of file aslMatrices.h.

◆ operator+=()

template<typename T >
const AMatr< T > & operator+= ( AMatr< T > &  a,
const AMatr< T > &  b 
)
related

Definition at line 245 of file aslMatrices.h.

◆ operator-()

template<typename T >
const AMatr< T > operator- ( const AMatr< T > &  a,
const AMatr< T > &  b 
)
related

Definition at line 258 of file aslMatrices.h.

◆ operator/()

template<typename T >
const AMatr< T > operator/ ( const AMatr< T > &  b,
const T &  a 
)
related

Definition at line 264 of file aslMatrices.h.

◆ operator<<()

template<typename T >
std::ostream & operator<< ( std::ostream &  f,
const AMatr< T > &  a 
)
related

◆ replaceColumn()

template<typename T >
AMatr< T > replaceColumn ( const AMatr< T > &  a,
const AVec< T > &  b,
unsigned int  c 
)
related

generate matrix with content of the matrix a but with replaced column c by vector b

<T>

◆ replaceRow()

template<typename T >
AMatr< T > replaceRow ( const AMatr< T > &  a,
const AVec< T > &  b,
unsigned int  r 
)
related

generate matrix with content of the matrix a but with replaced row r by vector b

<T>

◆ trace() [1/2]

template<typename T >
const T trace ( const AMatr< T > &  a)
related

Trace of a matrix \(Tr(A)\equiv A_{ii}\).

◆ trace() [2/2]

template<typename T >
const T trace ( const AMatr< T > &  a,
const AMatr< T > &  b 
)
related

Trace of a matrix product \(Tr(A B)\equiv A_{ij}B_{ji}\).


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