Class xlifepp::SymCsStorage#

class SymCsStorage : public xlifepp::CsStorage#

Inheritence diagram for xlifepp::SymCsStorage:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="xlifepp::CsStorage" tooltip="xlifepp::CsStorage"] "3" [label="xlifepp::MatrixStorage" tooltip="xlifepp::MatrixStorage"] "1" [label="xlifepp::SymCsStorage" tooltip="xlifepp::SymCsStorage" fillcolor="#BFBFBF"] "2" -> "3" [dir=forward tooltip="public-inheritance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::SymCsStorage:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "5" [label="std::vector< T >" tooltip="std::vector< T >"] "6" [label="std::vector< number_t >" tooltip="std::vector< number_t >"] "4" [label="std::vector< xlifepp::MatrixStorage * >" tooltip="std::vector< xlifepp::MatrixStorage * >"] "2" [label="xlifepp::CsStorage" tooltip="xlifepp::CsStorage"] "3" [label="xlifepp::MatrixStorage" tooltip="xlifepp::MatrixStorage"] "1" [label="xlifepp::SymCsStorage" tooltip="xlifepp::SymCsStorage" fillcolor="#BFBFBF"] "6" -> "5" [dir=forward tooltip="template-instance"] "4" -> "5" [dir=forward tooltip="template-instance"] "2" -> "3" [dir=forward tooltip="public-inheritance"] "3" -> "4" [dir=forward tooltip="usage"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "1" -> "6" [dir=forward tooltip="usage"] }

child class for row compressed storage of matrix with symmetrty

Public Functions

SymCsStorage(number_t n = 0, string_t id = "SymCsStorage")#

default constructor

template<typename L>
SymCsStorage(number_t, const std::vector<L>&, MatrixPart, string_t id = "SymCsStorage")#

constructor by the list of col index by rows

SymCsStorage(number_t, const std::vector<std::vector<number_t>>&, const std::vector<std::vector<number_t>>&, string_t id = "SymCsStorage")#

constructor by a pair of global numerotation vectors

inline ~SymCsStorage()#

destructor

template<typename M1, typename M2, typename R>
void addMatrixMatrix(const std::vector<M1>&, const std::vector<M2>&, std::vector<R>&) const#

template Matrix + Matrix addition and specializations (see below)

Add two matrices.

templated Sym Cs Matrix + Matrix

Parameters:
  • m1 – vector values_ of first matrix

  • m2 – vector values_ of second matrix

  • r – vector values_ of result matrix

inline virtual void addMatrixMatrix(const std::vector<real_t> &m, const std::vector<real_t> &v, std::vector<real_t> &rv) const#

Matrix+Matrix.

virtual void addRow(number_t, const std::set<number_t>&, MatrixPart)#

add row-cols (r,c1), (r,c2), … given by a cols set (r,c>=1)

virtual void addSubMatrixIndices(const std::vector<number_t>&, const std::vector<number_t>&)#

add dense submatrix indices in storage

inline virtual void clear()#

clear storage vectors

inline virtual SymCsStorage *clone() const#

create a clone (virtual copy constructor, covariant)

std::set<number_t> colIndex(number_t r) const#

returns column indices of row r>0 (strict lower part)

inline virtual void diagonalSolver(const std::vector<real_t> &m, std::vector<real_t> &v, std::vector<real_t> &x) const#

Specializations of diagonal linear solvers D x = v */.

virtual void fillSkylineValues(const std::vector<complex_t>&, std::vector<complex_t>&, SymType, MatrixStorage*) const#

fill complex values of current storage as a skyline storage

virtual void fillSkylineValues(const std::vector<Matrix<complex_t>>&, std::vector<Matrix<complex_t>>&, SymType, MatrixStorage*) const#

fill values of current storage as a skyline storage

virtual void fillSkylineValues(const std::vector<Matrix<real_t>>&, std::vector<Matrix<real_t>>&, SymType, MatrixStorage*) const#

fill values of current storage as a skyline storage

virtual void fillSkylineValues(const std::vector<real_t>&, std::vector<real_t>&, SymType, MatrixStorage*) const#

fill real values of current storage as a skyline storage

std::vector<std::pair<number_t, number_t>> getCol(number_t c, number_t r1 = 1, number_t r2 = 0) const#

get (row indices, adress) of col c in set [r1,r2]

virtual std::vector<std::pair<number_t, number_t>> getCol(SymType s, number_t c, number_t r1 = 1, number_t r2 = 0) const#

get (row indices, adress) of col c in set [r1,r2]

virtual std::set<number_t> getCols(number_t r, number_t c1 = 1, number_t c2 = 0) const#

get col indices of row r in set [c1,c2]

get col indices of row r>=1 in set [c1,c2], use colIndex pointer for lower part (efficient for lower part)

std::vector<std::pair<number_t, number_t>> getRow(number_t r, number_t c1 = 1, number_t c2 = 0) const#

get (col indices, adress) of row r in set [c1,c2]

virtual std::vector<std::pair<number_t, number_t>> getRow(SymType s, number_t r, number_t c1 = 1, number_t c2 = 0) const#

get (col indices, adress) of row r in set [c1,c2]

virtual std::set<number_t> getRows(number_t c, number_t r1 = 1, number_t r2 = 0) const#

get row indices of col c in set [r1,r2]

get row indices of col c in set [r1,r2], use getCols

template<typename M>
void ildlstar(std::vector<M> &m, std::vector<M> &fa) const#

Incomplete matrix factorization with ILDLstar.

inline virtual void ildlstar(std::vector<real_t> &m, std::vector<real_t> &fa, const SymType sym = _noSymmetry) const#

specializations of template iLDLstar

template<typename M>
void ildlt(std::vector<M> &m, std::vector<M> &fa) const#

Incomplete matrix factorization with ILDLt.

Incomplete factorization of matrix M stored as matrix F = L D Lt where.

  • L is a lower triangular matrix with unit diagonal and is stored as the strict lower triangular part of F

inline virtual void ildlt(std::vector<real_t> &m, std::vector<real_t> &fa, const SymType sym = _noSymmetry) const#

specializations of template ILDLt

template<typename M>
void illstar(std::vector<M> &m, std::vector<M> &fa) const#

Incomplete matrix factorization with ILLstar.

inline virtual void illstar(std::vector<real_t> &m, std::vector<real_t> &fa, const SymType sym = _selfAdjoint) const#

specializations of template ILLstar

template<typename M>
void illt(std::vector<M> &m, std::vector<M> &fa) const#

Incomplete matrix factorization with ILLt.

inline virtual void illt(std::vector<real_t> &m, std::vector<real_t> &fa, const SymType sym = _noSymmetry) const#

specializations of template ILLt

inline virtual void ilu(std::vector<real_t> &m, std::vector<real_t> &fa, const SymType sym = _noSymmetry) const#

virtual ILU factorizations ( CS child classes only)

inline virtual void loadFromFileCoo(std::istream &ifs, std::vector<complex_t> &mat, SymType sym, bool rAsC)#

load a complex coordinate matrix

inline virtual void loadFromFileCoo(std::istream &ifs, std::vector<real_t> &mat, SymType sym, bool rAsC)#

load a real coordinate matrix

inline virtual void loadFromFileDense(std::istream &ifs, std::vector<complex_t> &mat, SymType sym, bool rAsC)#

load a complex dense matrix from file

inline virtual void loadFromFileDense(std::istream &ifs, std::vector<real_t> &mat, SymType sym, bool rAsC)#

load a real dense matrix from file

inline virtual number_t lowerPartSize() const#

returns number of entries of lower triangular part

inline virtual void multMatrixVector(const std::vector<complex_t> &m, complex_t *vp, complex_t *rp, SymType sym) const#

templated symcs Matrix x Vector (pointer)

inline virtual void multMatrixVector(const std::vector<complex_t> &m, real_t *vp, complex_t *rp, SymType sym) const#

templated symcs Matrix x Vector (pointer)

template<typename M, typename V, typename R>
void multMatrixVector(const std::vector<M>&, const std::vector<V>&, std::vector<R>&, SymType sym) const#

templated symcs Matrix x Vector

template<typename M, typename V, typename R>
void multMatrixVector(const std::vector<M> &m, V*, R*, SymType sym) const#

templated symcs Matrix x Vector (pointer form)

inline virtual void multMatrixVector(const std::vector<Matrix<real_t>> &m, const std::vector<Vector<real_t>> &v, std::vector<Vector<real_t>> &rv, SymType sym) const#

Matrix (Matrix) * Vector (Vector)

inline virtual void multMatrixVector(const std::vector<real_t> &m, complex_t *vp, complex_t *rp, SymType sym) const#

templated symcs Matrix x Vector (pointer)

inline virtual void multMatrixVector(const std::vector<real_t> &m, const std::vector<real_t> &v, std::vector<real_t> &rv, SymType sym) const#

Matrix (Scalar) * Vector (Scalar)

inline virtual void multMatrixVector(const std::vector<real_t> &m, real_t *vp, real_t *rp, SymType sym) const#

Matrix * Vector (pointer form)

templated symcs Matrix x Vector (pointer)

template<typename M, typename V, typename R>
void multVectorMatrix(const std::vector<M>&, const std::vector<V>&, std::vector<R>&, SymType sym) const#

templated Vector x symcs Matrix

template<typename M, typename V, typename R>
void multVectorMatrix(const std::vector<M> &m, V*, R*, SymType sym) const#

templated Vector x symcs Matrix (pointer form)

inline virtual void multVectorMatrix(const std::vector<Matrix<real_t>> &m, const std::vector<Vector<real_t>> &v, std::vector<Vector<real_t>> &rv, SymType sym) const#

Matrix (Matrix) * Vector (Vector)

inline virtual void multVectorMatrix(const std::vector<real_t> &m, const std::vector<real_t> &v, std::vector<real_t> &rv, SymType sym) const#

Vector (Scalar) * Matrix (Scalar)

virtual number_t pos(number_t i, number_t j, SymType s = _noSymmetry) const#

returns adress of entry (i,j)

virtual void positions(const std::vector<number_t>&, const std::vector<number_t>&, std::vector<number_t>&, bool errorOn = true, SymType = _noSymmetry) const#

access to submatrix positions

inline virtual void print(PrintStream &os) const#

visualize storage on ostream

virtual void print(std::ostream&) const#

print storage pointers

void printCooMatrix(std::ostream&, const std::vector<complex_t>&, SymType) const#

output matrix of real scalars in coordinate form

void printCooMatrix(std::ostream&, const std::vector<Matrix<complex_t>>&, SymType) const#

output matrix of complex scalars in coordinate form

void printCooMatrix(std::ostream&, const std::vector<Matrix<real_t>>&, SymType) const#

output matrix of real scalars in coordinate form

void printCooMatrix(std::ostream&, const std::vector<real_t>&, SymType) const#

output matrix of real scalars in coordinate form

virtual void printEntries(std::ostream&, const std::vector<complex_t>&, number_t vb, const SymType sym) const#

print complex scalar matrix

virtual void printEntries(std::ostream&, const std::vector<Matrix<complex_t>>&, number_t vb, const SymType sym) const#

print matrix of complex matrices

virtual void printEntries(std::ostream&, const std::vector<Matrix<real_t>>&, number_t vb, const SymType sym) const#

print matrix of real matrices

virtual void printEntries(std::ostream&, const std::vector<real_t>&, number_t vb, const SymType sym) const#

print real scalar matrix

void printEntries(std::ostream&, const std::vector<Vector<complex_t>>&, number_t vb, const SymType sym) const#

print matrix of complex vectors (not available)

void printEntries(std::ostream&, const std::vector<Vector<real_t>>&, number_t vb, const SymType sym) const#

print matrix of real vectors (not available)

virtual bool sameStorage(const MatrixStorage&) const#

check if two storages have the same structures

inline virtual number_t size() const#

number of non zero elements stored in lower triangular part

virtual std::vector<number_t> skylineColPointer() const#

return skyline col pointer from current SymCsStorage pointers

virtual std::vector<number_t> skylineRowPointer() const#

return skyline row pointer from current SymCsStorage pointers

template<typename M, typename V, typename R>
inline void sorDiagonalMatrixVector(const std::vector<M> &m, const std::vector<V> &v, std::vector<R> &r, const real_t w) const#

special template partial Matrix x Vector multiplications [w*D] v used in SSOR algorithm for D + L + U matrix splitting (D diagonal, L & U strict lower & upper trangular parts)

inline virtual void sorDiagonalMatrixVector(const std::vector<real_t> &m, const std::vector<real_t> &v, std::vector<real_t> &rv, const real_t w) const#

specializations of partial matrix std::vector multiplications

template<typename M, typename V, typename R>
inline void sorDiagonalSolver(const std::vector<M> &m, const std::vector<R> &b, std::vector<V> &x, const real_t w) const#

special template diagonal and triangular solvers D/w x = b used in SSOR algorithm for D + L + U matrix splitting (D diagonal, L & U strict lower & upper triangular parts)

inline virtual void sorDiagonalSolver(const std::vector<real_t> &m, const std::vector<real_t> &b, std::vector<real_t> &x, const real_t w) const#

specializations of diagonal solvers

template<typename M, typename V, typename R>
inline void sorLowerMatrixVector(const std::vector<M> &m, const std::vector<V> &v, std::vector<R> &r, const real_t w, const SymType sym) const#

special template partial Matrix x Vector multiplications [w*D+L] v used in SSOR algorithm for D + L + U matrix splitting (D diagonal, L & U strict lower & upper trangular parts)

inline virtual void sorLowerMatrixVector(const std::vector<real_t> &m, const std::vector<real_t> &v, std::vector<real_t> &rv, const real_t w, const SymType sym) const#

specializations of partial matrix vector multiplications

template<typename M, typename V, typename R>
inline void sorLowerSolver(const std::vector<M> &m, const std::vector<R> &b, std::vector<V> &x, const real_t w) const#

special template diagonal and triangular solvers (D/w+L) x = b used in SSOR algorithm for D + L + U matrix splitting (D diagonal, L & U strict lower & upper triangular parts)

inline virtual void sorLowerSolver(const std::vector<real_t> &m, const std::vector<real_t> &b, std::vector<real_t> &x, const real_t w) const#

specializations of lower triangular part solvers

template<typename M, typename V, typename R>
inline void sorUpperMatrixVector(const std::vector<M> &m, const std::vector<V> &v, std::vector<R> &r, const real_t w, const SymType sym) const#

special template partial Matrix x Vector multiplications [w*D+U] v used in SSOR algorithm for D + L + U matrix splitting (D diagonal, L & U strict lower & upper trangular parts)

inline virtual void sorUpperMatrixVector(const std::vector<real_t> &m, const std::vector<real_t> &v, std::vector<real_t> &rv, const real_t w, const SymType sym) const#

specializations of partial matrix vector multiplications

template<typename M, typename V, typename R>
inline void sorUpperSolver(const std::vector<M> &m, const std::vector<R> &b, std::vector<V> &x, const real_t w, const SymType sym) const#
/*! special template diagonal and triangular solvers (D/w+U) x = b used in SSOR algorithm
      for D + L + U matrix splitting (D diagonal, L & U strict lower & upper triangular parts)
inline virtual void sorUpperSolver(const std::vector<real_t> &m, const std::vector<real_t> &b, std::vector<real_t> &x, const real_t w, const SymType sym) const#

specializations of upper triangular part solvers

virtual SymCsStorage *toScalar(dimen_t, dimen_t)#

create a new scalar SymCs storage from current SymCs storage and submatrix sizes

template<typename M, typename OrdinalType>
void toUmfPack(const std::vector<M> &values, std::vector<OrdinalType> &colPointer, std::vector<OrdinalType> &rowIndex, std::vector<M> &mat, const SymType sym = _noSymmetry) const#

conversion to umfpack format

template<typename M1, typename Idx>
void toUmfPack(const std::vector<M1> &m1, std::vector<Idx> &colPtUmf, std::vector<Idx> &rowIdxUmf, std::vector<M1> &resultUmf, const SymType sym) const#

Extract and convert matrix storage to UMFPack format (Matlab sparse matrix)

Parameters:
  • m1 – vector values_ current matrix

  • colPtUmf – vector column Pointer of UMFPack format

  • rowIdxUmf – vector row Index of UMFPack format

  • resultUmf – vector values of UMFPack format

  • sym – type of symmetry

inline virtual void toUmfPack(const std::vector<real_t> &values, std::vector<int_t> &colPointer, std::vector<int_t> &rowIndex, std::vector<real_t> &mat, const SymType sym) const#

conversion to umfpack format (specializations)

inline virtual void upperD1Solver(const std::vector<real_t> &m, std::vector<real_t> &v, std::vector<real_t> &x, SymType sym) const#

Specializations of lower triangular part with unit diagonal linear solvers (I + L) x = v */.

inline virtual number_t upperPartSize() const#

returns number of entries of upper triangular part

inline virtual void upperSolver(const std::vector<real_t> &m, std::vector<real_t> &v, std::vector<real_t> &x, SymType sym) const#

Specializations of lower triangular part with unit diagonal linear solvers (I + L) x = v */.