Struct matrix

Struct Documentation

struct matrix

Representation of a fixed-size (static) matrix using a single contiguous array and indexing said array in 2 dimensions.

Static in the sense that the matrix dimensions cannot be changed after initialization. Assumes row-major order (this is C after all).

Should only be used for applications where the matrix is dense, or when the dimensions of the matrix are small (if the dimensions are large AND the matrix is sparse, it will definitely be really inefficient, and possibly won’t even fit into memory).

Public Members

size_t n_rows

of rows in matrix.

size_t n_cols

of columns in matrix.

dptr_t *elements

Matrix data.

uint32_t flags

Run-time configuration flags. Valid flags are:

All other flags ignored.

size_t elt_size

Size of matrix elements in bytes.

void (*printe)(const void *const e)

For printing an element. Can be NULL.