sparseMatrix.hh
SparseMatrix(const Space< G > &spc, const Vector< F > &x, const Vector< F > &y)
Constructor of rank 1 matrix.
void multiply(const H &fact, Matrix< F > &dest) const
Multiplies this matrix with fact and adds the result to dest.
Definition: sparseMatrix.hh:429
bool storeMatlab(const std::string filename, const std::string name="", bool append=false) const
Stores the matrix in a Matlab sparse matrix.
virtual void transpMult(const Vector< c_type > &fncY, Vector< c_type > &fncX)
std::conditional< std::is_same< typename Realtype< F >::type, F >::value, typename Realtype< F >::type, typename Cmplxtype< F >::type >::type d_type
Data type, depending if F is real or complex.
Definition: sparseMatrix.hh:73
SparseMatrix(const Space< G > &spc, const Sequence< bool > &seq, const BilinearForm< F, G > &bf, const Real eps=0.0)
Constructor.
const HashedSparseMatrix< F > * m() const
Returns the sparse matrix itself.
Definition: sparseMatrix.hh:378
virtual void convertCCS(F *a, int *asub, int *xa) const
void operator=(const SparseMatrix< F > &)
SparseMatrix(const Space< G > &spcX, const Space< G > &spcY)
Constructor.
Definition: sparseMatrix.hh:81
void add(const Vector< H > &v, const I fact, const uint rowoffset=0, const uint coloffset=0)
Copies the vector v multiplied by fact on position (rowoffset, coloffset)
Definition: sparseMatrix.hh:597
void compress(Real threshold=EPS)
Compresses the matrix by dropping small entries.
Definition: sparseMatrix.hh:444
#define conceptsAssert(cond, exc)
Assert that a certain condition is fulfilled.
Definition: exceptions.hh:394
void histogram(std::map< int, uint > &hist) const
Creates a histogram of the matrix entries.
void copyConstructor_(const SparseMatrix< F > &m, bool t)
void addInto(Matrix< H > &dest, const I fact, const uint rowoffset=0, const uint coloffset=0) const
This matrix is added as block to the given matrix dest.
Definition: sparseMatrix.hh:538
#define DEBUGL(doit, msg)
Abstract function class to evaluate a bilinear form.
Definition: bilinearForm.hh:33
void symmetrize()
Makes sure a theoretically symmetric matrix is symmetric in memory too.
virtual void resize(uint m, uint n)
Sets a new size, previous data might be lost
Definition: sparseMatrix.hh:361
virtual uint used() const
Returns the number of used entries in the matrix.
Definition: sparseMatrix.hh:433
void operator()(const Vector< H > &fncY, Vector< I > &fncX)
Multiplies the matrix with fncY. The result is fncX.
Definition: sparseMatrix.hh:322
_HashedSMatrix_iterator< F, F &, F * > iterator
Definition: sparseMatrix.hh:75
virtual void apply_(const Vector< F > &fncY, Vector< F > &fncX)
Definition: sparseMatrix.hh:474
SparseMatrix(const Space< G > &spcX, const Space< G > &spcY, const Sequence< bool > &seq, const BilinearForm< F, G > &bf, const Real eps=0.0, const bool single=false)
Constructor.
SparseMatrix(const SparseMatrix< H > &fncX, F fnc(const H &))
Constructor.
Definition: sparseMatrix.hh:482
_HashedSMatrix_iterator< F, const F &, const F * > const_iterator
Definition: sparseMatrix.hh:76
SparseMatrix(const SparseMatrix< H > &fncX, const F &fnc(const H &))
Definition: sparseMatrix.hh:518
virtual void convertIJK(F *, int *, int *) const
virtual void operator()(const Function< r_type > &fncY, Function< F > &fncX)
void addT(const Vector< H > &v, const I fact, const uint rowoffset=0, const uint coloffset=0)
Copies the transpose of the vector v multiplied by fact on position (rowoffset, coloffset)
Definition: sparseMatrix.hh:613
Sequence with operations, output operator, and method of the particular element types.
Definition: sequence.hh:39
SparseMatrix(const Space< G > &spc, const BilinearForm< F, G > &bf, const Sequence< ElementWithCell< G > * > &seq, const Real eps=0.0)
Constructor.
virtual void convertCRS(F *a, int *asub, int *xa) const
static uint storeMatlabCounter_
Counts number of Matlab outputs (used to uniquely name the matrices)
Definition: sparseMatrix.hh:470
iterator begin(uint row=0)
Iterator over the elements, standing at position (row,c), where row is the given row number and c the...
SparseMatrix(const SparseMatrix< F > &m, bool t=false)
Copy constructor.
SparseMatrix< F > & operator*=(const F factor)
Definition: sparseMatrix.hh:355
virtual void operator()(const Function< c_type > &fncY, Function< c_type > &fncX)
void multiply(const SparseMatrix< F > &fact, Matrix< F > &dest) const
Multiplies this matrix with fact and adds the result to dest.
Definition: sparseMatrix.hh:424
SparseMatrix(const Space< G > &spcX, const Space< G > &spcY, const BilinearForm< F, G > &bf, const Real eps=0.0, const bool single=false)
Constructor.
const_iterator begin(uint row=0) const
Constant iterator over the elements, standing at position (row,c), where row is the given row number ...
void addIntoT(Matrix< H > &dest, const I fact, const uint rowoffset=0, const uint coloffset=0) const
The transposed of this matrix is added as block to the given matrix.
Definition: sparseMatrix.hh:567
Values of a matrix in sparse notation.
Definition: hashedSMatrix.hh:57
virtual std::ostream & info(std::ostream &os) const
Definition: sequence.hh:348
virtual void transpMult(const Vector< r_type > &fncY, Vector< F > &fncX)
Multiplies the transpose of the matrix with fncY and adds the results to fncX.
STL like iterator for hashed sparse matrices.
Definition: hashedSMatrixIterator.hh:29
SparseMatrix(const Space< G > &spc, const BilinearForm< F, G > &bf, const Real eps=0.0)
Constructor.
#define conceptsAssert3(cond, exc, msg)
Assert that a certain condition is fulfilled.
Definition: exceptions.hh:442
void matrixMultiplyRowSorting(const F &factL, const G &factR, Matrix< H > &dest)
Multiplies two matrices, which deliver at least a row sorted iterator, and adds (!...
Definition: matrixMult.hh:28
virtual F operator()(const uint i, const uint j) const
Definition: sparseMatrix.hh:351
virtual F & operator()(const uint i, const uint j)
Definition: sparseMatrix.hh:353
SparseMatrix(const Space< typename Realtype< F >::type > &spc, const BilinearFormContainer< F > bf, const Real eps=0.0)
Constructor.
SparseMatrix(const Space< G > &spc, const F *const v, const int i=-1)
Constructor of partial rank 1 matrix.
SparseMatrix(const Space< G > &spcX, const Space< G > &spcY, const BilinearForm< F, G > &bf, const Sequence< ElementWithCell< G > * > &seq, const Real eps=0.0)
Constructor.