Struct csmatrix

Struct Documentation

struct csmatrix

Representation of a sparse matrix in a compressed, row-major format.

It should be noted that once initialized, the # rows/columns cannot be changed. Yes, I know that there are other (probably more optimized) implementations out there, but sometimes you cannot use them (platform, licensing, etc.), hence this module. It assumes row-major ordering.

Public Members

struct darray inner_indices

Holds the row indices of the non-zero entries in the matrix.

struct darray outer_starts

Holds the index of first nonzero in the inner_indices array for each row.

struct darray values

Holds the coefficient values of the non-zeros.

size_t n_rows

Initial number of rows in the matrix.

size_t n_cols

Initial number of columns in the matrix.

size_t n_nz_elts

Number of non-zero entries in the matrix.

size_t n_eff_cols

Number of unique indices in the inner indices array.

uint32_t flags

Configuration flags. Valid flags are:

All other flags are ignored.

enum csmatrix_type type

What type of numbers the matrix will contain

struct llist *cols

Array of linked lists, one per column, containing the row indices that for that column. Necessary for transposes so things don’t take FOREVER.

uint8_t *nodes

Space for link list nodes (use one contiguous block to improve cache performance)

uint8_t *elts

Space for link list elements (use one contiguous block to improve cache performance)

int *csizes