Class xlifepp::SparseMatrix#
-
template<typename K>
class SparseMatrix : public std::map<NumPair, K>#
-
Inheritence diagram for xlifepp::SparseMatrix:
Collaboration diagram for xlifepp::SparseMatrix:
to deal with numeric sparse matrix (say real or complex vector) using (i,j,v) representation
Public Functions
-
inline SparseMatrix(const char *f)#
-
constructor from input file given by name
-
inline SparseMatrix(const number_t n, SpecialMatrix sm)#
-
constructor for v*Id matrix (v!=0)
-
inline SparseMatrix(const number_t r = 0, const number_t c = 0)#
-
constructor for null rectangular matrix
-
inline SparseMatrix(const string_t &f)#
-
constructor from input file given by name
-
inline SparseMatrix<K> &adjoint()#
-
matrix adjoint
-
inline cit_sm begin() const#
-
overloaded const_iterator begin
-
inline SparseMatrix &clean()#
-
remove zeros without changing matrix size
-
inline void complexCastWarning(const string_t &s, const size_t r, const size_t c) const#
-
warning: try to cast a complex to a real
-
inline SparseMatrix<K> &conjugate()#
-
to its conjugate (assuming conj(real)->real)
-
template<typename KK>
inline SparseMatrix<K> &diagProduct(const std::vector<KK> &diag)#
-
product by a diagonal matrix M = diag*M
-
inline void divideByZero(const string_t &s) const#
-
error: divide by 0 in matrix operation s matrix dimension dim(op1)
-
inline cit_sm end() const#
-
overloaded const_iterator begin
-
inline SparseMatrix<real_t> imag() const#
-
imaginary part of a (complex) matrix
-
inline bool isSelfAdjoint() const#
-
self adjoint matrix test
-
inline void isSingular() const#
-
error: non invertible matrix
-
inline bool isSkewAdjoint() const#
-
skew adjoint matrix test
-
inline bool isSkewSymmetric() const#
-
skew-symmetric matrix test
-
inline bool isSymmetric() const#
-
symmetric matrix test
-
inline void loadFromFile(const char *f)#
-
load matrix from file read from file a sparse matrix, formated as:
i j aij ....
-
inline void mismatchDims(const string_t &s, const size_t r, const size_t c) const#
-
error: in matrix operation s dimensions disagree dim(op1)= … dim(op2)=…
-
inline void nonSquare(const string_t &s, const size_t r, const size_t c) const#
-
error: operation forbidden for non square matrix
-
template<typename KK>
inline SparseMatrix<K> &operator*=(const KK &x)#
-
overloaded *= multiply by a scalar
-
template<typename KK>
inline SparseMatrix<K> &operator+=(const KK &x)#
-
add a scalar
-
template<typename KK>
inline SparseMatrix<K> &operator+=(const SparseMatrix<KK> &b)#
-
accumulated matrix addition A+=B
-
template<typename KK>
inline SparseMatrix<K> &operator-=(const KK &x)#
-
subtract a scalar
-
template<typename KK>
inline SparseMatrix<K> &operator-=(const SparseMatrix<KK> &b)#
-
accumulated matrix subtraction (with cast)
-
template<typename KK>
inline SparseMatrix<K> &operator/=(const KK &x)#
-
overloaded /= divide by scalar
-
inline void print() const#
-
write on default file stream
-
inline void print(std::ofstream &os) const#
-
write on a file stream
-
template<typename KK>
inline SparseMatrix<K> &productDiag(std::vector<KK> diag)#
-
product by a diagonal matrix M = M*diag
-
inline SparseMatrix<real_t> real() const#
-
real part of a (complex) matrix
-
inline SparseMatrix &resize(number_t m, number_t n)#
-
change matrix size, removing outside coeff
-
inline void saveToFile(const char *f) const#
-
save matrix to file formated as: i j aij
-
true if matrices bear same dimensions
-
inline real_t squaredNorm() const#
-
return squared norm of the matrix
-
inline SparseMatrix<K> &transpose()#
-
matrix transpostion
-
inline string_t typeStr() const#
-
type of matrix as string (see specialization)
-
inline SparseMatrix(const char *f)#