Class xlifepp::DenseStorage#

class DenseStorage : public xlifepp::MatrixStorage#

Inheritence diagram for xlifepp::DenseStorage:

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

Collaboration diagram for xlifepp::DenseStorage:

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

abstract base class of all dense storage methods

Subclassed by xlifepp::ColDenseStorage, xlifepp::DualDenseStorage, xlifepp::RowDenseStorage, xlifepp::SymDenseStorage

Public Functions

DenseStorage(AccessType, number_t, number_t, string_t id = "DenseStorage")#

constructor by access type, number of columns and rows

DenseStorage(AccessType, number_t, string_t id = "DenseStorage")#

constructor by access type, number of columns and rows (same)

DenseStorage(AccessType, string_t id = "DenseStorage")#

constructor by access type

DenseStorage(string_t id = "DenseStorage")#

default constructor

inline virtual ~DenseStorage()#

virtual destructor

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.

template<typename M, typename V, typename X>
void diagonalSolverG(const std::vector<M> &m, std::vector<V> &v, std::vector<X> &x) const#

Generic diagonal linear system solver: D x = b.

virtual void gaussSolver(std::vector<real_t> &A, std::vector<std::vector<real_t>> &bs) const#

specializations of gaussSolver and LU factorization thats call generic functions

template<typename T>
void gaussSolverG(std::vector<T>&, std::vector<std::vector<T>>&) const#

generic Gauss solver with partial pivoting strategy A*x1=b1, A*x2=b2, …

generic Gauss solver with row pivoting strategy A*x1=b1, A*x2=b2, … A: square matrix b: right hand sides and solutions

does not work for symmetric dense storage

template<typename T>
void gaussSolverG(std::vector<T>&, std::vector<T>&) const#

generic Gauss solver with partial pivoting strategy A*x=b

generic Gauss solver with row pivoting strategy A*x=b A: square matrix b: right hand sides and solutions

does not work for symmetric dense storage

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 in set [c1,c2], (present for consitancy)

virtual void getColsV(std::vector<number_t>&, number_t&, 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 in set [c1,c2], faster (no allocation, no check)

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 range [r1,r2] (present for consitancy)

virtual void getRowsV(std::vector<number_t>&, number_t&, 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 [c1,c2], faster (no allocation, no check)

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

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

template<typename M, typename V, typename X>
void lowerD1LeftSolverG(const std::vector<M> &m, std::vector<V> &v, std::vector<X> &x) const#

Generic lower triangular with unit diagonal linear system left solver: x (I+L) = b.

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

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

template<typename M, typename V, typename X>
void lowerD1SolverG(const std::vector<M> &m, std::vector<V> &v, std::vector<X> &x) const#

Generic lower triangular with unit diagonal linear system solver: (I+L) x = b.

inline virtual number_t lowerPartSize() const#

size of lower triangular part except for Dual/SymDenseStorage

virtual void lu(std::vector<real_t> &A, std::vector<real_t> &LU, const SymType sym = _noSymmetry) const#

virtual LU factorizations (Skyline and Dense child classes only)

template<typename T>
void luG(std::vector<T> &A, std::vector<T> &LU) const#

LU factorization with no pivoting (omp)

generic LU factorisation with with no pivoting strategy A = LU A: square matrix LU: the factorized matrix

does not work for symmetric storage

template<typename T>
void luG(std::vector<T> &A, std::vector<T> &LU, std::vector<number_t> &p) const#

LU factorization with row pivoting (omp)

generic LU factorisation with with real row pivoting strategy PA = LU

does not work for symmetric dense storage

A: square matrix LU: the factorized matrix P: the row permutation vector (index starts from 0) be care: solving A*X=B is equivalent to solving P*A*X=P*B <=> L*U*X=PB, the product by P has to be done before calling triangular part solvers! product B=A*X is equivalent to product B=inv(P)*L*U*X, the product by inv(P) has to be done after calling triangular part product! product B=X*A is equivalent to product B=X*inv(P)*L*U=tr(tr(U)*tr(L)*P*X), the product by P has to be done before calling triangular part product! this products are not taken into account by storage class !

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

overloaded pos fast returns adress of entry (i,j)

virtual bool sameStorage(const MatrixStorage&) const#

check if two storages have the same structures

inline virtual number_t size() const#

storage size except for SymDenseStorage

virtual MatrixStorage *toDual()#

create a new dual dense storage from sym dense storage

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

Specializations of upper triangular part with unit diagonal linear solvers (I + U) x = v.

template<typename M, typename V, typename X>
void upperD1SolverG(const std::vector<M> &m, std::vector<V> &v, std::vector<X> &x, const SymType sym = _noSymmetry) const#

Generic upper triangular with unit diagonal linear system solver: (I+U) x = b.

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

Specializations of upper triangular linear system left solver: x U = b.

template<typename M, typename V, typename X>
void upperLeftSolverG(const std::vector<M> &m, std::vector<V> &v, std::vector<X> &x, const SymType sym = _noSymmetry) const#

Generic upper triangular linear system left solver: x U = b.

inline virtual number_t upperPartSize() const#

size of upper triangular part except for Dual/SymDenseStorage

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

specializations of upper triangular part linear solvers (D + U) x = v

template<typename M, typename V, typename X>
void upperSolverG(const std::vector<M> &m, std::vector<V> &v, std::vector<X> &x, const SymType sym = _noSymmetry) const#

Generic upper triangular linear system solver: (D+U) x = b.