#include <format.h>
An matrix is stored CSR format using three arrays, , and a constant base index , such that
If the full non-zero pattern is stored, then the matrix elements are computed as follows:
If the matrix is symmetric or Hermitian and the upper triangle is stored, then are computed as above only for . If instead the lower triangle is stored, then are computed as above only for .
If all the diagonal elements are identically 1 but not explicitly stored, then . Otherwise, any non-zero diagonal elements must be stored explicitly.
If the matrix is logically upper triangular, then only elements such that are stored.
If instead the matrix is logically lower triangular, then only elements such that are stored.
Data Fields | |
oski_index_t | base_index |
Integer index starting value (0 or 1). | |
int | has_unit_diag_implicit |
for all diagonal elements and no diagonal elements are explicitly stored; 0 otherwise. | |
int | has_sorted_indices |
within each row, the column indices are sorted in increasing order; 0 otherwise. | |
struct { | |
int is_upper | |
Upper triangle stored. | |
int is_lower | |
Lower triangle stored. | |
} | stored |
Mutually exclusive non-zero pattern properties. | |
oski_index_t * | ptr |
Row pointers. | |
oski_index_t * | ind |
Column indices. | |
oski_value_t * | val |
Stored values. | |
int | is_shared |
Buffers ptr, ind, val are shared. |
|
Mutually exclusive non-zero pattern properties. These properties work in conjunction with the 'pattern' properties in oski_matcommon_t. If the matrix is symmetric or Hermitian, then one of these flags indicates which non-zero values are actually stored. is_upper == is_lower <==> full storage. If the matrix is triangular, these flags are ignored. |