28template <Config Conf,
class StorageIndex>
55template <Config Conf,
class StorageIndex>
105template <Config Conf>
112template <
class... Ts>
114 using Ts::operator()...;
116template <
class... Ts>
121template <Config Conf>
125 [](
const auto &) {
return false; },
131template <Config Conf>
134 [](
const Dense<Conf> &d) {
return d.rows * d.cols; },
135 [](
const auto &s) {
return s.nnz(); },
141template <Config Conf>
143 return std::visit([](
const auto &s) {
return s.symmetry; },
sp.value);
149using 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.
SparsityVariant< Conf > value
Sparsity(std::convertible_to< SparsityVariant< Conf > > auto value)