|
auto | mat_set_values () |
| Insertion functor for setting values in matrix. It is typically used in finite element assembly functions. More...
|
|
auto | mat_add_values () |
| Insertion functor for accumulating values in matrix. It is typically used in finite element assembly functions. More...
|
|
| MatrixCSR (const SparsityPattern &p, const Allocator &alloc=Allocator()) |
| Create a distributed matrix. More...
|
|
| MatrixCSR (MatrixCSR &&A)=default |
| Move constructor. More...
|
|
void | set (T x) |
| Set all non-zero local entries to a value including entries in ghost rows. More...
|
|
void | set (const std::span< const T > &x, const std::span< const std::int32_t > &rows, const std::span< const std::int32_t > &cols) |
| Set values in the matrix. More...
|
|
void | add (const std::span< const T > &x, const std::span< const std::int32_t > &rows, const std::span< const std::int32_t > &cols) |
| Accumulate values in the matrix. More...
|
|
std::int32_t | num_owned_rows () const |
| Number of local rows excluding ghost rows.
|
|
std::int32_t | num_all_rows () const |
| Number of local rows including ghost rows.
|
|
std::vector< T > | to_dense () const |
| Copy to a dense matrix. More...
|
|
void | finalize () |
| Transfer ghost row data to the owning ranks accumulating received values on the owned rows, and zeroing any existing data in ghost rows.
|
|
void | finalize_begin () |
| Begin transfer of ghost row data to owning ranks, where it will be accumulated into existing owned rows. More...
|
|
void | finalize_end () |
| End transfer of ghost row data to owning ranks. More...
|
|
double | norm_squared () const |
| Compute the Frobenius norm squared.
|
|
const std::array< std::shared_ptr< const common::IndexMap >, 2 > & | index_maps () const |
| Index maps for the row and column space. The row IndexMap contains ghost entries for rows which may be inserted into and the column IndexMap contains all local and ghost columns that may exist in the owned rows. More...
|
|
std::vector< T > & | values () |
| Get local data values. More...
|
|
const std::vector< T > & | values () const |
| Get local values (const version) More...
|
|
const std::vector< std::int32_t > & | row_ptr () const |
| Get local row pointers. More...
|
|
const std::vector< std::int32_t > & | cols () const |
| Get local column indices. More...
|
|
const std::vector< std::int32_t > & | off_diag_offset () const |
| Get the start of off-diagonal (unowned columns) on each row, allowing the matrix to be split (virtually) into two parts. Operations (such as matrix-vector multiply) between the owned parts of the matrix and vector can then be performed separately from operations on the unowned parts. More...
|
|
template<typename T, class Allocator = std::allocator<T>>
class dolfinx::la::MatrixCSR< T, Allocator >
Distributed sparse matrix.
The matrix storage format is compressed sparse row. The matrix is partitioned row-wise across MPI rank.
- Template Parameters
-
T | The data type for the matrix |
Allocator | The memory allocator type for the data storage |
- Note
- Highly "experimental" storage of a matrix in CSR format which can be assembled into using the usual dolfinx assembly routines Matrix internal data can be accessed for interfacing with other code.
- Todo:
- Handle block sizes