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.
|Integer index starting value (0 or 1). |
| for all diagonal elements and no diagonal elements are explicitly stored; 0 otherwise. |
| within each row, the column indices are sorted in increasing order; 0 otherwise. |
|Upper triangle stored. |
|Lower triangle stored. |
|Mutually exclusive non-zero pattern properties. |
|Row pointers. |
|Column indices. |
|Stored values. |
|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.