27template <Config Conf,
class StorageIndex>
54template <Config Conf,
class StorageIndex>
104template <Config Conf>
110template <
class... Ts>
112 using Ts::operator()...;
114template <
class... Ts>
119template <Config Conf>
123 [](
const auto &) {
return false; },
129template <Config Conf>
132 [](
const Dense<Conf> &d) {
return d.rows * d.cols; },
133 [](
const auto &s) {
return s.nnz(); },
139template <Config Conf>
141 return std::visit([](
const auto &s) {
return s.symmetry; },
sp);
147using sparsity::Sparsity;
#define USING_ALPAQA_CONFIG(Conf)
Symmetry
Describes the symmetry of matrices.
@ Unsymmetric
No symmetry.
@ Upper
Symmetric, upper-triangular part is stored.
@ Lower
Symmetric, lower-triangular part is stored.
length_t< Conf > get_nnz(const Sparsity< Conf > &sp)
Get the number of structurally nonzero elements.
bool is_dense(const Sparsity< Conf > &sp)
Returns true if the sparsity pattern represents a dense matrix.
Symmetry get_symmetry(const Sparsity< Conf > &sp)
Returns the symmetry of the sparsity pattern.
std::variant< Dense< Conf >, SparseCSC< Conf, int >, SparseCSC< Conf, long >, SparseCSC< Conf, long long >, SparseCOO< Conf, int >, SparseCOO< Conf, long >, SparseCOO< Conf, long long > > SparsityVariant
typename Conf::length_t length_t
Sparse coordinate list structure (COO).
Eigen::Map< const index_vector_t > index_vector_map_t
index_vector_view_t col_indices
storage_index_t first_index
Zero for C/C++, one for Fortran.
Eigen::Ref< const index_vector_t > index_vector_view_t
length_t nnz() const
Get the number of structurally nonzero elements.
Eigen::VectorX< storage_index_t > index_vector_t
StorageIndex storage_index_t
index_vector_view_t row_indices
@ SortedByRowsAndCols
The indices are sorted by row first, and within each row, the columns are sorted as well.
@ SortedByColsAndRows
The indices are sorted by column first, and within each column, the rows are sorted as well.
@ SortedByRowsOnly
The indices are sorted by row, but the columns within each row are not sorted.
@ Unsorted
The indices are not sorted.
@ SortedByColsOnly
The indices are sorted by column, but the rows within each column are not sorted.
Sparse compressed-column structure (CCS or CSC).
Eigen::Map< const index_vector_t > index_vector_map_t
index_vector_view_t outer_ptr
Eigen::Ref< const index_vector_t > index_vector_view_t
length_t nnz() const
Get the number of structurally nonzero elements.
Eigen::VectorX< storage_index_t > index_vector_t
StorageIndex storage_index_t
index_vector_view_t inner_idx
@ Unsorted
The row indices are not sorted.
@ SortedRows
Within each column, all row indices are sorted in ascending order.
Stores any of the supported sparsity patterns.