|
guanaqo
1.0.0-alpha.24
Utilities for scientific software
|
Sparse matrix data structures.
Guanaqo supports the following (sparse) matrix formats:
The guanaqo::linalg::sparsity::Sparsity class is a type-erased wrapper around these various formats. Conversions between formats are supported by the guanaqo::linalg::sparsity::SparsityConverter<Sparsity,To> class (see Sparsity Conversions). The desired index options (zero/one-based, sorted/unsorted) can be specified using the guanaqo::linalg::sparsity::SparsityConversionRequest struct. While the conversions convert only the sparsity structure by default, they remember the original structure, and can be used to repeatedly convert the values as well. This is useful in optimization solvers, for example, where the sparsity structures of the Hessians and Jacobians are fixed, but the values change at each iteration.
Topics | |
| Sparsity Conversions | |
| Sparse matrix conversions. | |
| Sparsity Utilities | |
| Sparse matrix utilities for sorting indices, checking uniqueness, etc. | |
Files | |
| file | sparsity.hpp |
| Sparse and dense sparsity descriptors. | |
Classes | |
| struct | guanaqo::linalg::sparsity::Dense |
| Dense matrix structure. More... | |
| struct | guanaqo::linalg::sparsity::SparseCSC< Index, StorageIndex > |
| Sparse compressed-column structure (CCS or CSC). More... | |
| struct | guanaqo::linalg::sparsity::SparseCOO< Index > |
| Sparse coordinate list structure (COO). More... | |
| struct | guanaqo::linalg::sparsity::Sparsity |
| Stores any of the supported sparsity patterns. More... | |
Typedefs | |
| using | guanaqo::linalg::sparsity::SparsityVariant |
| Helper for Sparsity. | |
Enumerations | |
| enum class | guanaqo::linalg::sparsity::Symmetry : uint8_t { guanaqo::linalg::sparsity::Symmetry::Unsymmetric = 0 , guanaqo::linalg::sparsity::Symmetry::Upper = 1 , guanaqo::linalg::sparsity::Symmetry::Lower = 2 } |
| Describes the symmetry of matrices. More... | |
Functions | |
| const char * | guanaqo::linalg::sparsity::enum_name (Symmetry s) |
| bool | guanaqo::linalg::sparsity::is_dense (const Sparsity &sp) |
| Returns true if the sparsity pattern represents a dense matrix. | |
| length_t | guanaqo::linalg::sparsity::get_nnz (const Sparsity &sp) |
| Get the number of structurally nonzero elements. | |
| Symmetry | guanaqo::linalg::sparsity::get_symmetry (const Sparsity &sp) |
| Returns the symmetry of the sparsity pattern. | |
| length_t | guanaqo::linalg::sparsity::num_rows (const Sparsity &sp) |
| Returns the number of rows of the sparsity pattern. | |
| length_t | guanaqo::linalg::sparsity::num_cols (const Sparsity &sp) |
| Returns the number of rows of the sparsity pattern. | |
| struct guanaqo::linalg::sparsity::Dense |
| Class Members | ||
|---|---|---|
| length_t | rows = 0 | |
| length_t | cols = 0 | |
| Symmetry | symmetry = Symmetry::Unsymmetric | |
#include <guanaqo/linalg/sparsity.hpp>
Helper for Sparsity.
Definition at line 103 of file sparsity.hpp.
|
strong |
#include <guanaqo/linalg/sparsity.hpp>
Describes the symmetry of matrices.
| Enumerator | |
|---|---|
| Unsymmetric | No symmetry. |
| Upper | Symmetric, upper-triangular part is stored. |
| Lower | Symmetric, lower-triangular part is stored. |
Definition at line 20 of file sparsity.hpp.
|
inline |
#include <guanaqo/linalg/sparsity.hpp>
Definition at line 26 of file sparsity.hpp.
|
inline |
#include <guanaqo/linalg/sparsity.hpp>
Returns true if the sparsity pattern represents a dense matrix.
Definition at line 139 of file sparsity.hpp.
#include <guanaqo/linalg/sparsity.hpp>
Get the number of structurally nonzero elements.
Definition at line 148 of file sparsity.hpp.
#include <guanaqo/linalg/sparsity.hpp>
Returns the symmetry of the sparsity pattern.
Definition at line 157 of file sparsity.hpp.
#include <guanaqo/linalg/sparsity.hpp>
Returns the number of rows of the sparsity pattern.
Definition at line 162 of file sparsity.hpp.
#include <guanaqo/linalg/sparsity.hpp>
Returns the number of rows of the sparsity pattern.
Definition at line 167 of file sparsity.hpp.