|
HermesCommon 1.0
|
General (abstract) sparse matrix representation in Hermes. More...
#include <matrix.h>
Classes | |
| struct | Page |
| Structure for storing indices in sparse matrix. More... | |
Public Member Functions | |
| SparseMatrix (unsigned int size) | |
| virtual void | prealloc (unsigned int n) |
| virtual void | pre_add_ij (unsigned int row, unsigned int col) |
| virtual void | finish () |
| Finish manipulation with matrix (called before solving) | |
| virtual unsigned int | get_size () |
| virtual void | add_sparse_matrix (SparseMatrix *mat) |
| virtual void | add_sparse_to_diagonal_blocks (int num_stages, SparseMatrix< Scalar > *mat) |
| virtual int | get_num_row_entries (unsigned int row) |
| virtual void | extract_row_copy (unsigned int row, unsigned int len, unsigned int &n_entries, double *vals, unsigned int *idxs) |
| virtual int | get_num_col_entries (unsigned int col) |
| virtual void | extract_col_copy (unsigned int col, unsigned int len, unsigned int &n_entries, double *vals, unsigned int *idxs) |
| virtual void | multiply_with_vector (Scalar *vector_in, Scalar *vector_out) |
| Multiply with a vector. | |
| virtual void | multiply_with_Scalar (Scalar value) |
| Multiply with a Scalar. | |
| virtual SparseMatrix * | duplicate () |
| Duplicate sparse matrix (including allocation). | |
| virtual double | get_fill_in () const =0 |
| Get fill-in. | |
| virtual unsigned int | get_nnz () const |
Public Attributes | |
| unsigned | row_storage:1 |
| unsigned | col_storage:1 |
Protected Member Functions | |
| int | sort_and_store_indices (Page *page, int *buffer, int *max) |
| int | get_num_indices () |
Protected Attributes | |
| Page ** | pages |
| array of pages with indices array. Each field of arra contains pages for one column | |
| int | mem_size |
| mem stat | |
Static Protected Attributes | |
| static const int | PAGE_SIZE = 62 |
| Size of page (max number of indices stored in one page). | |
General (abstract) sparse matrix representation in Hermes.
| Hermes::Algebra::SparseMatrix< Scalar >::SparseMatrix | ( | unsigned int | size | ) |
Constructor of sparse matrix
| [in] | size | size of matrix |
Definition at line 131 of file matrix.cpp.
| virtual void Hermes::Algebra::SparseMatrix< Scalar >::add_sparse_matrix | ( | SparseMatrix< Scalar > * | mat | ) | [inline, virtual] |
| virtual void Hermes::Algebra::SparseMatrix< Scalar >::add_sparse_to_diagonal_blocks | ( | int | num_stages, |
| SparseMatrix< Scalar > * | mat | ||
| ) | [inline, virtual] |
Add matrix to diagonal Matrices must be the same type of solver
| [in] | num_stages | matrix is added to num_stages positions. num_stages * size(added matrix) = size(target matrix) |
| [in] | mat | added matrix |
Reimplemented in Hermes::Algebra::CSCMatrix< Scalar >.
| virtual void Hermes::Algebra::SparseMatrix< Scalar >::extract_col_copy | ( | unsigned int | col, |
| unsigned int | len, | ||
| unsigned int & | n_entries, | ||
| double * | vals, | ||
| unsigned int * | idxs | ||
| ) | [inline, virtual] |
Extract the copy of a column
| [in] | col | - global column to extract |
| [in] | len | - length of 'vals' and 'idxs' arrays. |
| [out] | n_entries | - number of nonzero entries extracted. |
| [out] | vals | - extracted values for this column. |
| [out] | idxs | - extracted global row indices for the corresponding values. |
| virtual void Hermes::Algebra::SparseMatrix< Scalar >::extract_row_copy | ( | unsigned int | row, |
| unsigned int | len, | ||
| unsigned int & | n_entries, | ||
| double * | vals, | ||
| unsigned int * | idxs | ||
| ) | [inline, virtual] |
Extract the copy of a row
| [in] | row | - global row to extract |
| [in] | len | - length of 'vals' and 'idxs' arrays. |
| [out] | n_entries | - number of nonzero entries extracted. |
| [out] | vals | - extracted values for this row. |
| [out] | idxs | - extracted global column indices for the corresponding values. |
| virtual unsigned int Hermes::Algebra::SparseMatrix< Scalar >::get_nnz | ( | ) | const [inline, virtual] |
get number of nonzero numbers in matrix
Reimplemented in Hermes::Algebra::CSCMatrix< Scalar >.
| virtual int Hermes::Algebra::SparseMatrix< Scalar >::get_num_col_entries | ( | unsigned int | col | ) | [inline, virtual] |
| int Hermes::Algebra::SparseMatrix< Scalar >::get_num_indices | ( | ) | [protected] |
get number of indices in all pages
Definition at line 197 of file matrix.cpp.
| virtual int Hermes::Algebra::SparseMatrix< Scalar >::get_num_row_entries | ( | unsigned int | row | ) | [inline, virtual] |
| virtual unsigned int Hermes::Algebra::SparseMatrix< Scalar >::get_size | ( | ) | [inline, virtual] |
get size of matrix
Reimplemented from Hermes::Algebra::Matrix< Scalar >.
Definition at line 370 of file matrix.h.
Referenced by Hermes::Algebra::CSCMatrix< Scalar >::add_matrix(), and Hermes::Algebra::CSCMatrix< Scalar >::add_to_diagonal_blocks().
| void Hermes::Algebra::SparseMatrix< Scalar >::pre_add_ij | ( | unsigned int | row, |
| unsigned int | col | ||
| ) | [virtual] |
add indices of nonzero matrix element
| [in] | row | - row index |
| [in] | col | - column index |
Definition at line 162 of file matrix.cpp.
| void Hermes::Algebra::SparseMatrix< Scalar >::prealloc | ( | unsigned int | n | ) | [virtual] |
| int Hermes::Algebra::SparseMatrix< Scalar >::sort_and_store_indices | ( | Page * | page, |
| int * | buffer, | ||
| int * | max | ||
| ) | [protected] |
gather all pages in the buffer, delete them, sort buffer and remove duplicities
| [in] | page | first page with indices |
| [out] | buffer | buffer to which indices will be copied |
| [in] | max | maximum indices to be stored (probably) |
Definition at line 175 of file matrix.cpp.
| unsigned Hermes::Algebra::SparseMatrix< Scalar >::col_storage |
| unsigned Hermes::Algebra::SparseMatrix< Scalar >::row_storage |
1.7.4