Macaulay2 Engine
Loading...
Searching...
No Matches
smat.hpp File Reference

SMat<ACoeffRing> — column-oriented sparse matrix template, dual of DMat<R>. More...

#include "ZZp.hpp"

Go to the source code of this file.

Classes

class  SMat< ACoeffRing >
struct  SMat< ACoeffRing >::sparsevec
class  SMat< ACoeffRing >::iterator

Detailed Description

SMat<ACoeffRing> — column-oriented sparse matrix template, dual of DMat<R>.

Note
AI-generated documentation. Verify against the source before relying on it.

Declares SMat<ACoeffRing>, the engine's sparse-matrix template parameterised on a coefficient ring's aring. Storage is an array of column heads, each pointing at a linked list of (row_index, value) nodes sorted by ascending row index; memory is O(non-zeros) rather than O(rows * cols). The column-oriented layout matches the engine's matrix algorithms — column echelon form, Gauss reduction by column, column-wise elimination — which all walk one column at a time. Row scans are slow by design.

The class is the sparse counterpart of dmat.hpp's DMat<R> and pairs with mat-elem-ops.hpp's MatElementaryOps for the row / column primitive surface. MutableMatrix is the abstract front-end that hides the dense / sparse choice behind a uniform virtual interface.

See also
dmat.hpp
mat.hpp
mat-elem-ops.hpp

Definition in file smat.hpp.