#include <matrix.h>
Public Member Functions | |
CMatrix (int columns=0, int rows=0, T e=0) | |
~CMatrix () | |
CMatrix (const char *fileName) | |
CMatrix (const CMatrix &v) | |
CMatrix (const CVector< T > &v) | |
Constructs diagonal matrix with vector v as the diagonal. | |
CMatrix & | operator= (const CMatrix &v) |
CMatrix | operator* (const CMatrix &v) const |
Composition of matrices. | |
CMatrix | operator* (T a) const |
Multiplication with scalar. | |
CVector< T > | operator() (const CVector< T > &v) const |
Computing value on the vector v. | |
CMatrix | operator+ (const CMatrix &v) const |
CMatrix | operator- (const CMatrix &v) const |
int | getColumn (int a, CVector< T > &v) const |
int | getRow (int a, CVector< T > &v) const |
int | putColumn (int a, const CVector< T > &v) |
int | putRow (int a, const CVector< T > &v) |
T & | operator() (int i, int j) |
Returns a reference to given element. | |
T | el (int i, int j) const |
Returns a value of given element. | |
CMatrix< T > | operator^ (int n) const |
Power operator. | |
T | norm1 () const |
Norm maximum. | |
T | norm2 () const |
Euclidean norm. | |
T | normInf () const |
Norm one. | |
void | round (T epsilon) |
Rounding elements. | |
int | columnsNumber () const |
int | rowsNumber () const |
int | write (const char *name, int precision) const |
bool | isSymmetric () const |
bool | isSquare () const |
CMatrix | transpose () const |
Private Member Functions | |
void | swapColumns (int a, int b) |
void | swapRows (int a, int b) |
void | multiplyCol (int a, T e) |
void | multiplyRow (int a, T e) |
void | substractMultiplyCol (int a, int b, T e) |
void | substractMultiplyRow (int a, int b, T e) |
Private Attributes | |
T ** | elements |
int | columns |
int | rows |
Constructs diagonal matrix with vector v as the diagonal.
void CMatrix< T >::swapColumns | ( | int | a, | |
int | b | |||
) | [inline, private] |
void CMatrix< T >::swapRows | ( | int | a, | |
int | b | |||
) | [inline, private] |
void CMatrix< T >::multiplyCol | ( | int | a, | |
T | e | |||
) | [private] |
void CMatrix< T >::multiplyRow | ( | int | a, | |
T | e | |||
) | [private] |
void CMatrix< T >::substractMultiplyCol | ( | int | a, | |
int | b, | |||
T | e | |||
) | [inline, private] |
void CMatrix< T >::substractMultiplyRow | ( | int | a, | |
int | b, | |||
T | e | |||
) | [inline, private] |
Composition of matrices.
Multiplication with scalar.
Computing value on the vector v.
T& CMatrix< T >::operator() | ( | int | i, | |
int | j | |||
) | [inline] |
Returns a reference to given element.
Allows to change the element in the matrix. No indices checking implemented.
T CMatrix< T >::el | ( | int | i, | |
int | j | |||
) | const [inline] |
Returns a value of given element.
Does not change the element of the matrix. No indices checking implemented.
Power operator.
Implemented only for (-1) power. Dimension 2 treated separately.
T CMatrix< T >::norm1 | ( | ) | const [inline] |
Norm maximum.
Returns the maximal sum of absolute values among rows of the matrix.
T CMatrix< T >::norm2 | ( | ) | const [inline] |
Euclidean norm.
Returns square root of sum of squares of all matrix elements.
T CMatrix< T >::normInf | ( | ) | const [inline] |
Norm one.
Returns the maximal sum of absolute values among columnof the matrix.
void CMatrix< T >::round | ( | T | epsilon | ) | [inline] |
Rounding elements.
Any matrix element which absolute value is less than epsilon is changed to 0.
int CMatrix< T >::columnsNumber | ( | ) | const [inline] |
int CMatrix< T >::rowsNumber | ( | ) | const [inline] |
int CMatrix< T >::write | ( | const char * | name, | |
int | precision | |||
) | const [inline] |
bool CMatrix< T >::isSymmetric | ( | ) | const [inline] |
bool CMatrix< T >::isSquare | ( | ) | const [inline] |