guanaqo main
Utilities for scientific software
Loading...
Searching...
No Matches
guanaqo::linalg::sparsity::SparseCOO< Index > Struct Template Reference

#include <guanaqo/linalg/sparsity.hpp>

Detailed Description

template<class Index = index_t>
struct guanaqo::linalg::sparsity::SparseCOO< Index >

Sparse coordinate list structure (COO).

Definition at line 70 of file sparsity.hpp.

Collaboration diagram for guanaqo::linalg::sparsity::SparseCOO< Index >:

Public Types

enum  Order : uint8_t {
  Unsorted = 0 , SortedByColsAndRows = 1 , SortedByColsOnly = 2 , SortedByRowsAndCols = 3 ,
  SortedByRowsOnly = 4
}
using index_t = Index

Public Member Functions

length_t nnz () const
 Get the number of structurally nonzero elements.

Public Attributes

length_t rows = 0
length_t cols = 0
Symmetry symmetry = Symmetry::Unsymmetric
std::span< const index_trow_indices {}
std::span< const index_tcol_indices {}
Order order = Unsorted
index_t first_index = 0
 Zero for C/C++, one for Fortran.

Member Typedef Documentation

◆ index_t

template<class Index = index_t>
using guanaqo::linalg::sparsity::SparseCOO< Index >::index_t = Index

Definition at line 71 of file sparsity.hpp.

Member Enumeration Documentation

◆ Order

template<class Index = index_t>
enum guanaqo::linalg::sparsity::SparseCOO::Order : uint8_t
Enumerator
Unsorted 

The indices are not sorted.

SortedByColsAndRows 

The indices are sorted by column first, and within each column, the rows are sorted as well.

SortedByColsOnly 

The indices are sorted by column, but the rows within each column are not sorted.

SortedByRowsAndCols 

The indices are sorted by row first, and within each row, the columns are sorted as well.

SortedByRowsOnly 

The indices are sorted by row, but the columns within each row are not sorted.

Definition at line 76 of file sparsity.hpp.

Member Function Documentation

◆ nnz()

template<class Index = index_t>
length_t guanaqo::linalg::sparsity::SparseCOO< Index >::nnz ( ) const
inlinenodiscard

Get the number of structurally nonzero elements.

Definition at line 96 of file sparsity.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ rows

template<class Index = index_t>
length_t guanaqo::linalg::sparsity::SparseCOO< Index >::rows = 0

Definition at line 72 of file sparsity.hpp.

◆ cols

template<class Index = index_t>
length_t guanaqo::linalg::sparsity::SparseCOO< Index >::cols = 0

Definition at line 72 of file sparsity.hpp.

◆ symmetry

template<class Index = index_t>
Symmetry guanaqo::linalg::sparsity::SparseCOO< Index >::symmetry = Symmetry::Unsymmetric

Definition at line 73 of file sparsity.hpp.

◆ row_indices

template<class Index = index_t>
std::span<const index_t> guanaqo::linalg::sparsity::SparseCOO< Index >::row_indices {}

Definition at line 74 of file sparsity.hpp.

◆ col_indices

template<class Index = index_t>
std::span<const index_t> guanaqo::linalg::sparsity::SparseCOO< Index >::col_indices {}

Definition at line 75 of file sparsity.hpp.

◆ order

template<class Index = index_t>
Order guanaqo::linalg::sparsity::SparseCOO< Index >::order = Unsorted

Definition at line 92 of file sparsity.hpp.

◆ first_index

template<class Index = index_t>
index_t guanaqo::linalg::sparsity::SparseCOO< Index >::first_index = 0

Zero for C/C++, one for Fortran.

Definition at line 93 of file sparsity.hpp.


The documentation for this struct was generated from the following file: