chrono::ChSparsityPatternLearner Class Reference

Description

A dummy matrix that gets only sparsity pattern infos.

ChSparsityPatternLearner estimates the sparsity pattern without actually allocating any value. It is meant to be used together with ChCSR3Matrix in order to improve the building of the latter.

#include <ChCSR3Matrix.h>

Inheritance diagram for chrono::ChSparsityPatternLearner:
Collaboration diagram for chrono::ChSparsityPatternLearner:

Public Member Functions

 ChSparsityPatternLearner (int nrows, int ncols, bool row_major_format_in=true)
 
void SetElement (int insrow, int inscol, double insval, bool overwrite=true) override
 
double GetElement (int row, int col) const override
 
void Reset (int row, int col, int nonzeros=0) override
 
bool Resize (int nrows, int ncols, int nonzeros=0) override
 
std::vector< std::list< int > > & GetSparsityPattern ()
 
bool isRowMajor () const
 
int GetNNZ () const override
 Get the number of non-zero elements in this matrix.
 
- Public Member Functions inherited from chrono::ChSparseMatrix
 ChSparseMatrix (int nrows=0, int ncols=0, int nnz=0)
 Construct a sparse matrix with 'nrows' and 'ncols' and with 'nnz' non-zero elements. More...
 
 ChSparseMatrix (const ChSparseMatrix &other)
 
int GetNumRows () const
 Get the number of rows of this matrix.
 
int GetNumColumns () const
 Get the number of columns of this matrix.
 
void SetType (SymmetryType type)
 Set the symmetry type for this sparse matrix (default: GENERAL). More...
 
SymmetryType GetType () const
 Return the symnmetery type of this matrix.
 
void SetSparsityPatternLock (bool val)
 Enable/disable a lock on the matrix sparsity pattern (default: false).
 
virtual void LoadSparsityPattern (ChSparsityPatternLearner &sparsity_learner)
 (Optional) Force the update of the sparsity pattern More...
 
virtual bool Compress ()
 Optional compression method, typically invoked after all elements have been inserted. More...
 
virtual void PasteMatrix (const ChMatrix<> &matra, int insrow, int inscol, bool overwrite=true, bool transp=false)
 Paste the specified matrix into this sparse matrix at (insrow,inscol).
 
virtual void PasteClippedMatrix (const ChMatrix<> &matra, int cliprow, int clipcol, int nrows, int ncolumns, int insrow, int inscol, bool overwrite=true)
 Paste a clipped portion of the specified matrix into this sparse matrix at (insrow,inscol).
 
virtual int * GetCSR_LeadingIndexArray () const
 Return the row index array in the CSR representation of this matrix.
 
virtual int * GetCSR_TrailingIndexArray () const
 Return the column index array in the CSR representation of this matrix.
 
virtual double * GetCSR_ValueArray () const
 Return the array of matrix values in the CSR representation of this matrix.
 
virtual void PasteTranspMatrix (const ChMatrix<> &matra, int insrow, int inscol)
 
virtual void PasteSumMatrix (const ChMatrix<> &matra, int insrow, int inscol)
 
virtual void PasteSumTranspMatrix (const ChMatrix<> &matra, int insrow, int inscol)
 
virtual void PasteSumClippedMatrix (const ChMatrix<> &matra, int cliprow, int clipcol, int nrows, int ncolumns, int insrow, int inscol)
 

Protected Attributes

std::vector< std::list< int > > row_lists
 
bool row_major_format = true
 
int * leading_dimension
 
int * trailing_dimension
 
- Protected Attributes inherited from chrono::ChSparseMatrix
int m_num_rows
 number of rows
 
int m_num_cols
 number of columns
 
int m_nnz
 number of non-zero elements
 
SymmetryType m_type = GENERAL
 matrix type
 
bool m_lock = false
 indicate whether or not the matrix sparsity pattern should be locked
 
bool m_update_sparsity_pattern = false
 let the matrix acquire the sparsity pattern
 

Additional Inherited Members

- Public Types inherited from chrono::ChSparseMatrix
enum  SymmetryType { GENERAL, SYMMETRIC_POSDEF, SYMMETRIC_INDEF, STRUCTURAL_SYMMETRIC }