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.
 All Classes Files Functions Variables Typedefs Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
basic_scbmatrix< TR, TC > Class Template Reference

End-user class encapsulating band square matrix of complex numbers. More...

#include <cvm.h>

Inheritance diagram for basic_scbmatrix< TR, TC >:
Inheritance graph
[legend]
Collaboration diagram for basic_scbmatrix< TR, TC >:
Collaboration graph
[legend]

Public Member Functions

 basic_scbmatrix ()
 Default constructor.
 basic_scbmatrix (tint nDim)
 Diagonal band matrix constructor.
 basic_scbmatrix (tint nDim, tint nKL, tint nKU)
 Band matrix constructor.
 basic_scbmatrix (TC *pd, tint nDim, tint nKL, tint nKU)
 Constructor.
 basic_scbmatrix (const TC *pd, tint nDim, tint nKL, tint nKU)
 Constructor.
 basic_scbmatrix (const basic_scbmatrix &m)
 Copy constructor.
 basic_scbmatrix (basic_scbmatrix &&m) noexcept
 Move constructor.
 basic_scbmatrix (const BaseCMatrix &m, tint nKL, tint nKU)
 Constructor.
 basic_scbmatrix (const CVector &v)
 Constructor.
 basic_scbmatrix (const basic_srbmatrix< TR > &m, bool bRealPart=true)
 Constructor.
 basic_scbmatrix (const basic_srbmatrix< TR > &mRe, const basic_srbmatrix< TR > &mIm)
 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)
const CVector operator() (tint nCol) const throw (cvmexception)
 Column as not l-value.
const CVector operator[] (tint nRow) const throw (cvmexception)
 Row as not l-value.
const basic_srbmatrix< TR > real () const
 Real part (not l-value)
const basic_srbmatrix< TR > imag () const
 Imaginary part (not l-value)
basic_scbmatrixoperator= (const basic_scbmatrix &m) throw (cvmexception)
 Assignment operator.
basic_scbmatrixoperator= (basic_scbmatrix &&m) throw (cvmexception)
 Move assignment operator.
basic_scbmatrixassign (const CVector &v) throw (cvmexception)
 Vector (as array) assignment.
basic_scbmatrixassign (const TC *pd)
 External array assignment.
basic_scbmatrixset (TC c)
 Sets all elements to one value.
basic_scbmatrixassign_real (const basic_srbmatrix< TR > &mRe) throw (cvmexception)
 Assignment to real parts.
basic_scbmatrixassign_imag (const basic_srbmatrix< TR > &mIm) throw (cvmexception)
 Assignment to imaginary parts.
basic_scbmatrixset_real (TR d)
 Sets all real parts to one value.
basic_scbmatrixset_imag (TR d)
 Sets all imaginary parts to one value.
basic_scbmatrixresize (tint nNewDim) throw (cvmexception)
 Changes dimension.
basic_scbmatrixresize_lu (tint nNewKL, tint nNewKU) throw (cvmexception)
 Changes number of sub- and super-diagonals.
bool operator== (const basic_scbmatrix &m) const
 Band matrix comparison.
bool operator!= (const basic_scbmatrix &m) const
 Band matrix comparison.
basic_scbmatrixoperator<< (const basic_scbmatrix &m) throw (cvmexception)
 Matrix replacement.
basic_scbmatrix operator+ (const basic_scbmatrix &m) const throw (cvmexception)
 Addition operator.
basic_scbmatrix operator- (const basic_scbmatrix &m) const throw (cvmexception)
 Subtraction operator.
basic_scbmatrixsum (const basic_scbmatrix &m1, const basic_scbmatrix &m2) throw (cvmexception)
 Sum of matrices.
basic_scbmatrixdiff (const basic_scbmatrix &m1, const basic_scbmatrix &m2) throw (cvmexception)
 Difference of matrices.
basic_scbmatrixoperator+= (const basic_scbmatrix &m) throw (cvmexception)
 Increment operator.
basic_scbmatrixoperator-= (const basic_scbmatrix &m) throw (cvmexception)
 Decrement operator.
basic_scbmatrix operator- () const
 Unary minus operator.
basic_scbmatrixoperator++ ()
 Plus identity, prefix.
basic_scbmatrix operator++ (int)
 Plus identity, postfix.
basic_scbmatrixoperator-- ()
 Minus identity, prefix.
basic_scbmatrix operator-- (int)
 Minus identity, postfix.
basic_scbmatrix operator* (TR dMult) const
 Multiply by real number operator.
basic_scbmatrix operator/ (TR dDiv) const throw (cvmexception)
 Divide by real number operator.
basic_scbmatrix operator* (TC cMult) const
 Multiply by complex number operator.
basic_scbmatrix operator/ (TC cDiv) const throw (cvmexception)
 Divide by complex number operator.
basic_scbmatrixoperator*= (TR dMult)
 Multiply by real number and assign.
basic_scbmatrixoperator/= (TR dDiv)
 Divide by real number and assign.
basic_scbmatrixoperator*= (TC cMult)
 Multiply by complex number and assign.
basic_scbmatrixoperator/= (TC cDiv) throw (cvmexception)
 Divide by complex number and assign.
basic_scbmatrixnormalize ()
 Matrix normalizer.
basic_scbmatrix operator! () const throw (cvmexception)
 Matrix transposition.
basic_scbmatrix operator~ () const throw (cvmexception)
 Matrix conjugation.
basic_scbmatrixtranspose (const basic_scbmatrix &m) throw (cvmexception)
 Matrix transposition.
basic_scbmatrixconj (const basic_scbmatrix &m) throw (cvmexception)
 Matrix hermitian conjugation.
basic_scbmatrixtranspose () throw (cvmexception)
 Matrix transposition (in-place)
basic_scbmatrixconj () 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.
BaseSCMatrix operator* (const BaseSCMatrix &m) const throw (cvmexception)
 Matrix-matrix product.
basic_scbmatrix operator* (const basic_scbmatrix &m) const throw (cvmexception)
 Matrix-matrix product.
CVector operator/ (const CVector &v) const throw (cvmexception)
 Linear solver operator.
basic_scbmatrixlow_up (const basic_scbmatrix &m, tint *nPivots) throw (cvmexception)
 Low-up (LU) factorization.
basic_scbmatrix low_up (tint *nPivots) const throw (cvmexception)
 Low-up (LU) factorization.
basic_scbmatrixidentity ()
 Identity matrix.
basic_scbmatrixvanish ()
 Set matrix to zero.
basic_scbmatrixrandomize_real (TR dFrom, TR dTo)
 Randomizer (real part)
basic_scbmatrixrandomize_imag (TR dFrom, TR dTo)
 Randomizer (imaginary part)
TR norm () const override
 Euclidean norm.
TR norm1 () const override
 1-norm
TR norminf () const override
 Infinity norm.
basic_scbmatrixmult (const BaseCMatrix &m1, const BaseCMatrix &m2) throw (cvmexception)
- Public Member Functions inherited from basic_scmatrix< TR, TC >
 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.
CVector operator() (tint nCol) throw (cvmexception)
 Column as l-value.
CVector operator[] (tint nRow) throw (cvmexception)
 Row as l-value.
basic_scmatrixoperator= (const basic_scmatrix &m) throw (cvmexception)
 Assignment operator.
basic_scmatrixoperator= (basic_scmatrix &&m) throw (cvmexception)
 Move assignment operator.
basic_scmatrixassign (tint nRow, tint nCol, const BaseCMatrix &m) throw (cvmexception)
 Assignment to submatrix.
basic_scmatrixassign_real (const basic_srmatrix< TR > &mRe) throw (cvmexception)
 Assignment to real parts.
basic_scmatrixassign_imag (const basic_srmatrix< TR > &mIm) throw (cvmexception)
 Assignment to imaginary parts.
basic_scmatrixoperator<< (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_scmatrixsum (const basic_scmatrix &m1, const basic_scmatrix &m2) throw (cvmexception)
 Sum of matrices.
basic_scmatrixdiff (const basic_scmatrix &m1, const basic_scmatrix &m2) throw (cvmexception)
 Difference of matrices.
basic_scmatrixoperator+= (const basic_scmatrix &m) throw (cvmexception)
 Increment operator.
basic_scmatrixoperator-= (const basic_scmatrix &m) throw (cvmexception)
 Decrement operator.
basic_scmatrixtranspose (const basic_scmatrix &m) throw (cvmexception)
 Matrix transposition.
basic_scmatrixconj (const basic_scmatrix &m) throw (cvmexception)
 Matrix conjugation.
basic_scmatrix operator* (const basic_scmatrix &m) const throw (cvmexception)
 Matrix-matrix product.
basic_scmatrixoperator*= (const basic_scmatrix &m) throw (cvmexception)
 Matrix-matrix product with assignment.
basic_scmatrixswap_rows (tint n1, tint n2) throw (cvmexception)
 Rows swap.
basic_scmatrixswap_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 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_scmatrixlow_up (const basic_scmatrix &m, tint *nPivots) throw (cvmexception)
 Low-up (LU) factorization.
TR cond () const throw (cvmexception)
 Condition number reciprocal.
basic_scmatrixinv (const basic_scmatrix &m) throw (cvmexception)
 Matrix inversion.
basic_scmatrix inv () const throw (cvmexception)
 Matrix inversion.
basic_scmatrixexp (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_scmatrixpolynom (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_scmatrixcholesky (const basic_schmatrix< TR, TC > &m) throw (cvmexception)
 Cholesky factorization.
basic_scmatrixbunch_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.
- 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_cmatrixoperator= (const basic_cmatrix &m) throw (cvmexception)
 Assignment operator.
basic_cmatrixoperator= (basic_cmatrix &&m) throw (cvmexception)
 Move assignment operator.
basic_cmatrixassign (tint nRow, tint nCol, const basic_cmatrix &m) throw (cvmexception)
 Assignment to submatrix.
basic_cmatrixassign_real (const basic_rmatrix< TR > &mRe) throw (cvmexception)
 Assignment to real parts.
basic_cmatrixassign_imag (const basic_rmatrix< TR > &mIm) throw (cvmexception)
 Assignment to imaginary parts.
basic_cmatrixresize (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_cmatrixoperator<< (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_cmatrixsum (const basic_cmatrix &m1, const basic_cmatrix &m2) throw (cvmexception)
 Sum of matrices.
basic_cmatrixdiff (const basic_cmatrix &m1, const basic_cmatrix &m2) throw (cvmexception)
 Difference of matrices.
basic_cmatrixoperator+= (const basic_cmatrix &m) throw (cvmexception)
 Increment operator.
basic_cmatrixoperator-= (const basic_cmatrix &m) throw (cvmexception)
 Decrement operator.
basic_cmatrixtranspose (const basic_cmatrix &m) throw (cvmexception)
 Matrix transposition.
basic_cmatrixconj (const basic_cmatrix &m) throw (cvmexception)
 Matrix conjugation.
basic_cmatrix operator* (const basic_cmatrix &m) const throw (cvmexception)
 Matrix-matrix product.
basic_cmatrixmult (const basic_cmatrix &m1, const basic_cmatrix &m2) throw (cvmexception)
 Matrix-matrix product.
basic_cmatrixrank1update_u (const CVector &vCol, const CVector &vRow) throw (cvmexception)
 Rank-1 update (unconjugated)
basic_cmatrixrank1update_c (const CVector &vCol, const CVector &vRow) throw (cvmexception)
 Rank-1 update (conjugated)
basic_cmatrixsolve (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB, TR &dErr) throw (cvmexception)
 Linear solver.
basic_cmatrixsolve_tran (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB, TR &dErr) throw (cvmexception)
 Linear solver (transposed)
basic_cmatrixsolve_conj (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB, TR &dErr) throw (cvmexception)
 Linear solver (conjugated)
basic_cmatrixsolve (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB) throw (cvmexception)
 Linear solver.
basic_cmatrixsolve_tran (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB) throw (cvmexception)
 Linear solver (transposed)
basic_cmatrixsolve_conj (const basic_scmatrix< TR, TC > &mA, const basic_cmatrix &mB) throw (cvmexception)
 Linear solver (conjugated)
basic_cmatrixsolve_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_cmatrixsolve_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_cmatrixpinv (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_cmatrixgels (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_cmatrixgelsy (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_cmatrixgelss (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_cmatrixgelsd (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_cmatrixgeru (TC alpha, const CVector &vCol, const CVector &vRow) throw (cvmexception)
 Rank-1 update matrix-vector operation (unconjugated)
basic_cmatrixgerc (TC alpha, const CVector &vCol, const CVector &vRow) throw (cvmexception)
 Rank-1 update matrix-vector operation (conjugated)
basic_cmatrixgemm (const basic_cmatrix &m1, bool bConj1, const basic_cmatrix &m2, bool bConj2, TC cAlpha, TC cBeta) throw (cvmexception)
 Generic matrix-matrix operation.
basic_cmatrixhemm (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.
- 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_arrayoperator= (const basic_array &a) throw (cvmexception)
 Assignment operator.
basic_arrayoperator= (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.
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
- Public Member Functions inherited from BandMatrix< TR, TC >
tint lsize () const
 Number of lower sub-diagonals.
tint usize () const
 Number of upper super-diagonals.

Protected Attributes

BaseSCMatrix mSM
 Temporary storage for square matrix enclosing band one (if needed)
- Protected Attributes inherited from BandMatrix< TR, TC >
tint mkl
 Number of sub-diagonals.
tint mku
 Number of super-diagonals.

Additional Inherited Members

- Public Types inherited from basic_array< TR, TC >
typedef TC value_type
 STL-specific value type definition.
typedef value_typepointer
 STL-specific value pointer definition.
typedef value_typeiterator
 STL-specific iterator definition.
typedef const value_typeconst_iterator
 STL-specific const iterator definition.
typedef const value_typeconst_pointer
 STL-specific const pointer definition.
typedef value_typereference
 STL-specific reference definition.
typedef const value_typeconst_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.
Matrixoperator= (Matrix &&m) throw (cvmexception)
 Move assignment operator.
- Protected Member Functions inherited from SqMatrix< TR, TC >
 SqMatrix ()
 internal constructor
virtual ~SqMatrix ()
- Protected Member Functions inherited from BandMatrix< TR, TC >
 BandMatrix ()
 internal protected constructor
 BandMatrix (tint nKL, tint nKU)
 internal protected constructor
virtual ~BandMatrix ()
 Destructor.

Detailed Description

template<typename TR, typename TC>
class basic_scbmatrix< TR, TC >

End-user class encapsulating band square matrix of complex numbers.

TR type stands for treal. Please use predefined scbmatrix class in your applications. Band storage can be described as follows (cited from MKL manual): an $m$ by $n$ band matrix with $k_l$ sub-diagonals and $k_u$ super-diagonals is stored compactly in a two-dimensional array with $k_l+k_u+1$ rows and $n$ columns. Columns of the matrix are stored in the corresponding columns of the array, and diagonals of the matrix are stored in rows of the array}. This way of storage can be illustrated as follows (referenced elements are shown as $*$, not referenced as $-$, zeros are not stored):

\[\begin{aligned} m=n=3, k_l=0, k_u=0&:\ \begin{bmatrix} * & 0 & 0 \\ 0 & * & 0 \\ 0 & 0 & * \end{bmatrix}\\ m=n=4, k_l=1, k_u=0&:\ \begin{bmatrix} * & 0 & 0 & 0 \\ * & * & 0 & 0 \\ 0 & * & * & 0 \\ 0 & 0 & * & * \\ & & & - \end{bmatrix}\\ m=n=6, k_l=1, k_u=2&:\ \begin{bmatrix} - & & & & & \\ - & - & & & & \\ * & * & * & 0 & 0 & 0 \\ * & * & * & * & 0 & 0 \\ 0 & * & * & * & * & 0 \\ 0 & 0 & * & * & * & * \\ 0 & 0 & 0 & * & * & * \\ 0 & 0 & 0 & 0 & * & * \\ & & & & & - \end{bmatrix} \end{aligned}\]

CVM library implements square band matrices only, therefore $m=n$ is satisfied for them.

See Also
BandMatrix

Definition at line 30110 of file cvm.h.

Constructor & Destructor Documentation

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( )
inline

Default constructor.

Creates empty square band matrix. No memory gets allocated.

Example:
using namespace cvm;
std::cout << m.msize() << " " << m.nsize() << " " << m.size() ;
std::cout << " " << m.lsize() << " " << m.usize() << std::endl;
m.resize(3).resize_lu(1,0).set(std::complex<double>(1.,2.));
std::cout << m;
prints
0 0 0 0 0
(1,2) (0,0) (0,0)
(1,2) (1,2) (0,0)
(0,0) (1,2) (1,2)

Definition at line 30144 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( tint  nDim)
inlineexplicit

Diagonal band matrix constructor.

Creates $n\times n$ scbmatrix object where dimension $n$ is passed in nDim parameter. The matrix created is diagonal, i.e. $k_l=k_u=0$. Constructor throws cvmexception in case of non-positive size passed or memory allocation failure.

Example:
using namespace cvm;
scbmatrix m(4);
std::cout << m.msize() << " " << m.nsize() << " " << m.size() ;
std::cout << " " << m.lsize() << " " << m.usize() << std::endl;
m.set(std::complex<double>(1.,2.));
std::cout << m;
prints
4 4 4 0 0
(1,2) (0,0) (0,0) (0,0)
(0,0) (1,2) (0,0) (0,0)
(0,0) (0,0) (1,2) (0,0)
(0,0) (0,0) (0,0) (1,2)
Parameters
[in]nDimNumber of rows and columns.

Definition at line 30174 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( tint  nDim,
tint  nKL,
tint  nKU 
)
inline

Band matrix constructor.

Creates scbmatrix object of dimension passed in nDim parameter. The matrix created has nKL sub-diagonals and nKU super-diagonals. Constructor throws cvmexception in case of non-positive size or negative number of sub-diagonals or super-diagonals passed or in case of memory allocation failure. Example:

using namespace cvm;
scbmatrix m(4,1,1);
m.set(std::complex<double>(1.,2.));
std::cout << m << std::endl
<< m.msize() << " " << m.nsize() << " " << m.size()
<< " " << m.lsize() << " " << m.usize() << std::endl;

prints

(1,2) (1,2) (0,0) (0,0)
(1,2) (1,2) (1,2) (0,0)
(0,0) (1,2) (1,2) (1,2)
(0,0) (0,0) (1,2) (1,2)
4 4 12 1 1
Parameters
[in]nDimNumber of rows and columns.
[in]nKLNumber of lower sub-diagonals.
[in]nKUNumber of upper super-diagonals.

Definition at line 30209 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( TC *  pd,
tint  nDim,
tint  nKL,
tint  nKU 
)
inline

Constructor.

Creates $n\times n$ scbmatrix object where $n$ is passed in nDim parameter. The matrix created has nKL sub-diagonals and nKU super-diagonals. Constructor throws cvmexception in case of non-positive size or negative number of sub-diagonals or super-diagonals passed or in case of memory allocation failure. 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).

Example:
using namespace cvm;
double a[] = {1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1.};
scbmatrix ml ((std::complex<double>*)a,4,1,0);
scbmatrix mu ((std::complex<double>*)a,4,0,1);
ml(2,1) = std::complex<double>(5.,5.);
std::cout << ml << std::endl << mu << std::endl;
std::cout << a[0] << " " << a[1] << " " << a[2] << " "
<< a[3] << " " << a[4] << " " << a[5] << " " << std::endl;
prints
(1,1) (0,0) (0,0) (0,0)
(5,5) (1,1) (0,0) (0,0)
(0,0) (1,1) (1,1) (0,0)
(0,0) (0,0) (1,1) (1,1)
(5,5) (1,1) (0,0) (0,0)
(0,0) (1,1) (1,1) (0,0)
(0,0) (0,0) (1,1) (1,1)
(0,0) (0,0) (0,0) (1,1)
1 1 5 5 1 1
See Also
http://cvmlib.com/faq.htm
basic_cmatrix::basic_cmatrix(TC*,tint,tint)
Parameters
[in]pdPointer to array to share memory with.
[in]nDimNumber of rows and columns.
[in]nKLNumber of lower sub-diagonals.
[in]nKUNumber of upper super-diagonals.

Definition at line 30259 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( const TC *  pd,
tint  nDim,
tint  nKL,
tint  nKU 
)
inline

Constructor.

Creates $n\times n$ scbmatrix object where $n$ is passed in nDim parameter. The matrix created has nKL sub-diagonals and nKU super-diagonals. Constructor throws cvmexception in case of non-positive size or negative number of sub-diagonals or super-diagonals passed or in case of memory allocation failure. Then constructor copies $(k_l + k_u + 1)*n$ elements of array pd to the matrix according to band storage.

Example:
using namespace cvm;
const double a[] = {1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1.};
scbmatrix ml ((const std::complex<double>*)a,4,1,0);
scbmatrix mu ((const std::complex<double>*)a,4,0,1);
ml(2,1) = std::complex<double>(5.,5.);
std::cout << ml << std::endl << mu << std::endl;
std::cout << a[0] << " " << a[1] << " " << a[2] << " "
<< a[3] << " " << a[4] << " " << a[5] << " " << std::endl;
prints
(1,1) (0,0) (0,0) (0,0)
(5,5) (1,1) (0,0) (0,0)
(0,0) (1,1) (1,1) (0,0)
(0,0) (0,0) (1,1) (1,1)
(1,1) (1,1) (0,0) (0,0)
(0,0) (1,1) (1,1) (0,0)
(0,0) (0,0) (1,1) (1,1)
(0,0) (0,0) (0,0) (1,1)
1 1 1 1 1 1
See Also
http://cvmlib.com/faq.htm
basic_cmatrix::basic_cmatrix(TC*,tint,tint)
Parameters
[in]pdPointer to array to share memory with.
[in]nDimNumber of rows and columns.
[in]nKLNumber of lower sub-diagonals.
[in]nKUNumber of upper super-diagonals.

Definition at line 30309 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( const basic_scbmatrix< TR, TC > &  m)
inline

Copy constructor.

Creates scbmatrix object as a copy of band matrix m. It throws cvmexception in case of memory allocation failure.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16.};
scbmatrix m ((std::complex<double>*)a,4,1,0);
scbmatrix mc(m);
m(1,1) = 7.77;
std::cout << m << std::endl << mc;
prints
(7.77,0) (0,0) (0,0) (0,0)
(3,4) (5,6) (0,0) (0,0)
(0,0) (7,8) (9,10) (0,0)
(0,0) (0,0) (11,12) (13,14)
(1,2) (0,0) (0,0) (0,0)
(3,4) (5,6) (0,0) (0,0)
(0,0) (7,8) (9,10) (0,0)
(0,0) (0,0) (11,12) (13,14)
Parameters
[in]mscbmatrix to copy from.

Definition at line 30345 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( basic_scbmatrix< TR, TC > &&  m)
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:

rvector a(b + c);

or this

rvector a = b + c;

Here temporary result of calling b.operator+(c) will not be destroyed but rather moved to newly created object a.

Parameters
[in]mrvalue reference to other matrix.

Definition at line 30369 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( const BaseCMatrix m,
tint  nKL,
tint  nKU 
)
inline

Constructor.

Creates scbmatrix object as a copy of sliced matrix m, i.e. it copies main diagonal, nKL sub-diagonals and nKU super-diagonals of matrix m. It's assumed that $m\times n$ matrix m must have equal sizes, i.e. $m = n$ is satisfied. Constructor throws cvmexception if this is not true or in case of memory allocation failure.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*)a,3);
scbmatrix mb(m,1,0);
std::cout << m << std::endl << mb;
prints
(1,2) (7,8) (13,14)
(3,4) (9,10) (15,16)
(5,6) (11,12) (17,18)
(1,2) (0,0) (0,0)
(3,4) (9,10) (0,0)
(0,0) (11,12) (17,18)
Parameters
[in]mcmatrix to copy diagonal and subdiagonals from.
[in]nKLNumber of lower sub-diagonals.
[in]nKUNumber of upper super-diagonals.

Definition at line 30406 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( const CVector v)
inlineexplicit

Constructor.

Creates scbmatrix 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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6.};
cvector v((std::complex<double>*)a,3);
scbmatrix m(v);
std::cout << m;
prints
(1,2) (0,0) (0,0)
(0,0) (3,4) (0,0)
(0,0) (0,0) (5,6)
Parameters
[in]vcvector to copy main diagonal from.

Definition at line 30437 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( const basic_srbmatrix< TR > &  m,
bool  bRealPart = true 
)
inlineexplicit

Constructor.

Creates scbmatrix object with dimensions of passed real band matrix m and copies matrix m to real part if bRealPart is true or to imaginary part otherwise. Constructor throws cvmexception in case of memory allocation failure.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8.};
const srbmatrix m(a,4,1,0);
scbmatrix mr(m), mi(m, false);
std::cout << mr << std::endl << mi;
prints
(1,0) (0,0) (0,0) (0,0)
(2,0) (3,0) (0,0) (0,0)
(0,0) (4,0) (5,0) (0,0)
(0,0) (0,0) (6,0) (7,0)
(0,1) (0,0) (0,0) (0,0)
(0,2) (0,3) (0,0) (0,0)
(0,0) (0,4) (0,5) (0,0)
(0,0) (0,0) (0,6) (0,7)
Parameters
[in]msrbmatrix to copy elements from.
[in]bRealParttrue to copy m to real part, false to copy to imaginary part.

Definition at line 30473 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
basic_scbmatrix< TR, TC >::basic_scbmatrix ( const basic_srbmatrix< TR > &  mRe,
const basic_srbmatrix< TR > &  mIm 
)
inline

Constructor.

Creates scbmatrix object with dimensions of passed real band matrices mRe (if one of these dimensions differs from appropriate size of matrix mIm 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.

Example:
using namespace cvm;
srbmatrix mr(4,1,0), mi(4,1,0);
mr.set(1.);
mi.set(2.);
const scbmatrix m(mr,mi);
std::cout << m;
prints
(1,2) (0,0) (0,0) (0,0)
(1,2) (1,2) (0,0) (0,0)
(0,0) (1,2) (1,2) (0,0)
(0,0) (0,0) (1,2) (1,2)
Parameters
[in]mResrbmatrix to copy to real part.
[in]mImsrbmatrix to copy to imaginary part.

Definition at line 30513 of file cvm.h.

Here is the call graph for this function:

Member Function Documentation

template<typename TR, typename TC>
type_proxy<TC, TR> basic_scbmatrix< TR, TC >::operator() ( tint  nRow,
tint  nCol 
) throw (cvmexception)
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.

Example:
using namespace cvm;
try {
double a[] = {1., 2., 3., 4., 5., 6.,
7., 8., 9., 10., 11., 12.};
const cmatrix m ((std::complex<double>*) a, 2, 3);
scmatrix ms(2);
std::cout << m(1,1) << " "
<< m(2,3) << std::endl << std::endl;
ms(2,2) = std::complex<double>(7.77,7.77);
std::cout << ms;
}
catch (std::exception& e) {
std::cout << "Exception " << e.what () << std::endl;
}
prints
(1,2) (11,12)
(0,0) (0,0)
(0,0) (7.77,7.77)
See Also
http://cvmlib.com/faq.htm
Parameters
[in]nRowRow index (CVM0 based).
[in]nColColumn index (CVM0 based).
Returns
type_proxy Proxy to element (l-value).

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30525 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
TC basic_scbmatrix< TR, TC >::operator() ( tint  nRow,
tint  nCol 
) const throw (cvmexception)
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.

Example:
using namespace cvm;
try {
double a[] = {1., 2., 3., 4., 5., 6.,
7., 8., 9., 10., 11., 12.};
const cmatrix m ((std::complex<double>*) a, 2, 3);
std::cout << m(1,1) << " " << m(2,3) << std::endl;
}
catch (std::exception& e) {
std::cout << "Exception " << e.what () << std::endl;
}
prints
(1,2) (11,12)
See Also
http://cvmlib.com/faq.htm
Parameters
[in]nRowRow index (CVM0 based).
[in]nColColumn index (CVM0 based).
Returns
TC tcomplex value.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30532 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
const CVector basic_scbmatrix< TR, TC >::operator() ( tint  nCol) const throw (cvmexception)
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.

Example:
using namespace cvm;
try {
double a[] = {1., 2., 3., 4., 5., 6.,
7., 8., 9., 10., 11., 12.};
const cmatrix m ((std::complex<double>*) a, 2, 3);
std::cout << m(2) << std::endl;
}
catch (std::exception& e) {
std::cout << "Exception " << e.what () << std::endl;
}
prints
(5,6) (7,8)
Parameters
[in]nColIndex of column (CVM0 based).
Returns
cvector Column value.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30540 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
const CVector basic_scbmatrix< TR, TC >::operator[] ( tint  nRow) const throw (cvmexception)
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.

Example:
using namespace cvm;
std::cout.setf (std::ios::scientific | std::ios::left);
std::cout.precision (2);
try {
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.};
const srmatrix m (a, 3);
std::cout << m[2] << std::endl;
}
catch (std::exception& e) {
std::cout << "Exception " << e.what () << std::endl;
}
prints
2.00e+00 5.00e+00 8.00e+00
Parameters
[in]nRowIndex of row (CVM0 based).
Returns
cvector Row value.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30547 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
const basic_srbmatrix<TR> basic_scbmatrix< TR, TC >::real ( ) const
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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6.,
7., 8., 9., 10., 11., 12.};
cmatrix m((std::complex<double>*) a, 2, 3);
std::cout << m << std::endl << m.real();
prints
(1,2) (5,6) (9,10)
(3,4) (7,8) (11,12)
1 5 9
3 7 11
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30554 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
const basic_srbmatrix<TR> basic_scbmatrix< TR, TC >::imag ( ) const
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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6.,
7., 8., 9., 10., 11., 12.};
cmatrix m((std::complex<double>*) a, 2, 3);
std::cout << m << std::endl << m.imag();
prints
(1,2) (5,6) (9,10)
(3,4) (7,8) (11,12)
2 6 10
4 8 12
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30562 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator= ( const basic_scbmatrix< TR, TC > &  m) throw (cvmexception)
inline

Assignment operator.

Sets every element of calling scbmatrix to be equal to appropriate element of matrix m and returns reference to the matrix changed. Operator throws cvmexception in case of different matrix dimensions.

Example:
using namespace cvm;
std::cout.setf (std::ios::scientific | std::ios::left);
std::cout.precision (2);
try {
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.};
scbmatrix m1((std::complex<double>*)a,3,1,0);
scbmatrix m2(3,1,0);
m2 = m1;
std::cout << m2;
}
catch (std::exception& e) {
std::cout << "Exception: " << e.what () << std::endl;
}
prints
(1.00e+00,2.00e+00) (0.00e+00,0.00e+00) (0.00e+00,0.00e+00)
(3.00e+00,4.00e+00) (5.00e+00,6.00e+00) (0.00e+00,0.00e+00)
(0.00e+00,0.00e+00) (7.00e+00,8.00e+00) (9.00e+00,1.00e+01)
Parameters
[in]mscbmatrix to assign from.
Returns
Reference to changed calling matrix.

Definition at line 30601 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator= ( basic_scbmatrix< TR, TC > &&  m) throw (cvmexception)
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:

a = b + c;

Here temporary result of calling b.operator+(c) will not be destroyed but rather moved to calling object a.

Parameters
[in]mrvalue reference to other matrix.

Definition at line 30621 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::assign ( const CVector v) throw (cvmexception)
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.

Example:
using namespace cvm;
const double a[] = {1., 2., 3., 4., 5., 6.,
7., 8., 9., 10., 11., 12.};
const cvector v((const std::complex<double>*) a,6);
cmatrix m(2, 3);
m.assign (v);
std::cout << m;
prints
(1,2) (5,6) (9,10)
(3,4) (7,8) (11,12)
Parameters
[in]vcvector to assign.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30629 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::assign ( const TC *  pd)
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.

Example:
using namespace cvm;
const double a[] = {1., 2., 3., 4., 5., 6.,
7., 8., 9., 10., 11., 12.};
cmatrix m(2, 3);
m.assign ((const std::complex<double>*) a);
std::cout << m;
prints
1.00e+000 3.00e+000 5.00e+000
2.00e+000 4.00e+000 6.00e+000
Parameters
[in]pdConst pointer to external array.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30637 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::set ( TC  c)
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.

Example:
using namespace cvm;
cmatrix m(3, 4);
m.set(std::complex<double>(3.,4.));
std::cout << m;
prints
(3,4) (3,4) (3,4) (3,4)
(3,4) (3,4) (3,4) (3,4)
(3,4) (3,4) (3,4) (3,4)
Parameters
[in]cValue to set to.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30643 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::assign_real ( const basic_srbmatrix< TR > &  mRe) throw (cvmexception)
inline

Assignment to real parts.

Sets real part of every element of calling complex band matrix to value of appropriate element of srbmatrix mRe and returns reference to the matrix changed. Function throws cvmexception in case of different sizes of the operands.

Example:
using namespace cvm;
std::cout.setf (std::ios::scientific | std::ios::left);
std::cout.precision (2);
srbmatrix m (3,0,1);
scbmatrix mc(3,0,1);
m.randomize (0., 1.);
mc.assign_real(m);
std::cout << mc;
prints
(5.44e-01,0.00e+00) (5.48e-02,0.00e+00) (0.00e+00,0.00e+00)
(0.00e+00,0.00e+00) (3.66e-01,0.00e+00) (3.49e-01,0.00e+00)
(0.00e+00,0.00e+00) (0.00e+00,0.00e+00) (8.00e-01,0.00e+00)
Parameters
[in]mResrbmatrix to assign to real part.
Returns
Reference to changed calling matrix.

Definition at line 30675 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::assign_imag ( const basic_srbmatrix< TR > &  mIm) throw (cvmexception)
inline

Assignment to imaginary parts.

Sets imaginary part of every element of calling complex band matrix to value of appropriate element of srbmatrix mIm and returns reference to the matrix changed. Function throws cvmexception in case of different sizes of the operands.

Example:
using namespace cvm;
std::cout.setf (std::ios::scientific | std::ios::left);
std::cout.precision (2);
srbmatrix m (3,0,1);
scbmatrix mc(3,0,1);
m.randomize (0., 1.);
mc.assign_imag(m);
std::cout << mc;
prints
(0.00e+00,5.53e-01) (0.00e+00,2.16e-01) (0.00e+00,0.00e+00)
(0.00e+00,0.00e+00) (0.00e+00,1.57e-01) (0.00e+00,1.12e-01)
(0.00e+00,0.00e+00) (0.00e+00,0.00e+00) (0.00e+00,7.03e-01)
Parameters
[in]mImsrbmatrix to assign to imaginary part.
Returns
Reference to changed calling matrix.

Definition at line 30710 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::set_real ( TR  d)
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.

Example:
using namespace cvm;
cmatrix m(2,3);
m.set_real(1.);
std::cout << m;
prints
(1,0) (1,0) (1,0)
(1,0) (1,0) (1,0)
Parameters
[in]dValue to set to.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30720 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::set_imag ( TR  d)
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.

Example:
using namespace cvm;
cmatrix m(2,3);
m.set_imag(1.);
std::cout << m;
prints
(0,1) (0,1) (0,1)
(0,1) (0,1) (0,1)
Parameters
[in]dValue to set to.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30727 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::resize ( tint  nNewDim) throw (cvmexception)
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.

Example:
using namespace cvm;
try {
double a[] = {1., 2., 3., 4., 5., 6., 7., 8.};
scmatrix m((std::complex<double>*) a, 2);
std::cout << m << std::endl;
m.resize (3);
std::cout << m;
}
catch (std::exception& e) {
std::cout << "Exception " << e.what () << std::endl;
}
prints
(1,2) (5,6)
(3,4) (7,8)
(1,2) (5,6) (0,0)
(3,4) (7,8) (0,0)
(0,0) (0,0) (0,0)
Parameters
[in]nNewDimNew dimension.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 30733 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::resize_lu ( tint  nNewKL,
tint  nNewKU 
) throw (cvmexception)
inline

Changes number of sub- and super-diagonals.

Changes number of sub- and super-diagonals of calling complex band matrix to nNewKL and nNewKU respectively and returns reference to the matrix changed. In case of increasing of the numbers, calling matrix is filled up with zeroes. Function throws cvmexception in case of negative number passed or memory allocation failure.

Example:
using namespace cvm;
try {
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.};
scbmatrix m((std::complex<double>*)a,3,1,0);
std::cout << m << std::endl;
m.resize_lu (0,1);
m.diag(1).set(std::complex<double>(9.,9.));
std::cout << m;
}
catch (std::exception& e) {
std::cout << "Exception: " << e.what () << std::endl;
}
prints
(1,2) (0,0) (0,0)
(3,4) (5,6) (0,0)
(0,0) (7,8) (9,10)
(1,2) (9,9) (0,0)
(0,0) (5,6) (9,9)
(0,0) (0,0) (9,10)
Parameters
[in]nNewKLNew number of lower sub-diagonals.
[in]nNewKUNew number of upper super-diagonals.
Returns
Reference to changed calling matrix.

Definition at line 30775 of file cvm.h.

Here is the caller graph for this function:

template<typename TR, typename TC>
bool basic_scbmatrix< TR, TC >::operator== ( const basic_scbmatrix< TR, TC > &  m) const
inline

Band matrix comparison.

Operator compares calling band matrix with complex band matrix m and returns true if they have same dimensions and their appropriate elements differ by not more than cvmMachMin() (the smallest normalized positive number). Returns false otherwise.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8.};
scbmatrix m1((std::complex<double>*)a,2,1,0);
scbmatrix m2(2,1,0);
std::cout << m1 << std::endl;
m2(1,1) = std::complex<double>(1.,2.);
m2(2,1) = std::complex<double>(3.,4.);
m2(2,2) = std::complex<double>(5.,6.);
std::cout << (m1 == m2) << std::endl;
prints
(1,2) (0,0)
(3,4) (5,6)
1
See Also
operator !=()
Parameters
[in]mscbmatrix to compare to.
Returns
bool Result of comparison.

Definition at line 30816 of file cvm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename TR, typename TC>
bool basic_scbmatrix< TR, TC >::operator!= ( const basic_scbmatrix< TR, TC > &  m) const
inline

Band matrix comparison.

Operator compares calling band matrix with complex band matrix m and returns true if they have different dimensions or at least one of their appropriate elements differs by more than cvmMachMin() (the smallest normalized positive number). Returns false otherwise.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8.};
scbmatrix m1((std::complex<double>*)a,2,1,0);
scbmatrix m2(2,1,0);
std::cout << m1 << std::endl;
m2(1,1) = std::complex<double>(1.,2.);
m2(2,1) = std::complex<double>(3.,4.);
m2(2,2) = std::complex<double>(5.,6.00001);
std::cout << (m1 != m2) << std::endl;
prints
(1,2) (0,0)
(3,4) (5,6)
1
See Also
operator ==()
Parameters
[in]mscbmatrix to compare to.
Returns
bool Result of comparison.

Definition at line 30853 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator<< ( const basic_scbmatrix< TR, TC > &  m) throw (cvmexception)
inline

Matrix replacement.

Destroys calling band matrix, creates a new one as a copy of band matrix m and returns reference to the matrix changed. Operator throws cvmexception in case of memory allocation failure.

Example:
using namespace cvm;
try {
scbmatrix m(3,1,0);
scbmatrix mc(1);
m(2,1) = std::complex<double>(1.,2.);
m(2,2) = std::complex<double>(3.,4.);
std::cout << m << std::endl << mc << std::endl;
mc << m;
std::cout << mc;
}
catch (std::exception& e) {
std::cout << "Exception: " << e.what () << std::endl;
}
prints
(0,0) (0,0) (0,0)
(1,2) (3,4) (0,0)
(0,0) (0,0) (0,0)
(0,0)
(0,0) (0,0) (0,0)
(1,2) (3,4) (0,0)
(0,0) (0,0) (0,0)
See Also
operator =()
Parameters
[in]mscbmatrix to replace by.
Returns
Reference to changed calling matrix.

Definition at line 30896 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator+ ( const basic_scbmatrix< TR, TC > &  m) const throw (cvmexception)
inline

Addition operator.

Creates object of type scbmatrix as sum of calling matrix and matrix m. Operator throws cvmexception in case of different dimensions of the operands or memory allocation failure.

Example:
using namespace cvm;
try {
double a[] = {1., 2., 3., 4., 5., 6., 7., 8.,
9., 10., 11., 12.};
double b[] = {10., 20., 30., 40., 50., 60.,
70., 80., 90., 100., 110., 120.};
scbmatrix m1((std::complex<double>*)a,3,0,1);
scbmatrix m2((std::complex<double>*)b,3,0,1);
std::cout << m1 << std::endl << m2 << std::endl;
std::cout << m1 + m2 << std::endl << m1 + m1;
}
catch (std::exception& e) {
std::cout << "Exception: " << e.what () << std::endl;
}
prints
(3,4) (5,6) (0,0)
(0,0) (7,8) (9,10)
(0,0) (0,0) (11,12)
(30,40) (50,60) (0,0)
(0,0) (70,80) (90,100)
(0,0) (0,0) (110,120)
(33,44) (55,66) (0,0)
(0,0) (77,88) (99,110)
(0,0) (0,0) (121,132)
(6,8) (10,12) (0,0)
(0,0) (14,16) (18,20)
(0,0) (0,0) (22,24)
See Also
sum()
Parameters
[in]mscbmatrix to add to calling one.
Returns
Sum of matrices.

Definition at line 30954 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator- ( const basic_scbmatrix< TR, TC > &  m) const throw (cvmexception)
inline

Subtraction operator.

Creates object of type scbmatrix as difference of calling band matrix and band matrix m. It throws cvmexception in case of different dimensions of the operands or memory allocation failure.

Example:
using namespace cvm;
try {
double a[] = {1., 2., 3., 4., 5., 6., 7., 8.,
9., 10., 11., 12.};
double b[] = {10., 20., 30., 40., 50., 60.,
70., 80., 90., 100., 110., 120.};
scbmatrix m1((std::complex<double>*)a,3,0,1);
scbmatrix m2((std::complex<double>*)b,3,0,1);
std::cout << m1 << std::endl << m2 << std::endl;
std::cout << m1 - m2 << std::endl << m1 - m1;
}
catch (std::exception& e) {
std::cout << "Exception: " << e.what () << std::endl;
}
prints
(3,4) (5,6) (0,0)
(0,0) (7,8) (9,10)
(0,0) (0,0) (11,12)
(30,40) (50,60) (0,0)
(0,0) (70,80) (90,100)
(0,0) (0,0) (110,120)
(-27,-36) (-45,-54) (0,0)
(0,0) (-63,-72) (-81,-90)
(0,0) (0,0) (-99,-108)
(0,0) (0,0) (0,0)
(0,0) (0,0) (0,0)
(0,0) (0,0) (0,0)
See Also
diff()
Parameters
[in]mscbmatrix to subtract from calling one.
Returns
Difference of matrices.

Definition at line 31008 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::sum ( const basic_scbmatrix< TR, TC > &  m1,
const basic_scbmatrix< TR, TC > &  m2 
) throw (cvmexception)
inline

Sum of matrices.

Assigns sum of complex square band 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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8.,
9., 10., 11., 12.};
const scbmatrix m1((std::complex<double>*)a,3,1,0);
scbmatrix m2(3,1,0);
scbmatrix m(3,1,0);
m2.set(std::complex<double>(1.,1.));
std::cout << m1 << std::endl << m2 << std::endl;
std::cout << m.sum(m1, m2) << std::endl;
std::cout << m.sum(m, m2);
prints
(1,2) (0,0) (0,0)
(3,4) (5,6) (0,0)
(0,0) (7,8) (9,10)
(1,1) (0,0) (0,0)
(1,1) (1,1) (0,0)
(0,0) (1,1) (1,1)
(2,3) (0,0) (0,0)
(4,5) (6,7) (0,0)
(0,0) (8,9) (10,11)
(3,4) (0,0) (0,0)
(5,6) (7,8) (0,0)
(0,0) (9,10) (11,12)
See Also
operator +()
Parameters
[in]m1First scbmatrix summand.
[in]m2Second scbmatrix summand.
Returns
Reference to changed calling matrix.

Definition at line 31058 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::diff ( const basic_scbmatrix< TR, TC > &  m1,
const basic_scbmatrix< TR, TC > &  m2 
) throw (cvmexception)
inline

Difference of matrices.

Assigns difference of complex square band 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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8.,
9., 10., 11., 12.};
const scbmatrix m1((std::complex<double>*)a,3,1,0);
scbmatrix m2(3,1,0);
scbmatrix m(3,1,0);
m2.set(std::complex<double>(1.,1.));
std::cout << m1 << std::endl << m2 << std::endl;
std::cout << m.diff(m1, m2) << std::endl;
std::cout << m.diff(m, m2);
prints
(1,2) (0,0) (0,0)
(3,4) (5,6) (0,0)
(0,0) (7,8) (9,10)
(1,1) (0,0) (0,0)
(1,1) (1,1) (0,0)
(0,0) (1,1) (1,1)
(0,1) (0,0) (0,0)
(2,3) (4,5) (0,0)
(0,0) (6,7) (8,9)
(-1,0) (0,0) (0,0)
(1,2) (3,4) (0,0)
(0,0) (5,6) (7,8)
See Also
operator -()
Parameters
[in]m1First scbmatrix subtrahend.
[in]m2Second scbmatrix subtrahend.
Returns
Reference to changed calling matrix.

Definition at line 31108 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator+= ( const basic_scbmatrix< TR, TC > &  m) throw (cvmexception)
inline

Increment operator.

Adds scbmatrix m to calling matrix and returns reference to the matrix changed. It throws cvmexception in case of different sizes of the operands.

Example:
using namespace cvm;
try {
scbmatrix m1(4,0,1);
scbmatrix m2(4,0,1);
m1.set(std::complex<double>(1.,2.));
m2.set(std::complex<double>(3.,4.));
m1 += m2;
std::cout << m1 << std::endl;
// well, you can do this too, but temporary object would be created
m2 += m2;
std::cout << m2;
}
catch (std::exception& e) {
std::cout << "Exception: " << e.what () << std::endl;
}
prints
(4,6) (4,6) (0,0) (0,0)
(0,0) (4,6) (4,6) (0,0)
(0,0) (0,0) (4,6) (4,6)
(0,0) (0,0) (0,0) (4,6)
(6,8) (6,8) (0,0) (0,0)
(0,0) (6,8) (6,8) (0,0)
(0,0) (0,0) (6,8) (6,8)
(0,0) (0,0) (0,0) (6,8)
See Also
operator +()
sum()
Parameters
[in]mscbmatrix to increment by.
Returns
Reference to changed calling matrix.

Definition at line 31159 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator-= ( const basic_scbmatrix< TR, TC > &  m) throw (cvmexception)
inline

Decrement operator.

Subtracts scbmatrix m from calling matrix and returns reference to the matrix changed. It throws cvmexception in case of different sizes of the operands.

Example:
using namespace cvm;
try {
scbmatrix m1(4,0,1);
scbmatrix m2(4,0,1);
m1.set(std::complex<double>(1.,2.));
m2.set(std::complex<double>(3.,4.));
m1 -= m2;
std::cout << m1 << std::endl;
// well, you can do this too, but temporary object would be created
m2 -= m2;
std::cout << m2;
}
catch (std::exception& e) {
std::cout << "Exception: " << e.what () << std::endl;
}
prints
(-2,-2) (-2,-2) (0,0) (0,0)
(0,0) (-2,-2) (-2,-2) (0,0)
(0,0) (0,0) (-2,-2) (-2,-2)
(0,0) (0,0) (0,0) (-2,-2)
(0,0) (0,0) (0,0) (0,0)
(0,0) (0,0) (0,0) (0,0)
(0,0) (0,0) (0,0) (0,0)
(0,0) (0,0) (0,0) (0,0)
See Also
operator -()
diff()
Parameters
[in]mscbmatrix to decrement by.
Returns
Reference to changed calling matrix.

Definition at line 31209 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator- ( ) const
inline

Unary minus operator.

Creates object of type scmatrix as calling matrix multiplied by -1. It throws cvmexception in case of memory allocation failure.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8.};
scmatrix m((std::complex<double>*) a, 2);
std::cout << -m;
prints
(-1,-2) (-5,-6)
(-3,-4) (-7,-8)
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31216 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator++ ( )
inline

Plus identity, prefix.

Adds identity matrix to calling square complex matrix and returns reference to the matrix changed.

Example:
using namespace cvm;
scmatrix m(3);
m.set(std::complex<double>(1.,1.));
m++;
std::cout << m << std::endl;
std::cout << ++m;
prints
(2,1) (1,1) (1,1)
(1,1) (2,1) (1,1)
(1,1) (1,1) (2,1)
(3,1) (1,1) (1,1)
(1,1) (3,1) (1,1)
(1,1) (1,1) (3,1)
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31225 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator++ ( int  )
inline

Plus identity, postfix.

Adds identity matrix to calling square complex matrix and returns reference to the matrix changed.

Example:
using namespace cvm;
scmatrix m(3);
m.set(std::complex<double>(1.,1.));
m++;
std::cout << m << std::endl;
std::cout << ++m;
prints
(2,1) (1,1) (1,1)
(1,1) (2,1) (1,1)
(1,1) (1,1) (2,1)
(3,1) (1,1) (1,1)
(1,1) (3,1) (1,1)
(1,1) (1,1) (3,1)
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31232 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator-- ( )
inline

Minus identity, prefix.

Subtracts identity matrix from calling square complex matrix and returns reference to the matrix changed.

Example:
using namespace cvm;
scmatrix m(3);
m.set(std::complex<double>(1.,1.));
m--;
std::cout << m << std::endl;
std::cout << --m;
prints
(0,1) (1,1) (1,1)
(1,1) (0,1) (1,1)
(1,1) (1,1) (0,1)
(-1,1) (1,1) (1,1)
(1,1) (-1,1) (1,1)
(1,1) (1,1) (-1,1)
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31239 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator-- ( int  )
inline

Minus identity, postfix.

Subtracts identity matrix from calling square complex matrix and returns reference to the matrix changed.

Example:
using namespace cvm;
scmatrix m(3);
m.set(std::complex<double>(1.,1.));
m--;
std::cout << m << std::endl;
std::cout << --m;
prints
(0,1) (1,1) (1,1)
(1,1) (0,1) (1,1)
(1,1) (1,1) (0,1)
(-1,1) (1,1) (1,1)
(1,1) (-1,1) (1,1)
(1,1) (1,1) (-1,1)
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31246 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator* ( TR  dMult) const
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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
std::cout << m * 5.;
prints
(5,10) (35,40) (65,70)
(15,20) (45,50) (75,80)
(25,30) (55,60) (85,90)
See Also
operator *=()
Parameters
[in]dMultNumber to multiply by.
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31252 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator/ ( TR  dDiv) const throw (cvmexception)
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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
std::cout << m / 2.;
prints
(0.5,1) (3.5,4) (6.5,7)
(1.5,2) (4.5,5) (7.5,8)
(2.5,3) (5.5,6) (8.5,9)
See Also
operator /=()
Parameters
[in]dDivNumber to divide by.
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31259 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator* ( TC  cMult) const
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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
std::cout << m * std::complex<double>(1.,1.);
prints
(-1,3) (-1,15) (-1,27)
(-1,7) (-1,19) (-1,31)
(-1,11) (-1,23) (-1,35)
See Also
operator *=()
Parameters
[in]cMultNumber to multiply by.
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31266 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator/ ( TC  cDiv) const throw (cvmexception)
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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
std::cout << m / std::complex<double>(1.,1.);
prints
(1.5,0.5) (7.5,0.5) (13.5,0.5)
(3.5,0.5) (9.5,0.5) (15.5,0.5)
(5.5,0.5) (11.5,0.5) (17.5,0.5)
See Also
operator /=()
Parameters
[in]cDivNumber to divide by.
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31273 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator*= ( TR  dMult)
inline

Multiply by real number and assign.

Multiplies calling square complex matrix by real number dMult and returns reference to the matrix changed.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
m *= 5.;
std::cout << m;
prints
(5,10) (35,40) (65,70)
(15,20) (45,50) (75,80)
(25,30) (55,60) (85,90)
See Also
operator *(TR) const
Parameters
[in]dMultNumber to multiply by.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31280 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator/= ( TR  dDiv)
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).

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
m /= 2.;
std::cout << m;
prints
(0.5,1) (3.5,4) (6.5,7)
(1.5,2) (4.5,5) (7.5,8)
(2.5,3) (5.5,6) (8.5,9)
See Also
operator /(TR) const
Parameters
[in]dDivNumber to divide by.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31286 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator*= ( TC  cMult)
inline

Multiply by complex number and assign.

Multiplies calling square complex matrix by complex number cMult and returns reference to the matrix changed.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
m *= std::complex<double>(2.,1.);
std::cout << m;
prints
(0,5) (6,23) (12,41)
(2,11) (8,29) (14,47)
(4,17) (10,35) (16,53)
See Also
operator *(TR) const
Parameters
[in]cMultNumber to multiply by.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31292 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::operator/= ( TC  cDiv) throw (cvmexception)
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).

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
m /= std::complex<double>(2.,1.);
std::cout << m;
prints
(0.8,0.6) (4.4,1.8) (8,3)
(2,1) (5.6,2.2) (9.2,3.4)
(3.2,1.4) (6.8,2.6) (10.4,3.8)
See Also
operator /(TR) const
Parameters
[in]cDivNumber to divide by.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31298 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::normalize ( )
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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6.,
7., 8., 9., 10., 11., 12.};
cmatrix ma ((std::complex<double>*) a, 2, 3);
ma.normalize();
std::cout << ma << ma.norm() << std::endl;
prints
(0.0392232,0.0784465) (0.196116,0.235339) (0.353009,0.392232)
(0.11767,0.156893) (0.274563,0.313786) (0.431455,0.470679)
1
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31304 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator! ( ) const throw (cvmexception)
inline

Matrix transposition.

Creates object of type scmatrix as transposed calling matrix.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
scmatrix mc(3);
std::cout << m << std::endl << !m << std::endl ;
mc.transpose(m);
std::cout << mc << std::endl;
mc.transpose();
std::cout << mc;
prints
(1,2) (5,6) (9,10)
(3,4) (7,8) (11,12)
(1,2) (3,4)
(5,6) (7,8)
(9,10) (11,12)
(1,2) (3,4)
(5,6) (7,8)
(9,10) (11,12)
(1,2) (5,6) (9,10)
(3,4) (7,8) (11,12)
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31311 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator~ ( ) const throw (cvmexception)
inline

Matrix conjugation.

Creates object of type scmatrix as hermitian conjugated calling matrix.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
scmatrix mc(3);
std::cout << m << std::endl << ~m << std::endl ;
mc.conj(m);
std::cout << mc << std::endl;
mc.conj();
std::cout << mc;
prints
(1,2) (7,8) (13,14)
(3,4) (9,10) (15,16)
(5,6) (11,12) (17,18)
(1,-2) (3,-4) (5,-6)
(7,-8) (9,-10) (11,-12)
(13,-14) (15,-16) (17,-18)
(1,-2) (3,-4) (5,-6)
(7,-8) (9,-10) (11,-12)
(13,-14) (15,-16) (17,-18)
(1,2) (7,8) (13,14)
(3,4) (9,10) (15,16)
(5,6) (11,12) (17,18)
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31318 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::transpose ( const basic_scbmatrix< TR, TC > &  m) throw (cvmexception)
inline

Matrix transposition.

Sets calling complex square band matrix to be equal to complex square band matrix m transposed. Function throws cvmexception in case of not appropriate sizes of the operands.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16.};
scbmatrix m((std::complex<double>*)a,4,1,0);
scbmatrix mc(4,0,1);
std::cout << m << std::endl << !m << std::endl ;
mc.transpose(m);
std::cout << mc << std::endl;
mc.transpose();
std::cout << mc;
prints
(1,2) (0,0) (0,0) (0,0)
(3,4) (5,6) (0,0) (0,0)
(0,0) (7,8) (9,10) (0,0)
(0,0) (0,0) (11,12) (13,14)
(1,2) (3,4) (0,0) (0,0)
(0,0) (5,6) (7,8) (0,0)
(0,0) (0,0) (9,10) (11,12)
(0,0) (0,0) (0,0) (13,14)
(1,2) (3,4) (0,0) (0,0)
(0,0) (5,6) (7,8) (0,0)
(0,0) (0,0) (9,10) (11,12)
(0,0) (0,0) (0,0) (13,14)
(1,2) (0,0) (0,0) (0,0)
(3,4) (5,6) (0,0) (0,0)
(0,0) (7,8) (9,10) (0,0)
(0,0) (0,0) (11,12) (13,14)
Parameters
[in]mscbmatrix to transpose.
Returns
Reference to changed calling matrix.

Definition at line 31368 of file cvm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::conj ( const basic_scbmatrix< TR, TC > &  m) throw (cvmexception)
inline

Matrix hermitian conjugation.

Sets calling complex square band matrix to be equal to complex square band matrix m conjugated. Function throws cvmexception in case of not appropriate sizes of the operands.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16.};
scbmatrix m((std::complex<double>*)a,4,1,0);
scbmatrix mc(4,0,1);
std::cout << m << std::endl << ~m << std::endl ;
mc.conj(m);
std::cout << mc << std::endl;
mc.conj();
std::cout << mc;
prints
(1,2) (0,0) (0,0) (0,0)
(3,4) (5,6) (0,0) (0,0)
(0,0) (7,8) (9,10) (0,0)
(0,0) (0,0) (11,12) (13,14)
(1,-2) (3,-4) (0,0) (0,0)
(0,0) (5,-6) (7,-8) (0,0)
(0,0) (0,0) (9,-10) (11,-12)
(0,0) (0,0) (0,0) (13,-14)
(1,-2) (3,-4) (0,0) (0,0)
(0,0) (5,-6) (7,-8) (0,0)
(0,0) (0,0) (9,-10) (11,-12)
(0,0) (0,0) (0,0) (13,-14)
(1,2) (0,0) (0,0) (0,0)
(3,4) (5,6) (0,0) (0,0)
(0,0) (7,8) (9,10) (0,0)
(0,0) (0,0) (11,12) (13,14)
Parameters
[in]mscbmatrix to conjugate.
Returns
Reference to changed calling matrix.

Definition at line 31420 of file cvm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::transpose ( ) throw (cvmexception)
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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
scmatrix mc(3);
std::cout << m << std::endl << !m << std::endl ;
mc.transpose(m);
std::cout << mc << std::endl;
mc.transpose();
std::cout << mc;
prints
(1,2) (5,6) (9,10)
(3,4) (7,8) (11,12)
(1,2) (3,4)
(5,6) (7,8)
(9,10) (11,12)
(1,2) (3,4)
(5,6) (7,8)
(9,10) (11,12)
(1,2) (5,6) (9,10)
(3,4) (7,8) (11,12)
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31430 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::conj ( ) throw (cvmexception)
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.

Example:
using namespace cvm;
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12., 13., 14., 15., 16., 17., 18.};
scmatrix m((std::complex<double>*) a, 3);
scmatrix mc(3);
std::cout << m << std::endl << ~m << std::endl ;
mc.conj(m);
std::cout << mc << std::endl;
mc.conj();
std::cout << mc;
prints
(1,2) (7,8) (13,14)
(3,4) (9,10) (15,16)
(5,6) (11,12) (17,18)
(1,-2) (3,-4) (5,-6)
(7,-8) (9,-10) (11,-12)
(13,-14) (15,-16) (17,-18)
(1,-2) (3,-4) (5,-6)
(7,-8) (9,-10) (11,-12)
(13,-14) (15,-16) (17,-18)
(1,2) (7,8) (13,14)
(3,4) (9,10) (15,16)
(5,6) (11,12) (17,18)
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31436 of file cvm.h.

template<typename TR, typename TC>
CVector basic_scbmatrix< TR, TC >::operator* ( const CVector v) const throw (cvmexception)
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.

Example:
using namespace cvm;
cmatrix m(2, 3);
cvector v(3);
m.set(std::complex<double>(1.,1.));
v.set(std::complex<double>(1.,1.));
std::cout << m * v;
prints
(0,6) (0,6)
See Also
basic_cvector::mult(const basic_cmatrix<TR,TC>&,const basic_cvector<TR,TC>&)
Parameters
[in]vcvector to compute product with.
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31442 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
BaseCMatrix basic_scbmatrix< TR, TC >::operator* ( const BaseCMatrix m) const throw (cvmexception)
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.

Example:
using namespace cvm;
try {
scmatrix ms(3);
cmatrix m(3,2);
ms.set(std::complex<double>(1.,1.));
m.set(std::complex<double>(1.,1.));
std::cout << ms * m;
}
catch (std::exception& e) {
std::cout << "Exception " << e.what () << std::endl;
}
prints
(0,6) (0,6)
(0,6) (0,6)
(0,6) (0,6)
Parameters
[in]mcmatrix to compute product with.
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31451 of file cvm.h.

template<typename TR, typename TC>
BaseSCMatrix basic_scbmatrix< TR, TC >::operator* ( const BaseSCMatrix m) const throw (cvmexception)
inline

Matrix-matrix product.

Creates object of type scmatrix as product of calling complex square band 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.

Example:
using namespace cvm;
try {
scbmatrix mb(4,1,0);
scmatrix m(4);
mb.set(std::complex<double>(1.,1.));
m.set(std::complex<double>(1.,1.));
std::cout << mb * m;
}
catch (std::exception& e) {
std::cout << "Exception: " << e.what () << std::endl;
}
prints
(0,2) (0,2) (0,2) (0,2)
(0,4) (0,4) (0,4) (0,4)
(0,4) (0,4) (0,4) (0,4)
(0,4) (0,4) (0,4) (0,4)
Parameters
[in]mscmatrix to compute product with.
Returns
Result object.

Definition at line 31488 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::operator* ( const basic_scbmatrix< TR, TC > &  m) const throw (cvmexception)
inline

Matrix-matrix product.

Creates object of type scbmatrix as product of calling complex square band matrix and complex square band 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.

Example:
using namespace cvm;
try {
scbmatrix m1(5,1,0);
scbmatrix m2(5,1,1);
m1.set(std::complex<double>(1.,1.));
m2.set(std::complex<double>(1.,1.));
std::cout << m1 * m2;
}
catch (std::exception& e) {
std::cout << "Exception: " << e.what () << std::endl;
}
prints
(0,2) (0,2) (0,0) (0,0) (0,0)
(0,4) (0,4) (0,2) (0,0) (0,0)
(0,2) (0,4) (0,4) (0,2) (0,0)
(0,0) (0,2) (0,4) (0,4) (0,2)
(0,0) (0,0) (0,2) (0,4) (0,4)
Parameters
[in]mscbmatrix to compute product with.
Returns
Result object.

Definition at line 31527 of file cvm.h.

Here is the call graph for this function:

template<typename TR, typename TC>
CVector basic_scbmatrix< TR, TC >::operator/ ( const CVector vB) const throw (cvmexception)
inline

Linear solver operator.

Creates cvector object as solution $x$ of linear equation $A*x=b$ where calling matrix is square complex matrix $A$ and parameter vB is vector $b$. Operator throws cvmexception in case of inappropriate sizes of the operands or when matrix $A$ is close to singular.

Example:
using namespace cvm;
std::cout.setf (std::ios::scientific | std::ios::showpos);
std::cout.precision (7);
try {
double m[] = {1., -1., 1., 2., -2., 1., 3., -3.};
double b[] = {1., 2., 5., -3.};
scmatrix ma((std::complex<double>*) m, 2);
cvector vb((std::complex<double>*) b, 2);
cvector vx(2);
vx = ma / vb;
std::cout << ma * vx - vb;
}
catch (std::exception& e) {
std::cout << "Exception " << e.what () << std::endl;
}
prints
(-6.6613381e-016,+4.4408921e-016) (+0.0000000e+000,+0.0000000e+000)
Parameters
[in]vBcvector $b$.
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31538 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::low_up ( const basic_scbmatrix< TR, TC > &  m,
tint nPivots 
) throw (cvmexception)
inline

Low-up (LU) factorization.

Compute LU factorization of complex square band matrix $A$ as

\[ A=PLU \]

where $P$ is permutation matrix, $L$ is lower triangular matrix with unit diagonal elements and $U$ is upper triangular matrix. Function stores result as the matrix $L$ without main diagonal combined with $U$. Function returns pivot indices as array of integers (it should support at least msize() elements) pointed to by nPivots so $i$-th row was interchanged with nPivots[ $i$]-th row. This version sets calling matrix to be equal to matrix m's LU factorization. This version also changes number of super-diagonals to be equal to $k_l+k_u$ in order to keep the result of 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.

Example:
using namespace cvm;
std::cout.setf (std::ios::scientific | std::ios::left);
std::cout.precision (2);
try {
double a[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.,
10., 11., 12.};
scbmatrix ma((std::complex<double>*)a,3,1,0);
scbmatrix mLU(3,1,0);
cmatrix mb1(3,2); cvector vb1(3);
cmatrix mb2(3,2); cvector vb2(3);
cmatrix mx1(3,2); cvector vx1(3);
cmatrix mx2(3,2); cvector vx2(3);
iarray nPivots(3);
double dErr = 0.;
mb1.randomize_real(-1.,3.); mb1.randomize_imag(1.,5.);
mb2.randomize_real(-2.,5.); mb2.randomize_imag(-3.,0.);
vb1.randomize_real(-2.,4.); vb1.randomize_imag(-4.,1.);
vb2.randomize_real(-3.,1.); vb2.randomize_imag(4.,5.);
mLU.low_up(ma, nPivots);
mx1 = ma.solve_lu (mLU, nPivots, mb1, dErr);
std::cout << mx1 << dErr << std::endl << std::endl;
mx2 = ma.solve_lu (mLU, nPivots, mb2);
std::cout << mx2 << std::endl;;
std::cout << ma * mx1 - mb1 << std::endl << ma * mx2 - mb2;
vx1 = ma.solve_lu (mLU, nPivots, vb1, dErr);
std::cout << vx1 << dErr << std::endl;
vx2 = ma.solve_lu (mLU, nPivots, vb2);
std::cout << vx2 << std::endl;;
std::cout << ma * vx1 - vb1 << std::endl << ma * vx2 - vb2;
}
catch (std::exception& e) {
std::cout << "Exception: " << e.what () << std::endl;
}
prints
(1.20e+000,4.02e-002) (1.82e+000,1.23e+000)
(-6.55e-001,1.37e-001) (-6.41e-001,-8.72e-001)
(7.75e-001,4.70e-002) (5.35e-001,8.11e-001)
1.45e-015
(-4.52e-001,-2.68e-002) (-1.09e+000,2.01e-001)
(6.08e-001,-4.76e-001) (5.48e-001,-1.95e-001)
(-3.46e-001,1.57e-001) (-3.38e-001,-7.54e-002)
(0.00e+000,4.44e-016) (-2.22e-016,8.88e-016)
(-2.22e-016,2.22e-016) (0.00e+000,0.00e+000)
(-1.11e-016,0.00e+000) (-3.33e-016,-6.66e-016)
(0.00e+000,0.00e+000) (2.22e-016,2.22e-016)
(0.00e+000,0.00e+000) (4.44e-016,-2.22e-016)
(8.88e-016,5.55e-016) (0.00e+000,0.00e+000)
(-1.28e+000,-5.12e-001) (8.22e-001,1.59e-001) (-6.45e-001,-3.74e-001)
1.31e-015
(1.26e+000,1.50e+000) (-5.13e-001,-4.66e-001) (5.97e-001,7.01e-001)
(0.00e+000,8.88e-016) (-4.44e-016,4.44e-016) (-8.88e-016,0.00e+000)
(2.22e-016,-8.88e-016) (4.44e-016,-8.88e-016) (-2.22e-016,8.88e-016)
Parameters
[in]mscbmatrix to compute LU factorization for.
[out]nPivotsArray of pivot indices.
Returns
Reference to changed calling matrix.

Definition at line 31633 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix basic_scbmatrix< TR, TC >::low_up ( tint nPivots) const throw (cvmexception)
inline

Low-up (LU) factorization.

Compute LU factorization of square complex matrix $A$ as

\[ A=PLU \]

where $P$ is permutation matrix, $L$ is lower triangular matrix with unit diagonal elements and $U$ is upper triangular matrix. Function stores result as the matrix $L$ without main diagonal combined with $U$. Function returns pivot indices as array of integers (it should support at least msize() elements) pointed to by nPivots so $i$-th row was interchanged with nPivots[ $i$]-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.

Example:
using namespace cvm;
try {
double re[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.};
double im[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.1};
scmatrix m(re, im, 3);
scmatrix mLU(3), mLo(3), mUp(3);
iarray naPivots(3);
mLU = m.low_up(naPivots);
mLo.identity ();
mLo.diag(-2) = mLU.diag(-2);
mLo.diag(-1) = mLU.diag(-1);
mUp.diag(0) = mLU.diag(0);
mUp.diag(1) = mLU.diag(1);
mUp.diag(2) = mLU.diag(2);
std::cout << mLo << std::endl << mUp
<< std::endl << naPivots << std::endl;
mLU = mLo * mUp;
for (int i = 3; i >= 1; i--) {
mLU.swap_rows (i, naPivots[i]);
}
std::cout << mLU << std::endl << m - mLU;
}
catch (std::exception& e) {
std::cout << "Exception " << e.what () << std::endl;
}
prints
(1,0) (0,0) (0,0)
(0.333333,0) (1,0) (0,0)
(0.666667,0) (0.5,0) (1,0)
(3,3) (6,6) (9,9.1)
(0,0) (2,2) (4,3.96667)
(0,0) (0,0) (-1.11022e-016,-0.05)
3 3 3
(1,1) (4,4) (7,7)
(2,2) (5,5) (8,8)
(3,3) (6,6) (9,9.1)
(0,0) (0,0) (0,0)
(0,0) (0,0) (0,0)
(0,0) (0,0) (0,0)
Parameters
[out]nPivotsArray of pivot indices.
Returns
Result object.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31640 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::identity ( )
inline

Identity matrix.

Sets calling square complex matrix to be equal to identity matrix and returns reference to the matrix changed.

Example:
using namespace cvm;
scmatrix m(3);
m.randomize_real(0.,3.);
m.randomize_imag(-1.,2.);
std::cout << m << std::endl;
std::cout << m.identity();
prints
(1.31162,-0.52501) (2.8612,-0.531144) (1.31849,0.547838)
(1.19929,1.48253) (0.535417,0.41316) (0.459883,1.7019)
(0.415937,-0.491134) (2.0969,-0.218024) (0.545305,1.17866)
(1,0) (0,0) (0,0)
(0,0) (1,0) (0,0)
(0,0) (0,0) (1,0)
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31647 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::vanish ( )
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.

Example:
using namespace cvm;
scmatrix m(3);
m.randomize_real(0.,3.);
m.randomize_imag(-1.,2.);
std::cout << m << std::endl;
std::cout << m.vanish();
prints
(1.34834,-0.758385) (0.837825,-0.225532) (0.367687,0.791833)
(2.23698,-0.183142) (2.6878,0.741111) (0.495865,0.698904)
(0.584124,0.00491348) (1.31574,0.687643) (0.482131,1.66482)
(0,0) (0,0) (0,0)
(0,0) (0,0) (0,0)
(0,0) (0,0) (0,0)
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31654 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::randomize_real ( TR  dFrom,
TR  dTo 
)
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.

Example:
using namespace cvm;
std::cout.setf (std::ios::scientific | std::ios::left);
std::cout.precision (3);
cmatrix m(2,3);
m.randomize_real(-1., 2.);
std::cout << m;
prints
(1.090e+00,0.000e+00) (-6.375e-01,0.000e+00) (1.248e+00,0.000e+00)
(-1.272e-01,0.000e+00) (-8.557e-01,0.000e+00) (4.848e-01,0.000e+00)
Parameters
[in]dFromFirst limit.
[in]dToSecond limit.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31660 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::randomize_imag ( TR  dFrom,
TR  dTo 
)
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.

Example:
using namespace cvm;
std::cout.setf (std::ios::scientific | std::ios::left);
std::cout.precision (3);
cmatrix m(2,3);
m.randomize_imag(-1., 2.);
std::cout << m;
prints
(0.000e+00,1.113e+00) (0.000e+00,6.615e-01) (0.000e+00,1.017e+00)
(0.000e+00,-3.397e-01) (0.000e+00,1.577e+00) (0.000e+00,8.071e-01)
Parameters
[in]dFromFirst limit.
[in]dToSecond limit.
Returns
Reference to changed calling matrix.

Reimplemented from basic_scmatrix< TR, TC >.

Definition at line 31666 of file cvm.h.

template<typename TR, typename TC>
TR basic_scbmatrix< TR, TC >::norm ( ) const
inlineoverridevirtual

Euclidean norm.

Euclidean norm of calling array that for vectors is defined as

\[ {\|x\|}_E=\left(\sum_{i=1}^{n} |x_i|^2\right)^{1/2} \]

and for matrices as

\[ {\|A\|}_E=\left(\sum_{i=1}^{m}\sum_{j=1}^{n} |a_{ij}|^2\right)^{1/2}, \]

Example:
using namespace cvm;
std::cout.setf (ios::scientific | ios::showpos);
std::cout.precision (12);
double a[] = {1., 2., 3., -4., 5., -6.};
const rvector v (a, 3);
const rmatrix m (a, 2, 3);
std::cout << v << v.norm () << std::endl << std::endl;
std::cout << m << m.norm () << std::endl;
prints
+1.000000000000e+000 +2.000000000000e+000 +3.000000000000e+000
+3.741657386774e+000
+1.000000000000e+000 +3.000000000000e+000 +5.000000000000e+000
+2.000000000000e+000 -4.000000000000e+000 -6.000000000000e+000
+9.539392014169e+000
Returns
treal Norm value

Reimplemented from basic_array< TR, TC >.

Definition at line 31673 of file cvm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename TR, typename TC>
TR basic_scbmatrix< TR, TC >::norm1 ( ) const
inlineoverridevirtual

1-norm

1-norm of calling array that for vectors is defined as

\[ {\|x\|}_1=\sum_{i=1}^{n} |x_i| \]

and for matrices as

\[ {\|A\|}_{1}=\max_{j=1,\dots,n} \sum_{i=1}^{m} |a_{ij}|, \]

Example:
using namespace cvm;
std::cout.setf (std::ios::scientific | std::ios::showpos);
std::cout.precision (12);
double a[] = {1., 2., 3., -4., 5., -6.};
const rvector v (a, 3);
const rmatrix m (a, 2, 3);
std::cout << v << v.norm1 () << std::endl << std::endl;
std::cout << m << m.norm1 () << std::endl;
prints
+1.000000000000e+000 +2.000000000000e+000 +3.000000000000e+000
+6.000000000000e+000
+1.000000000000e+000 +3.000000000000e+000 +5.000000000000e+000
+2.000000000000e+000 -4.000000000000e+000 -6.000000000000e+000
+1.100000000000e+001
Returns
treal Norm value

Reimplemented from Matrix< TR, TC >.

Definition at line 31690 of file cvm.h.

template<typename TR, typename TC>
TR basic_scbmatrix< TR, TC >::norminf ( ) const
inlineoverridevirtual

Infinity norm.

Infinity norm of calling array that for vectors is defined as

\[ {\|x\|}_\infty=\max_{i=1,\dots,n} |x_i| \]

and for matrices as

\[ {\|A\|}_\infty=\max_{i=1,\dots,m} \sum_{j=1}^{n} |a_{ij}|, \]

Example:
using namespace cvm;
double a[] = {1., 2., 3., -4., 5., -6.};
const rvector v (a, 3);
const rmatrix m (a, 2, 3);
std::cout << v << v.norminf () << std::endl;
std::cout << m << m.norminf () << std::endl;
prints
1 2 3
3
1 3 5
2 -4 -6
12
Returns
treal Norm value

Reimplemented from Matrix< TR, TC >.

Definition at line 31694 of file cvm.h.

template<typename TR, typename TC>
basic_scbmatrix& basic_scbmatrix< TR, TC >::mult ( const BaseCMatrix m1,
const BaseCMatrix m2 
) throw (cvmexception)
inline

Definition at line 31700 of file cvm.h.

Member Data Documentation

template<typename TR, typename TC>
BaseSCMatrix basic_scbmatrix< TR, TC >::mSM
mutableprotected

Temporary storage for square matrix enclosing band one (if needed)

Definition at line 30120 of file cvm.h.


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