CVM Class Library
8.1
This C++ class library encapsulates concepts of vector and different matrices including square, band, symmetric and hermitian ones in Euclidean space of real and complex numbers.
|
End-user class encapsulating square matrix of complex numbers. More...
#include <cvm.h>
Public Member Functions | |
basic_scmatrix () | |
Default constructor. | |
basic_scmatrix (tint nDim) | |
Constructor. | |
basic_scmatrix (TC *pd, tint nDim) | |
Constructor. | |
basic_scmatrix (const TC *pd, tint nDim) | |
Constructor. | |
basic_scmatrix (const basic_scmatrix &m) | |
Copy constructor. | |
basic_scmatrix (basic_scmatrix &&m) noexcept | |
Move constructor. | |
basic_scmatrix (const BaseCMatrix &m) | |
Constructor. | |
basic_scmatrix (const CVector &v) | |
Constructor. | |
basic_scmatrix (const basic_srmatrix< TR > &m, bool bRealPart=true) | |
Constructor. | |
basic_scmatrix (const TR *pRe, const TR *pIm, tint nDim) | |
Constructor. | |
basic_scmatrix (const basic_srmatrix< TR > &mRe, const basic_srmatrix< TR > &mIm) | |
Constructor. | |
basic_scmatrix (BaseCMatrix &m, tint nRow, tint nCol, tint nDim) | |
Submatrix constructor. | |
type_proxy< TC, TR > | operator() (tint nRow, tint nCol) throw (cvmexception) |
Reference to element (l-value) | |
TC | operator() (tint nRow, tint nCol) const throw (cvmexception) |
Value of element (not l-value) | |
CVector | operator() (tint nCol) throw (cvmexception) |
Column as l-value. | |
const CVector | operator() (tint nCol) const throw (cvmexception) |
Column as not l-value. | |
CVector | operator[] (tint nRow) throw (cvmexception) |
Row as l-value. | |
const CVector | operator[] (tint nRow) const throw (cvmexception) |
Row as not l-value. | |
const basic_srmatrix< TR > | real () const |
Real part (not l-value) | |
const basic_srmatrix< TR > | imag () const |
Imaginary part (not l-value) | |
basic_scmatrix & | operator= (const basic_scmatrix &m) throw (cvmexception) |
Assignment operator. | |
basic_scmatrix & | operator= (basic_scmatrix &&m) throw (cvmexception) |
Move assignment operator. | |
basic_scmatrix & | assign (const CVector &v) throw (cvmexception) |
Vector (as array) assignment. | |
basic_scmatrix & | assign (const TC *pd) |
External array assignment. | |
basic_scmatrix & | assign (tint nRow, tint nCol, const BaseCMatrix &m) throw (cvmexception) |
Assignment to submatrix. | |
basic_scmatrix & | set (TC c) |
Sets all elements to one value. | |
basic_scmatrix & | assign_real (const basic_srmatrix< TR > &mRe) throw (cvmexception) |
Assignment to real parts. | |
basic_scmatrix & | assign_imag (const basic_srmatrix< TR > &mIm) throw (cvmexception) |
Assignment to imaginary parts. | |
basic_scmatrix & | set_real (TR d) |
Sets all real parts to one value. | |
basic_scmatrix & | set_imag (TR d) |
Sets all imaginary parts to one value. | |
basic_scmatrix & | resize (tint nNewDim) throw (cvmexception) |
Changes dimension. | |
basic_scmatrix & | operator<< (const basic_scmatrix &m) throw (cvmexception) |
Matrix replacement. | |
basic_scmatrix | operator+ (const basic_scmatrix &m) const throw (cvmexception) |
Addition operator. | |
basic_scmatrix | operator- (const basic_scmatrix &m) const throw (cvmexception) |
Subtraction operator. | |
basic_scmatrix & | sum (const basic_scmatrix &m1, const basic_scmatrix &m2) throw (cvmexception) |
Sum of matrices. | |
basic_scmatrix & | diff (const basic_scmatrix &m1, const basic_scmatrix &m2) throw (cvmexception) |
Difference of matrices. | |
basic_scmatrix & | operator+= (const basic_scmatrix &m) throw (cvmexception) |
Increment operator. | |
basic_scmatrix & | operator-= (const basic_scmatrix &m) throw (cvmexception) |
Decrement operator. | |
basic_scmatrix | operator- () const |
Unary minus operator. | |
basic_scmatrix & | operator++ () |
Plus identity, prefix. | |
basic_scmatrix | operator++ (int) |
Plus identity, postfix. | |
basic_scmatrix & | operator-- () |
Minus identity, prefix. | |
basic_scmatrix | operator-- (int) |
Minus identity, postfix. | |
basic_scmatrix | operator* (TR dMult) const |
Multiply by real number operator. | |
basic_scmatrix | operator/ (TR dDiv) const throw (cvmexception) |
Divide by real number operator. | |
basic_scmatrix | operator* (TC cMult) const |
Multiply by complex number operator. | |
basic_scmatrix | operator/ (TC cDiv) const throw (cvmexception) |
Divide by complex number operator. | |
basic_scmatrix & | operator*= (TR dMult) |
Multiply by real number and assign. | |
basic_scmatrix & | operator/= (TR dDiv) |
Divide by real number and assign. | |
basic_scmatrix & | operator*= (TC cMult) |
Multiply by complex number and assign. | |
basic_scmatrix & | operator/= (TC cDiv) |
Divide by complex number and assign. | |
basic_scmatrix & | normalize () |
Matrix normalizer. | |
basic_scmatrix | operator! () const throw (cvmexception) |
Matrix transposition. | |
basic_scmatrix | operator~ () const throw (cvmexception) |
Matrix conjugation. | |
basic_scmatrix & | transpose (const basic_scmatrix &m) throw (cvmexception) |
Matrix transposition. | |
basic_scmatrix & | conj (const basic_scmatrix &m) throw (cvmexception) |
Matrix conjugation. | |
basic_scmatrix & | transpose () throw (cvmexception) |
Matrix transposition (in-place) | |
basic_scmatrix & | conj () throw (cvmexception) |
Matrix conjugation (in-place) | |
CVector | operator* (const CVector &v) const throw (cvmexception) |
Matrix-vector product. | |
BaseCMatrix | operator* (const BaseCMatrix &m) const throw (cvmexception) |
Matrix-matrix product. | |
basic_scmatrix | operator* (const basic_scmatrix &m) const throw (cvmexception) |
Matrix-matrix product. | |
basic_scmatrix & | operator*= (const basic_scmatrix &m) throw (cvmexception) |
Matrix-matrix product with assignment. | |
basic_scmatrix & | swap_rows (tint n1, tint n2) throw (cvmexception) |
Rows swap. | |
basic_scmatrix & | swap_cols (tint n1, tint n2) throw (cvmexception) |
Columns swap. | |
CVector | solve (const CVector &vB, TR &dErr) const throw (cvmexception) |
Linear solver. | |
CVector | solve_tran (const CVector &vB, TR &dErr) const throw (cvmexception) |
Linear solver (transposed) | |
CVector | solve_conj (const CVector &vB, TR &dErr) const throw (cvmexception) |
Linear solver (hermitian conjugated) | |
CVector | solve (const CVector &vB) const throw (cvmexception) |
Linear solver. | |
CVector | solve_tran (const CVector &vB) const throw (cvmexception) |
Linear solver (transposed) | |
CVector | solve_conj (const CVector &vB) const throw (cvmexception) |
Linear solver (hermitian conjugated) | |
BaseCMatrix | solve (const BaseCMatrix &mB, TR &dErr) const throw (cvmexception) |
Linear solver. | |
BaseCMatrix | solve_tran (const BaseCMatrix &mB, TR &dErr) const throw (cvmexception) |
Linear solver (transposed) | |
BaseCMatrix | solve_conj (const BaseCMatrix &mB, TR &dErr) const throw (cvmexception) |
Linear solver (hermitian conjugated) | |
BaseCMatrix | solve (const BaseCMatrix &mB) const throw (cvmexception) |
Linear solver. | |
BaseCMatrix | solve_tran (const BaseCMatrix &mB) const throw (cvmexception) |
Linear solver (transposed) | |
BaseCMatrix | solve_conj (const BaseCMatrix &mB) const throw (cvmexception) |
Linear solver (hermitian conjugated) | |
CVector | operator% (const CVector &vB) const throw (cvmexception) |
Linear solver operator (transposed) | |
CVector | operator/ (const CVector &vB) const throw (cvmexception) |
Linear solver operator. | |
CVector | solve_lu (const basic_scmatrix &mLU, const tint *pPivots, const CVector &vB, TR &dErr) const throw (cvmexception) |
LU factorization based linear solver. | |
CVector | solve_lu (const basic_scmatrix &mLU, const tint *pPivots, const CVector &vB) const throw (cvmexception) |
LU factorization based linear solver. | |
BaseCMatrix | solve_lu (const basic_scmatrix &mLU, const tint *pPivots, const BaseCMatrix &mB, TR &dErr) const throw (cvmexception) |
LU factorization based linear solver. | |
BaseCMatrix | solve_lu (const basic_scmatrix &mLU, const tint *pPivots, const BaseCMatrix &mB) const throw (cvmexception) |
LU factorization based linear solver. | |
TC | det () const throw (cvmexception) |
Matrix determinant. | |
basic_scmatrix & | low_up (const basic_scmatrix &m, tint *nPivots) throw (cvmexception) |
Low-up (LU) factorization. | |
basic_scmatrix | low_up (tint *nPivots) const throw (cvmexception) |
Low-up (LU) factorization. | |
TR | cond () const throw (cvmexception) |
Condition number reciprocal. | |
basic_scmatrix & | inv (const basic_scmatrix &m) throw (cvmexception) |
Matrix inversion. | |
basic_scmatrix | inv () const throw (cvmexception) |
Matrix inversion. | |
basic_scmatrix & | exp (const basic_scmatrix &m, TR tol=basic_cvmMachSp< TR >()) throw (cvmexception) |
Matrix exponent. | |
basic_scmatrix | exp (TR tol=basic_cvmMachSp< TR >()) const throw (cvmexception) |
Matrix exponent. | |
basic_scmatrix & | polynom (const basic_scmatrix &m, const CVector &v) throw (cvmexception) |
Matrix polynomial. | |
basic_scmatrix | polynom (const CVector &v) const |
Matrix polynomial. | |
CVector | eig (basic_scmatrix &mEigVect, bool bRightVect=true) const throw (cvmexception) |
Eigenvalues and eigenvectors. | |
CVector | eig () const throw (cvmexception) |
Eigenvalues. | |
basic_scmatrix & | cholesky (const basic_schmatrix< TR, TC > &m) throw (cvmexception) |
Cholesky factorization. | |
basic_scmatrix & | bunch_kaufman (const basic_schmatrix< TR, TC > &m, tint *nPivots) throw (cvmexception) |
Bunch-Kaufman factorization. | |
void | qr (basic_scmatrix< TR, TC > &mQ, basic_scmatrix< TR, TC > &mR) const throw (cvmexception) |
QR factorization. | |
void | lq (basic_scmatrix< TR, TC > &mL, basic_scmatrix< TR, TC > &mQ) const throw (cvmexception) |
LQ factorization. | |
void | ql (basic_scmatrix< TR, TC > &mQ, basic_scmatrix< TR, TC > &mL) const throw (cvmexception) |
QL factorization. | |
void | rq (basic_scmatrix< TR, TC > &mR, basic_scmatrix< TR, TC > &mQ) const throw (cvmexception) |
RQ factorization. | |
basic_scmatrix & | identity () |
Identity matrix. | |
basic_scmatrix & | vanish () |
Set matrix to zero. | |
basic_scmatrix & | randomize_real (TR dFrom, TR dTo) |
Randomizer (real part) | |
basic_scmatrix & | randomize_imag (TR dFrom, TR dTo) |
Randomizer (imaginary part) | |
Public Member Functions inherited from basic_cmatrix< TR, TC > | |
basic_cmatrix () | |
Default constructor. | |
basic_cmatrix (tint nM, tint nN) | |
Constructor. | |
basic_cmatrix (TC *pd, tint nM, tint nN) | |
Constructor. | |
basic_cmatrix (const TC *pd, tint nM, tint nN) | |
Constructor. | |
basic_cmatrix (const basic_cmatrix &m) | |
Copy constructor. | |
basic_cmatrix (basic_cmatrix &&m) noexcept | |
Move constructor. | |
basic_cmatrix (const CVector &v, bool bBeColumn=true) | |
Constructor. | |
basic_cmatrix (const basic_rmatrix< TR > &m, bool bRealPart=true) | |
Constructor. | |
basic_cmatrix (const TR *pRe, const TR *pIm, tint nM, tint nN) | |
Constructor. | |
basic_cmatrix (const basic_rmatrix< TR > &mRe, const basic_rmatrix< TR > &mIm) | |
Constructor. | |
basic_cmatrix (basic_cmatrix &m, tint nRow, tint nCol, tint nHeight, tint nWidth) | |
Submatrix constructor. | |
CVector | diag (tint nDiag) throw (cvmexception) |
Diagonal as l-value. | |
const CVector | diag (tint nDiag) const throw (cvmexception) |
Diagonal (not l-value) | |
basic_cmatrix & | operator= (const basic_cmatrix &m) throw (cvmexception) |
Assignment operator. | |
basic_cmatrix & | operator= (basic_cmatrix &&m) throw (cvmexception) |
Move assignment operator. | |
basic_cmatrix & | assign (tint nRow, tint nCol, const basic_cmatrix &m) throw (cvmexception) |
Assignment to submatrix. | |
basic_cmatrix & | assign_real (const basic_rmatrix< TR > &mRe) throw (cvmexception) |
Assignment to real parts. | |
basic_cmatrix & | assign_imag (const basic_rmatrix< TR > &mIm) throw (cvmexception) |
Assignment to imaginary parts. | |
basic_cmatrix & | resize (tint nNewM, tint nNewN) throw (cvmexception) |
Changes dimensions. | |
bool | operator== (const basic_cmatrix &m) const |
Matrix comparison. | |
bool | operator!= (const basic_cmatrix &m) const |
Matrix comparison. | |
basic_cmatrix & | operator<< (const basic_cmatrix &m) throw (cvmexception) |
Matrix replacement. | |
basic_cmatrix | operator+ (const basic_cmatrix &m) const throw (cvmexception) |
Addition operator. | |
basic_cmatrix | operator- (const basic_cmatrix &m) const throw (cvmexception) |
Subtraction operator. | |
basic_cmatrix & | sum (const basic_cmatrix &m1, const basic_cmatrix &m2) throw (cvmexception) |
Sum of matrices. | |
basic_cmatrix & | diff (const basic_cmatrix &m1, const basic_cmatrix &m2) throw (cvmexception) |
Difference of matrices. | |
basic_cmatrix & | operator+= (const basic_cmatrix &m) throw (cvmexception) |
Increment operator. | |
basic_cmatrix & | operator-= (const basic_cmatrix &m) throw (cvmexception) |
Decrement operator. | |
basic_cmatrix & | transpose (const basic_cmatrix &m) throw (cvmexception) |
Matrix transposition. | |
basic_cmatrix & | conj (const basic_cmatrix &m) throw (cvmexception) |
Matrix conjugation. | |
basic_cmatrix | operator* (const basic_cmatrix &m) const throw (cvmexception) |
Matrix-matrix product. | |
basic_cmatrix & | mult (const basic_cmatrix &m1, const basic_cmatrix &m2) throw (cvmexception) |
Matrix-matrix product. | |
basic_cmatrix & | rank1update_u (const CVector &vCol, const CVector &vRow) throw (cvmexception) |
Rank-1 update (unconjugated) | |
basic_cmatrix & | rank1update_c (const CVector &vCol, const CVector &vRow) throw (cvmexception) |
Rank-1 update (conjugated) | |
basic_cmatrix & | solve (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB, TR &dErr) throw (cvmexception) |
Linear solver. | |
basic_cmatrix & | solve_tran (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB, TR &dErr) throw (cvmexception) |
Linear solver (transposed) | |
basic_cmatrix & | solve_conj (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB, TR &dErr) throw (cvmexception) |
Linear solver (conjugated) | |
basic_cmatrix & | solve (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB) throw (cvmexception) |
Linear solver. | |
basic_cmatrix & | solve_tran (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB) throw (cvmexception) |
Linear solver (transposed) | |
basic_cmatrix & | solve_conj (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB) throw (cvmexception) |
Linear solver (conjugated) | |
basic_cmatrix & | solve_lu (const basic_scmatrix< TR, TC > &mA, const basic_scmatrix< TR, TC > &mLU, const tint *pPivots, const basic_cmatrix &mB, TR &dErr) throw (cvmexception) |
LU factorization based linear solver. | |
basic_cmatrix & | solve_lu (const basic_scmatrix< TR, TC > &mA, const basic_scmatrix< TR, TC > &mLU, const tint *pPivots, const basic_cmatrix &mB) throw (cvmexception) |
LU factorization based linear solver. | |
RVector | svd () const throw (cvmexception) |
Singular value decomposition. | |
RVector | svd (basic_scmatrix< TR, TC > &mU, basic_scmatrix< TR, TC > &mVH) const throw (cvmexception) |
Singular value decomposition. | |
basic_cmatrix | pinv (TR threshold=basic_cvmMachSp< TR >()) const throw (cvmexception) |
Pseudo (generalized) inversion. | |
basic_cmatrix & | pinv (const basic_cmatrix &mA, TR threshold=basic_cvmMachSp< TR >()) throw (cvmexception) |
Pseudo (generalized) inversion. | |
basic_cmatrix | gels (bool conjugate, const basic_cmatrix &mB, basic_cvector< TR, TC > &vErr) const throw (cvmexception) |
Overdetermined or underdetermined linear solver. | |
basic_cmatrix & | gels (bool conjugate, const basic_cmatrix &mA, const basic_cmatrix &mB, basic_cvector< TR, TC > &vErr) throw (cvmexception) |
Overdetermined or underdetermined linear solver. | |
basic_cvector< TR, TC > | gels (bool conjugate, const basic_cvector< TR, TC > &vB, TC &dErr) const throw (cvmexception) |
Overdetermined or underdetermined linear solver. | |
basic_cmatrix | gelsy (const basic_cmatrix &mB, tint &rank, TR tol=basic_cvmMachSp< TR >()) const throw (cvmexception) |
Linear least squares problem. | |
basic_cmatrix & | gelsy (const basic_cmatrix &mA, const basic_cmatrix &mB, tint &rank, TR tol=basic_cvmMachSp< TR >()) throw (cvmexception) |
Linear least squares problem. | |
basic_cvector< TR, TC > | gelsy (const basic_cvector< TR, TC > &vB, tint &rank, TR tol=basic_cvmMachSp< TR >()) const throw (cvmexception) |
Linear least squares problem. | |
basic_cmatrix | gelss (const basic_cmatrix &mB, basic_rvector< TR > &sv, tint &rank, TR tol=basic_cvmMachSp< TR >()) const throw (cvmexception) |
Linear least squares problem. | |
basic_cmatrix & | gelss (const basic_cmatrix &mA, const basic_cmatrix &mB, basic_rvector< TR > &sv, tint &rank, TR tol=basic_cvmMachSp< TR >()) throw (cvmexception) |
Linear least squares problem. | |
basic_cvector< TR, TC > | gelss (const basic_cvector< TR, TC > &vB, basic_rvector< TR > &sv, tint &rank, TR tol=basic_cvmMachSp< TR >()) const throw (cvmexception) |
Linear least squares problem. | |
basic_cmatrix | gelsd (const basic_cmatrix &mB, basic_rvector< TR > &sv, tint &rank, TR tol=basic_cvmMachSp< TR >()) const throw (cvmexception) |
Linear least squares problem. | |
basic_cmatrix & | gelsd (const basic_cmatrix &mA, const basic_cmatrix &mB, basic_rvector< TR > &sv, tint &rank, TR tol=basic_cvmMachSp< TR >()) throw (cvmexception) |
Linear least squares problem. | |
basic_cvector< TR, TC > | gelsd (const basic_cvector< TR, TC > &vB, basic_rvector< TR > &sv, tint &rank, TR tol=basic_cvmMachSp< TR >()) const throw (cvmexception) |
Linear least squares problem. | |
tint | rank (TR tol=basic_cvmMachSp< TR >()) const throw (cvmexception) |
Matrix rank. | |
void | qr (basic_cmatrix< TR, TC > &mQ, basic_scmatrix< TR, TC > &mR) const throw (cvmexception) |
QR factorization ("economy" mode) | |
void | qr (basic_scmatrix< TR, TC > &mQ, basic_cmatrix< TR, TC > &mR) const throw (cvmexception) |
QR factorization ("full" mode) | |
void | lq (basic_scmatrix< TR, TC > &mL, basic_cmatrix< TR, TC > &mQ) const throw (cvmexception) |
LQ factorization ("economy" mode) | |
void | lq (basic_cmatrix< TR, TC > &mL, basic_scmatrix< TR, TC > &mQ) const throw (cvmexception) |
LQ factorization ("full" mode) | |
void | rq (basic_scmatrix< TR, TC > &mR, basic_cmatrix< TR, TC > &mQ) const throw (cvmexception) |
RQ factorization ("economy" mode) | |
void | rq (basic_cmatrix< TR, TC > &mR, basic_scmatrix< TR, TC > &mQ) const throw (cvmexception) |
RQ factorization ("full" mode) | |
void | ql (basic_cmatrix< TR, TC > &mQ, basic_scmatrix< TR, TC > &mL) const throw (cvmexception) |
QL factorization ("economy" mode) | |
void | ql (basic_scmatrix< TR, TC > &mQ, basic_cmatrix< TR, TC > &mL) const throw (cvmexception) |
QL factorization ("full" mode) | |
basic_cmatrix & | geru (TC alpha, const CVector &vCol, const CVector &vRow) throw (cvmexception) |
Rank-1 update matrix-vector operation (unconjugated) | |
basic_cmatrix & | gerc (TC alpha, const CVector &vCol, const CVector &vRow) throw (cvmexception) |
Rank-1 update matrix-vector operation (conjugated) | |
basic_cmatrix & | gemm (const basic_cmatrix &m1, bool bConj1, const basic_cmatrix &m2, bool bConj2, TC cAlpha, TC cBeta) throw (cvmexception) |
Generic matrix-matrix operation. | |
basic_cmatrix & | hemm (bool bLeft, const basic_schmatrix< TR, TC > &ms, const basic_cmatrix &m, TC cAlpha, TC cBeta) throw (cvmexception) |
Generic hermitian matrix-matrix operation. | |
TR | norm2 () const override |
2-norm | |
Public Member Functions inherited from Matrix< TR, TC > | |
tint | msize () const |
Number of rows. | |
tint | nsize () const |
Number of columns. | |
tint | ld () const |
Leading dimension. | |
tint | rowofmax () const |
Row with maximum element. | |
tint | rowofmin () const |
Row with minimum element. | |
tint | colofmax () const |
Column with maximum element. | |
tint | colofmin () const |
Column with minimum element. | |
TR | norm1 () const override |
1-norm | |
TR | norminf () const override |
Infinity norm. | |
Public Member Functions inherited from basic_array< TR, TC > | |
basic_array () | |
Default constructor. | |
basic_array (tint nSize, bool bZeroMemory=true) | |
Constructor. | |
basic_array (TC *pd, tint nSize, tint nIncr=1) | |
Constructor. | |
basic_array (const TC *pd, tint nSize, tint nIncr=1) | |
Constructor. | |
basic_array (const TC *begin, const TC *end) | |
Constructor. | |
basic_array (const basic_array &a) | |
Copy constructor. | |
basic_array (basic_array &&a) noexcept | |
Move constructor. | |
basic_array & | operator= (const basic_array &a) throw (cvmexception) |
Assignment operator. | |
basic_array & | operator= (basic_array &&a) throw (cvmexception) |
Move assignment operator. | |
virtual | ~basic_array () |
Destructor. | |
tint | size () const |
Size (length) of array. | |
TC * | get () |
Pointer to data. | |
const TC * | get () const |
Const pointer to data. | |
operator TC * () | |
Type cast to pointer to data. | |
operator const TC * () const | |
Type cast to constant pointer to data. | |
tint | incr () const |
Increment between elements. | |
tint | indofmax () const |
Index of element with maximum module. | |
tint | indofmin () const |
Index of element with minimum module. | |
virtual TR | norm () const |
Euclidean norm. | |
iterator | begin () |
(STL) iterator to begin | |
const_iterator | begin () const |
(STL) const iterator to begin | |
iterator | end () |
(STL) iterator to end | |
const_iterator | end () const |
(STL) const iterator to end | |
reverse_iterator | rbegin () |
(STL) iterator to begin reversed | |
const_reverse_iterator | rbegin () const |
(STL) const iterator to begin reversed | |
reverse_iterator | rend () |
(STL) iterator to end reversed | |
const_reverse_iterator | rend () const |
(STL) const iterator to end reversed | |
size_type | max_size () const |
(STL) maximum possible size of array | |
size_type | capacity () const |
(STL) current capacity of array, equal to size() | |
bool | empty () const |
(STL) is array empty | |
reference | front () |
(STL) reference to first element | |
const_reference | front () const |
(STL) const reference to first element | |
reference | back () |
(STL) reference to last element | |
const_reference | back () const |
(STL) const reference to last element | |
void | assign (size_type n, const TC &val) throw (cvmexception) |
(STL) assigns given value to n-th element (0-based) | |
void | assign (const_iterator begin, const_iterator end) throw (cvmexception) |
(STL) assigns begin-end iteartor range to array | |
void | clear () |
(STL) clears array, dealocates memory and sets size() to zero | |
void | swap (basic_array &v) throw (cvmexception) |
(STL) swaps array values, throws cvmexception if sizes are different | |
reference | at (size_type n) throw (cvmexception) |
(STL) returns reference to n-th element of array (0-based), throws cvmexception if n is out of boundaries | |
const_reference | at (size_type n) const throw (cvmexception) |
(STL) returns const reference to n-th element of array (0-based), throws cvmexception if n is out of boundaries | |
void | push_back (const TC &x) throw (cvmexception) |
(STL) pushes new value to the end of array | |
void | pop_back () throw (cvmexception) |
(STL) removes last element from array | |
iterator | insert (iterator position, const TC &x) throw (cvmexception) |
(STL) inserts element to given position in array | |
iterator | erase (iterator position) throw (cvmexception) |
(STL) removes element from given position in array |
Additional Inherited Members | |
Public Types inherited from basic_array< TR, TC > | |
typedef TC | value_type |
STL-specific value type definition. | |
typedef value_type * | pointer |
STL-specific value pointer definition. | |
typedef value_type * | iterator |
STL-specific iterator definition. | |
typedef const value_type * | const_iterator |
STL-specific const iterator definition. | |
typedef const value_type * | const_pointer |
STL-specific const pointer definition. | |
typedef value_type & | reference |
STL-specific reference definition. | |
typedef const value_type & | const_reference |
STL-specific const reference definition. | |
typedef size_t | size_type |
STL-specific size type definition. | |
typedef ptrdiff_t | difference_type |
STL-specific difference type definition. | |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
STL-specific const reverse iterator definition. | |
typedef std::reverse_iterator < iterator > | reverse_iterator |
STL-specific reverse iterator definition. | |
Protected Member Functions inherited from Matrix< TR, TC > | |
Matrix () | |
Default constructor. | |
Matrix (tint nM, tint nN, tint nLD, bool bZeroMemory) | |
Constructor. | |
Matrix (TC *pd, tint nM, tint nN, tint nLD, tint nSize) | |
Constructor. | |
Matrix (const TC *pd, tint nM, tint nN, tint nLD, tint nSize) | |
Constructor. | |
Matrix (const BaseArray &v, bool bBeColumn) | |
Constructor. | |
Matrix (Matrix &&m) noexcept | |
Move constructor. | |
Matrix & | operator= (Matrix &&m) throw (cvmexception) |
Move assignment operator. | |
Protected Member Functions inherited from SqMatrix< TR, TC > | |
SqMatrix () | |
internal constructor | |
virtual | ~SqMatrix () |
Protected Attributes inherited from Matrix< TR, TC > | |
tint | mm |
Number of rows. | |
tint | mn |
Number of columns. | |
tint | mld |
Leading dimension. |
End-user class encapsulating square matrix of complex numbers.
TR
type stands for treal, TC
type stands for tcomplex. Please use predefined scmatrix class in your applications.
|
inline |
Default constructor.
Creates empty square complex matrix. No memory gets allocated.
|
inlineexplicit |
Constructor.
Creates scmatrix object where is passed in nDim
parameter. Constructor sets all elements to zero. It throws cvmexception in case of non-positive size passed or memory allocation failure. Example:
prints
[in] | nDim | Number of rows and columns. |
|
inline |
Constructor.
Creates scmatrix object where is passed in nDim
parameter. It throws cvmexception in case of non-positive size passed. Unlike others, this constructor does not allocate memory. It just shares memory with array pointed to by pd
(for matrices nIncr=1
is always satisfied).
[in] | pd | Pointer to array to share memory with. |
[in] | nDim | Number of rows and columns. |
|
inline |
Constructor.
Creates scmatrix object where is passed in nDim
parameter. Constructor throws cvmexception in case of non-positive sizes passed. This is const version, it allocates memory and copies every element (deep copy) from external array pointed to by pd
parameter. It copies nDim*nDim
elements total.
[in] | pd | Const pointer to external array. |
[in] | nDim | Number of rows and columns. |
|
inline |
Copy constructor.
Creates scmatrix object as a copy of smatrix m
. It throws cvmexception in case of memory allocation failure.
[in] | m | scmatrix to copy from. |
|
inline |
Move constructor.
Implements move semantics introduced in new C++ standard. Moves data ownership from other matrix to newly created object. It's usually executed implicitly in cases like this:
or this
Here temporary result of calling b.operator+(c)
will not be destroyed but rather moved to newly created object a
.
[in] | m | rvalue reference to other matrix. |
|
inline |
Constructor.
Creates scmatrix object as a copy of matrix m
. It's assumed that matrix m
must have equal sizes, i.e. is satisfied. Constructor throws cvmexception if this is not true or in case of memory allocation failure. Please note that this constructor is not explicit.
[in] | m | cmatrix to copy from. |
Definition at line 23683 of file cvm.h.
|
inlineexplicit |
Constructor.
Creates scmatrix object of size v.size()
by v.size()
and assigns vector v
to its main diagonal. Constructor throws cvmexception in case of memory allocation failure.
[in] | v | cvector to copy main diagonal from. |
Definition at line 23713 of file cvm.h.
|
inlineexplicit |
Constructor.
Creates cmatrix with the same dimensions as passed srmatrix m
and copies matrix m
to its real part if bRealPart
is true
or to its imaginary part otherwise. Constructor throws cvmexception in case of memory allocation failure.
[in] | m | srmatrix to copy elements from. |
[in] | bRealPart | true to copy m to real part, false to copy to imaginary part. |
Definition at line 23746 of file cvm.h.
|
inline |
Constructor.
Creates scmatrix
object of dimension nDim
and copies every element of arrays pointed to by pRe
and pIm
to real and imaginary part of the matrix created respectively. Use nullptr
pointer to fill up appropriate part with zero values. Constructor throws cvmexception in case of memory allocation failure.
|
inline |
Constructor.
Creates scmatrix object of dimension mRe.msize()
(if it differs from mIm.msize()
then constructor throws cvmexception) and copies matrices mRe
and mIm
to real and imaginary part of the matrix created respectively. Constructor also throws cvmexception in case of memory allocation failure.
Definition at line 23823 of file cvm.h.
|
inline |
Submatrix constructor.
Creates scmatrix object as submatrix of matrix m
. It means that the object created shares memory with some part of m
. This part is defined by its upper left corner (parameters nRow
and nCol
, both are CVM0 based) and its dimension (parameter nDim
).
|
inline |
Reference to element (l-value)
Operator provides access to a particular element of calling matrix by its row and column index. Indexes passed are CVM0 based. It returns l-value in order to make possible write access to an element. Operator throws cvmexception if nRow
or nCol
is outside of boundaries.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_scbmatrix< TR, TC >.
Definition at line 23865 of file cvm.h.
|
inline |
Value of element (not l-value)
Operator returns value of a particular element of calling matrix by its row and column index. Indexes passed are CVM0 based. Operator throws cvmexception if nRow
or nCol
is outside of boundaries.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
Definition at line 23872 of file cvm.h.
|
inline |
Column as l-value.
Operator provides access to nCol-th
column (CVM0 based) of calling matrix by returning cvector sharing memory with it. Operator throws cvmexception if nCol
is outside of boundaries.
[in] | nCol | Index of column (CVM0 based). |
Reimplemented from basic_cmatrix< TR, TC >.
Definition at line 23880 of file cvm.h.
|
inline |
Column as not l-value.
Operator creates cvector object as a copy of nCol-th
column (CVM0 based) of calling matrix. Operator throws cvmexception if nCol
is outside of boundaries.
[in] | nCol | Index of column (CVM0 based). |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
Definition at line 23887 of file cvm.h.
|
inline |
Row as l-value.
Operator provides access to nRow-th
row (CVM0 based) of calling matrix by returning cvector sharing memory with it. Operator throws cvmexception if nRow
is outside of boundaries.
[in] | nRow | Index of row (CVM0 based). |
Reimplemented from basic_cmatrix< TR, TC >.
Definition at line 23894 of file cvm.h.
|
inline |
Row as not l-value.
Operator creates cvector object as a copy of nRow-th
row (CVM0 based) of calling matrix. Operator throws cvmexception if nRow
is outside of boundaries.
[in] | nRow | Index of row (CVM0 based). |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
Definition at line 23901 of file cvm.h.
|
inline |
Real part (not l-value)
Creates object of type const
rmatrix as real part of calling matrix. Please note that, unlike cvector::real(), this function creates new object not sharing memory with real part of calling matrix, i.e. the matrix returned is not l-value.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
Definition at line 23908 of file cvm.h.
|
inline |
Imaginary part (not l-value)
Creates object of type const
rmatrix as imaginary part of calling matrix. Please note that, unlike cvector::imag(), this function creates new object not sharing memory with imaginary part of calling matrix, i.e. the matrix returned is not l-value.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
Definition at line 23916 of file cvm.h.
|
inline |
Assignment operator.
Sets every element of calling scmatrix to be equal to appropriate element of smatrix m
and returns reference to the matrix changed. Operator throws cvmexception in case of different matrix dimensions.
[in] | m | scmatrix to assign from. |
Definition at line 23952 of file cvm.h.
|
inline |
Move assignment operator.
Implements move semantics introduced in new C++ standard. Moves data ownership from other matrix to calling object. It's usually executed implicitly in cases like this:
Here temporary result of calling b.operator+(c)
will not be destroyed but rather moved to calling object a
.
[in] | m | rvalue reference to other matrix. |
Definition at line 23972 of file cvm.h.
|
inline |
Vector (as array) assignment.
Sets every element of calling matrix to be equal to appropriate element of cvector v
as an array. Assignment is performed according to matrix storage (by columns). It's assumed that vector passed is long enough to fill calling matrix. Function throws cvmexception otherwise.
[in] | v | cvector to assign. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_scbmatrix< TR, TC >.
Definition at line 23980 of file cvm.h.
|
inline |
External array assignment.
Sets every element of calling matrix to be equal to appropriate element of array pointed to by parameter pd
and returns reference to the matrix changed. Assignment is performed according to matrix storage (by columns). It's assumed that array passed is long enough to fill calling matrix.
[in] | pd | Const pointer to external array. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_scbmatrix< TR, TC >.
|
inline |
Assignment to submatrix.
Sets submatrix of calling matrix beginning with row nRow
and column nCol
to matrix m
and returns reference to the matrix changed. Function throws cvmexception if nRow
or nCol
are not positive or matrix m
doesn't fit. Indexes are CVM0 based.
[in] | nRow | Row index (CVM0 based). |
[in] | nCol | Column index (CVM0 based). |
[in] | m | Reference to cmatrix to assign. |
Definition at line 24025 of file cvm.h.
|
inline |
Sets all elements to one value.
Sets every element of calling matrix to be equal to parameter c
and returns reference to the matrix changed.
[in] | c | Value to set to. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_scbmatrix< TR, TC >.
|
inline |
Assignment to real parts.
Sets real part of every element of calling matrix to value of appropriate element of srmatrix mRe
and returns reference to the matrix changed. Function throws cvmexception in case of different dimensions of the operands.
[in] | mRe | srmatrix to assign to real part. |
Definition at line 24066 of file cvm.h.
|
inline |
Assignment to imaginary parts.
Sets imaginary part of every element of calling matrix to value of appropriate element of srmatrix mRe
and returns reference to the matrix changed. Function throws cvmexception in case of different dimensions of the operands.
[in] | mIm | srmatrix to assign to imaginary part. |
Definition at line 24098 of file cvm.h.
|
inline |
Sets all real parts to one value.
Sets real part of every element of calling matrix to be equal to parameter d
and returns reference to the matrix changed.
[in] | d | Value to set to. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Sets all imaginary parts to one value.
Sets imaginary part of every element of calling matrix to be equal to parameter d
and returns reference to the matrix changed.
[in] | d | Value to set to. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_scbmatrix< TR, TC >.
|
inline |
Changes dimension.
Changes dimension of calling square matrix to nNewDim
and returns reference to the matrix changed. In case of increasing of its size, the matrix is filled up with zeroes. Function throws cvmexception in case of negative dimension passed or memory allocation failure.
[in] | nNewDim | New dimension. |
Reimplemented from basic_array< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Matrix replacement.
Destroys calling matrix, creates a new one as a copy of m
and returns reference to the matrix changed. Operator throws cvmexception in case of memory allocation failure.
[in] | m | scmatrix to replace by. |
|
inline |
Addition operator.
Creates object of type scmatrix as sum of calling matrix and matrix m
. Operator throws cvmexception in case of different sizes of the operands or memory allocation failure.
[in] | m | scmatrix to add to calling one. |
Definition at line 24240 of file cvm.h.
|
inline |
Subtraction operator.
Creates object of type scmatrix as difference of calling matrix and matrix m
. It throws cvmexception in case of different sizes of the operands or memory allocation failure.
[in] | m | scmatrix to subtract from calling one. |
Definition at line 24281 of file cvm.h.
|
inline |
Sum of matrices.
Assigns sum of square complex matrices m1
and m2
to calling matrix and returns reference to the matrices changed. It throws cvmexception in case of different sizes of the operands.
Definition at line 24327 of file cvm.h.
|
inline |
Difference of matrices.
Assigns difference of square complex matrices m1
and m2
to calling matrix and returns reference to the matrix changed. It throws cvmexception in case of different sizes of the operands.
Definition at line 24373 of file cvm.h.
|
inline |
Increment operator.
Adds scmatrix m
to calling matrix and returns reference to the matrix changed. It throws cvmexception in case of different sizes of the operands.
[in] | m | scmatrix to increment by. |
Definition at line 24422 of file cvm.h.
|
inline |
Decrement operator.
Subtracts scmatrix m
from calling matrix and returns reference to the matrix changed. It throws cvmexception in case of different sizes of the operands.
[in] | m | scmatrix to decrement by. |
Definition at line 24470 of file cvm.h.
|
inline |
Unary minus operator.
Creates object of type scmatrix as calling matrix multiplied by -1
. It throws cvmexception in case of memory allocation failure.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Plus identity, prefix.
Adds identity matrix to calling square complex matrix and returns reference to the matrix changed.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Plus identity, postfix.
Adds identity matrix to calling square complex matrix and returns reference to the matrix changed.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Minus identity, prefix.
Subtracts identity matrix from calling square complex matrix and returns reference to the matrix changed.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Minus identity, postfix.
Subtracts identity matrix from calling square complex matrix and returns reference to the matrix changed.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Multiply by real number operator.
Creates object of type scmatrix as product of calling matrix and real number dMult
. It throws cvmexception in case of memory allocation failure.
[in] | dMult | Number to multiply by. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Divide by real number operator.
Creates object of type scmatrix as quotient of calling matrix and real number dDiv
. It throws cvmexception if dDiv
has absolute value equal or less than cvmMachMin() (the smallest normalized positive number). It also throws exception in case of memory allocation failure.
[in] | dDiv | Number to divide by. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Multiply by complex number operator.
Creates object of type scmatrix as product of calling matrix and complex number cMult
. It throws cvmexception in case of memory allocation failure.
[in] | cMult | Number to multiply by. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Divide by complex number operator.
Creates object of type scmatrix as quotient of calling matrix and complex number cDiv
. It throws cvmexception if cDiv
has absolute value equal or less than cvmMachMin() (the smallest normalized positive number). It also throws exception in case of memory allocation failure.
[in] | cDiv | Number to divide by. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Multiply by real number and assign.
Multiplies calling square complex matrix by real number dMult
and returns reference to the matrix changed.
[in] | dMult | Number to multiply by. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Divide by real number and assign.
Divides calling square complex matrix by real number dDiv
and returns reference to the matrix changed. It throws cvmexception if dDiv
has absolute value equal or less than cvmMachMin() (the smallest normalized positive number).
[in] | dDiv | Number to divide by. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Multiply by complex number and assign.
Multiplies calling square complex matrix by complex number cMult
and returns reference to the matrix changed.
[in] | cMult | Number to multiply by. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_scbmatrix< TR, TC >.
|
inline |
Divide by complex number and assign.
Divides calling square complex matrix by complex number cDiv
and returns reference to the matrix changed. It throws cvmexception if cDiv
has absolute value equal or less than cvmMachMin() (the smallest normalized positive number).
[in] | cDiv | Number to divide by. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_scbmatrix< TR, TC >.
|
inline |
Matrix normalizer.
Normalizes calling matrix so its Euclidean norm() becomes equal to 1 if it was greater than cvmMachMin() (the smallest normalized positive number) before the call. Does nothing otherwise.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Matrix transposition.
Creates object of type scmatrix
as transposed calling matrix.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
Definition at line 24923 of file cvm.h.
|
inline |
Matrix conjugation.
Creates object of type scmatrix
as hermitian conjugated calling matrix.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
Definition at line 24966 of file cvm.h.
|
inline |
Matrix transposition.
Sets calling matrix to be equal to square complex matrix m
transposed. Function throws cvmexception in case of not appropriate sizes of the operands.
[in] | m | scmatrix to transpose. |
Definition at line 25010 of file cvm.h.
|
inline |
Matrix conjugation.
Sets calling matrix to be equal to square complex matrix m
hermitian conjugated. Function throws cvmexception in case of not appropriate sizes of the operands.
[in] | m | scmatrix to conjugate. |
Definition at line 25055 of file cvm.h.
|
inline |
Matrix transposition (in-place)
Makes calling square complex matrix to be equal to transposed itself. Function throws cvmexception in case of memory allocation failure.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Matrix conjugation (in-place)
Makes calling square complex matrix to be equal to hermitian conjugated itself. Function throws cvmexception in case of memory allocation failure.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Matrix-vector product.
Creates object of type cvector as product of calling matrix and vector v
. Function throws cvmexception if the number of columns of the calling matrix differs from size of the vector v
. Use basic_cvector::mult(const basic_cmatrix<TR,TC>&,const basic_cvector<TR,TC>&) to avoid new object creation.
[in] | v | cvector to compute product with. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
Definition at line 25148 of file cvm.h.
|
inline |
Matrix-matrix product.
Creates object of type cmatrix as product of calling square complex matrix and matrix m
. Operator throws cvmexception if number of columns of calling matrix differs from number of rows of the matrix m
. Use mult() to avoid new object creation.
[in] | m | cmatrix to compute product with. |
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
Definition at line 25183 of file cvm.h.
|
inline |
Matrix-matrix product.
Creates object of type scmatrix as product of calling matrix and square matrix m
. Operator throws cvmexception if number of columns of calling matrix differs from number of rows of the matrix m
. Use mult() to avoid new object creation.
[in] | m | scmatrix to compute product with. |
Definition at line 25216 of file cvm.h.
|
inline |
Matrix-matrix product with assignment.
Sets calling matrix to be equal to product of itself and square complex matrix m
and returns reference to the object it changes. Operator throws cvmexception in case of different dimensions of the operands.
[in] | m | scmatrix to compute product with. |
Definition at line 25258 of file cvm.h.
|
inline |
Rows swap.
Swaps two rows of calling matrix and returns reference to the matrix changed. n1
and n2
are indexes of rows to be swapped, both are CVM0 based. Function throws cvmexception if one of the parameters is outside of boundaries.
[in] | n1 | Row index to swap. |
[in] | n2 | Row index to swap. |
Reimplemented from basic_cmatrix< TR, TC >.
|
inline |
Columns swap.
Swaps two columnss of calling matrix and returns reference to the matrix changed. n1
and n2
are indexes of columns to be swapped, both are CVM0 based. Function throws cvmexception if one of the parameters is outside of boundaries.
[in] | n1 | Column index to swap. |
[in] | n2 | Column index to swap. |
Reimplemented from basic_cmatrix< TR, TC >.
|
inline |
Linear solver.
Creates cvector object as solution of linear equation where calling matrix is square complex matrix and parameter vB
is vector . It also sets output parameter dErr
to be equal to the norm of computation error. Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | vB | cvector . |
[out] | dErr | Norm of computation error. |
|
inline |
Linear solver (transposed)
Creates cvector object as solution of linear equation (which is equivalent to ) where calling matrix is square complex matrix and parameter vB
is vector . It also sets output parameter dErr
to be equal to the norm of computation error. Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | vB | cvector . |
[out] | dErr | Norm of computation error. |
|
inline |
Linear solver (hermitian conjugated)
Creates cvector object as solution of linear equation where calling matrix is square complex matrix and parameter vB
is vector . It also sets output parameter dErr
to be equal to the norm of computation error. Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | vB | cvector . |
[out] | dErr | Norm of computation error. |
|
inline |
Linear solver.
Creates cvector object as solution of linear equation where calling matrix is square complex matrix and parameter vB
is vector . Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | vB | cvector . |
|
inline |
Linear solver (transposed)
Creates cvector object as solution of linear equation (which is equivalent to ) where calling matrix is square complex matrix and parameter vB
is vector . Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | vB | cvector . |
|
inline |
Linear solver (hermitian conjugated)
Creates cvector object as solution of linear equation where calling matrix is square complex matrix and parameter vB
is vector . Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | vB | cvector . |
|
inline |
Linear solver.
Creates cmatrix object as solution of matrix linear equation where calling square complex matrix is matrix and parameter mB
is matrix . It also sets output parameter dErr
to be equal to the norm of computation error. Function throws cvmexception in case of inappropriate sizes of the operands or when the matrix is close to singular.
[in] | mB | cmatrix . |
[out] | dErr | Norm of computation error. |
|
inline |
Linear solver (transposed)
Creates cmatrix object as solution of matrix linear equation (which is equivalent to ) where calling matrix is square complex matrix and parameter mB
is matrix . It also sets output parameter dErr
to be equal to the norm of computation error. Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | mB | cmatrix . |
[out] | dErr | Norm of computation error. |
|
inline |
Linear solver (hermitian conjugated)
Creates cmatrix object as solution of matrix linear equation (which is equivalent to ) where calling matrix is square complex matrix and parameter mB
is matrix . It also sets output parameter dErr
to be equal to the norm of computation error. Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | mB | cmatrix . |
[out] | dErr | Norm of computation error. |
|
inline |
Linear solver.
Creates cmatrix object as solution of matrix linear equation where calling square complex matrix is matrix and parameter mB
is matrix . Function throws cvmexception in case of inappropriate sizes of the operands or when the matrix is close to singular.
[in] | mB | cmatrix . |
|
inline |
Linear solver (transposed)
Creates cmatrix object as solution of matrix linear equation (which is equivalent to ) where calling matrix is square complex matrix and parameter mB
is matrix . Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | mB | cmatrix . |
|
inline |
Linear solver (hermitian conjugated)
Creates cmatrix object as solution of matrix linear equation (which is equivalent to ) where calling matrix is square complex matrix and parameter mB
is matrix . Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | mB | cmatrix . |
|
inline |
Linear solver operator (transposed)
Creates cvector object as solution of linear equation (which is equivalent to ) where calling matrix is square complex matrix and parameter vB
is vector . Operator throws cvmexception in case of inappropriate sizes of the operands or when matrix is close to singular.
[in] | vB | cvector . |
|
inline |
Linear solver operator.
Creates cvector object as solution of linear equation where calling matrix is square complex matrix and parameter vB
is vector . Operator throws cvmexception in case of inappropriate sizes of the operands or when matrix is close to singular.
[in] | vB | cvector . |
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
LU factorization based linear solver.
Creates object of type cvector as solution of linear equation where calling matrix is square complex matrix , parameter mLU
is LU factorization (see low_up() ) of matrix , parameter pPivots
is an array of pivot numbers created while factorizing matrix and parameter vB
is vector . Function also sets output parameter dErr
to be equal to the norm of computation error. This function is useful when you need to solve few linear equations of kind with the same matrix and different vectors . In such case you save on matrix factorization since it's needed to be performed just one time. It also sets output parameter dErr
to be equal to the norm of computation error and throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | mLU | LU factorization of matrix . |
[in] | pPivots | pivots vector. |
[in] | vB | cvector . |
[out] | dErr | Norm of computation error. |
Definition at line 26234 of file cvm.h.
|
inline |
LU factorization based linear solver.
Creates object of type cvector as solution of linear equation where calling matrix is square complex matrix , parameter mLU
is LU factorization (see low_up() ) of matrix , parameter pPivots
is an array of pivot numbers created while factorizing matrix and parameter vB
is vector . Function also sets output parameter dErr
to be equal to the norm of computation error. This function is useful when you need to solve few linear equations of kind with the same matrix and different vectors . In such case you save on matrix factorization since it's needed to be performed just one time. It throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | mLU | LU factorization of matrix . |
[in] | pPivots | pivots vector. |
[in] | vB | cvector . |
|
inline |
LU factorization based linear solver.
Creates object of type cmatrix as solution of matrix linear equation where calling matrix is square complex matrix , parameter mLU
is LU factorization (see low_up() ) of matrix , parameter pPivots
is an array of pivot numbers created while factorizing matrix and parameter mB
is matrix . This function is useful when you need to solve few linear equations of kind with the same matrix and different matrices . In such case you save on matrix factorization since it's needed to be performed just one time. Function also sets output parameter dErr
to be equal to the norm of computation error and throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | mLU | LU factorization of matrix . |
[in] | pPivots | pivots vector. |
[in] | mB | cmatrix . |
[out] | dErr | Norm of computation error. |
Definition at line 26415 of file cvm.h.
|
inline |
LU factorization based linear solver.
Creates object of type cmatrix as solution of matrix linear equation where calling matrix is square complex matrix , parameter mLU
is LU factorization (see low_up() ) of matrix , parameter pPivots
is an array of pivot numbers created while factorizing matrix and parameter mB
is matrix . This function is useful when you need to solve few linear equations of kind with the same matrix and different matrices . In such case you save on matrix factorization since it's needed to be performed just one time. Function throws cvmexception in case of inappropriate sizes of the objects or when matrix is close to singular.
[in] | mLU | LU factorization of matrix . |
[in] | pPivots | pivots vector. |
[in] | mB | cmatrix . |
|
inline |
Matrix determinant.
Returns determinant of calling matrix. It uses the LU factorization internally and may throw the same exceptions as the factorizer.
|
inline |
Low-up (LU) factorization.
Compute LU factorization of square complex matrix as
where is permutation matrix, is lower triangular matrix with unit diagonal elements and is upper triangular matrix. Function stores result as the matrix without main diagonal combined with . Function returns pivot indices as array of integers (it should support at least msize() elements) pointed to by nPivots
so -th row was interchanged with nPivots
[ ]-th row. This version sets calling matrix to be equal to matrix m's
LU factorization. Function throws cvmexception in case of inappropriate sizes of the operands or when the matrix to be factorized is close to singular. It is recommended to use iarray for pivot values.
[in] | m | scmatrix to compute LU factorization for. |
[out] | nPivots | Array of pivot indices. |
Definition at line 26622 of file cvm.h.
|
inline |
Low-up (LU) factorization.
Compute LU factorization of square complex matrix as
where is permutation matrix, is lower triangular matrix with unit diagonal elements and is upper triangular matrix. Function stores result as the matrix without main diagonal combined with . Function returns pivot indices as array of integers (it should support at least msize() elements) pointed to by nPivots
so -th row was interchanged with nPivots
[ ]-th row. This version creates object of type srmatrix as calling matrix LU factorization. Function throws cvmexception in case of inappropriate sizes of the operands or when the matrix to be factorized is close to singular. It is recommended to use iarray for pivot values.
[out] | nPivots | Array of pivot indices. |
Reimplemented in basic_scbmatrix< TR, TC >.
|
inline |
Condition number reciprocal.
Returns condition number reciprocal of calling matrix in the infinity-norm
Less value returned means that matrix is closer to singular. Zero value returned means estimation underflow or that matrix is singular. The condition number is used for error analysis of systems of linear equations. Function throws cvmexception in case of LAPACK subroutines failure.
|
inline |
Matrix inversion.
This version sets calling matrix to be equal to square complex matrix m
inverted. Function throws cvmexception in case of inappropriate sizes of the operands or when the matrix to be inverted is close to singular.
[in] | m | scmatrix to invert. |
|
inline |
Matrix inversion.
This version creates scmatrix object equal to calling matrix inverted. Function throws cvmexception in case of memory allocation failure or when the matrix to be inverted is close to singular.
Reimplemented in basic_schmatrix< TR, TC >.
Definition at line 26849 of file cvm.h.
|
inline |
Matrix exponent.
Computes exponent of square complex matrix using Pade approximation defined as
where
along with the matrix normalizing as described in Gene H. Golub, Charles F. Van Loan. Matrix Computations, The Johns Hopkins University Press, 1996, 694~p., ISBN 0-8018-5413-X, p. 572. Function uses DMEXP (or SMEXP for float
version) FORTRAN
subroutine implementing the algorithm. This version sets calling matrix to be equal to exponent of m
and returns reference to the matrix changed. The algorithm uses parameter tol
as in order to choose constants and so that
This parameter is equal to the largest relative spacing (see cvmMachSp() ) by default. Functions throw cvmexception in case of inappropriate sizes of the operands or when LAPACK subroutine fails.
[in] | m | scmatrix to compute exponent for. |
[in] | tol | Computation tolerance. |
|
inline |
Matrix exponent.
Computes exponent of square matrix using Pade approximation defined as
where
along with the matrix normalizing as described in Gene H. Golub, Charles F. Van Loan. Matrix Computations, The Johns Hopkins University Press, 1996, 694~p., ISBN 0-8018-5413-X, p. 572. Function uses DMEXP (or SMEXP for float
version) FORTRAN
subroutine implementing the algorithm. This version creates object of type scmatrix
as exponent of calling matrix. The algorithm uses parameter tol
as in order to choose constants and so that
This parameter is equal to the largest relative spacing (see cvmMachSp() ) by default. Functions throw cvmexception in case of inappropriate sizes of the operands or when LAPACK subroutine fails.
[in] | tol | Computation tolerance. |
Reimplemented in basic_schmatrix< TR, TC >.
Definition at line 27002 of file cvm.h.
|
inline |
Matrix polynomial.
Computes matrix polynomial defined as
using the Horner's rule:
where
See also Gene H. Golub, Charles F. Van Loan. Matrix Computations, The Johns Hopkins University Press, 1996, 694~p., ISBN 0-8018-5413-X, p. 568. The coefficients are passed in parameter v
, where is equal to v.size()-1
, so the function computes matrix polynomial equal to
This version sets calling matrix to be equal to the polynomial of m
. Function uses DPOLY (or SPOLY for float
version) FORTRAN
subroutine implementing the Horner's algorithm. Function throws cvmexception in case of inappropriate sizes of the operands.
[in] | m | scmatrix to compute polynomial for. |
[in] | v | Vector of coefficients. |
Definition at line 27088 of file cvm.h.
|
inline |
Matrix polynomial.
Computes matrix polynomial defined as
using the Horner's rule:
where
See also Gene H. Golub, Charles F. Van Loan. Matrix Computations, The Johns Hopkins University Press, 1996, 694~p., ISBN 0-8018-5413-X, p. 568. The coefficients are passed in parameter v
, where is equal to v.size()-1
, so the function computes matrix polynomial equal to
This version creates object of type srmatrix as the polynomial of calling matrix. Function uses DPOLY (or SPOLY for float
version) FORTRAN
subroutine implementing the Horner's algorithm. Function throws cvmexception in case of memory allocation failure.
[in] | v | Vector of coefficients. |
Definition at line 27175 of file cvm.h.
|
inline |
Eigenvalues and eigenvectors.
Solves eigenvalue problem and creates cvector object equal to eigenvalues of calling matrix. The eigenvalue problem is defined as follows: given square matrix , find the eigenvalues and the corresponding eigenvectors that satisfy the equation
Some eigenvalues may be complex even for real matrix . Moreover, if real nonsymmetric matrix has a complex eigenvalue corresponding to an eigenvector , then is also an eigenvalue. The eigenvalue corresponds to the eigenvector whose elements are complex conjugate to the elements of . Function sets output parameter mEigVect
to be equal to square matrix containing eigenvectors as columns. Function also computes "left" eigenvectors if parameter bRightVect
is set to false
. Left eigencectors satisfy
Function throws cvmexception in case of inappropriate calling object sizes or in case of convergence error.
[out] | mEigVect | Eigenvectors of mA . |
[in] | bRightVect | true (default) to compute right eigenvectors. |
Definition at line 27242 of file cvm.h.
|
inline |
Eigenvalues.
Solves eigenvalue problem and creates cvector object equal to eigenvalues of calling matrix. The eigenvalue problem is defined as follows: given square matrix , find the eigenvalues and the corresponding eigenvectors that satisfy the equation
Some eigenvalues may be complex even for real matrix . Moreover, if real nonsymmetric matrix has a complex eigenvalue corresponding to an eigenvector , then is also an eigenvalue. The eigenvalue corresponds to the eigenvector whose elements are complex conjugate to the elements of . Function throws cvmexception in case of in caso of memory allocation failure or convergence error.
Reimplemented in basic_schmatrix< TR, TC >.
Definition at line 27286 of file cvm.h.
|
inline |
Cholesky factorization.
Forms the Cholesky factorization of hermitian positive-definite complex matrix defined as
where is upper triangular matrix. It utilizes one of ZPOTRF
routines of the LAPACK
library. Function sets calling matrix to be equal to the factorization of hermitian positive-definite matrix m
. Function throws cvmexception in case of inappropriate sizes of the operands or in case of convergence error.
[in] | m | schmatrix to factorize. |
|
inline |
Bunch-Kaufman factorization.
Forms the Bunch-Kaufman factorization of hermitian matrix (cited from the MKL library documentation):
where is the input matrix passed in parameter m
, is a permutation matrix, and are upper and lower triangular matrices with unit diagonal, and is a symmetric block-diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks. and have 2-by-2 unit diagonal blocks corresponding to the 2-by-2 blocks of . It utilizes one of ZHETRF
routines of the LAPACK
library. Function sets calling matrix to be equal to the factorization of symmetric positive-definite matrix m
. Function throws cvmexception in case of inappropriate sizes of the operands or in case of convergence error. Function is mostly designed to be used for subsequent calls of ZHETRS
, ZHECON
and ZHETRI
routines of the LAPACK
library. Currently it's used internally in det() flow when argument is symmetric but not positive-definite.
[in] | m | schmatrix to factorize. |
[out] | nPivots | Pivot indices array. |
|
inline |
QR factorization.
Computes QR factorization as
where is calling square complex matrix, orthogonal matrix and upper triangular matrix are mQ
and mR
respectively. Function throws cvmexception in case if inappropriate sizes of the operands passed.
|
inline |
LQ factorization.
Computes LQ factorization as
where is calling square complex matrix, lower triangular matrix and orthogonal matrix are mL
and mQ
respectively. Function throws cvmexception in case if inappropriate sizes of the operands passed.
|
inline |
QL factorization.
Computes QL factorization as
where is calling square complex matrix, orthogonal matrix and lower triangular matrix are mQ
and mL
respectively. Function throws cvmexception in case if inappropriate sizes of the operands passed.
|
inline |
RQ factorization.
Computes RQ factorization as
where is calling square complex matrix, upper triangular matrix and orthogonal matrix are mR
and mQ
respectively. Function throws cvmexception in case if inappropriate sizes of the operands passed.
|
inline |
Identity matrix.
Sets calling square complex matrix to be equal to identity matrix and returns reference to the matrix changed.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Set matrix to zero.
Sets every element of calling square complex matrix to be equal to zero and returns reference to the matrix changed. This function is faster than, for example, set(TR) with zero parameter passed.
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Randomizer (real part)
Fills real part of calling complex matrix with pseudo-random numbers distributed between dFrom
and dTo
. It returns reference to the matrix changed.
[in] | dFrom | First limit. |
[in] | dTo | Second limit. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.
|
inline |
Randomizer (imaginary part)
Fills imaginary part of calling complex matrix with pseudo-random numbers distributed between dFrom
and dTo
. It returns reference to the matrix changed.
[in] | dFrom | First limit. |
[in] | dTo | Second limit. |
Reimplemented from basic_cmatrix< TR, TC >.
Reimplemented in basic_schmatrix< TR, TC >, and basic_scbmatrix< TR, TC >.