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

Matrix — the engine's immutable homomorphism F -> G between free modules. More...

#include "monoid.hpp"
#include "freemod.hpp"
#include "monideal.hpp"
#include <vector>

Go to the source code of this file.

Classes

class  Matrix
 Engine-side matrix: a map between two free modules, stored as a column-vector list. More...
class  Matrix::iterator
 Reseatable iterator over the non-zero entries of one column of the matrix. More...
class  Matrix::column_iterator
 Standards-style forward iterator over the vecterms of one column. More...

Detailed Description

Matrix — the engine's immutable homomorphism F -> G between free modules.

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

Declares Matrix, an EngineObject whose entries are stored as one vec per column over the target free module. State comprises the target and source FreeModule*s, a single monomial mDegreeShift in the degree monoid applied uniformly to every entry's degree (used by graded computations), and the column array gc_vector<vec> mEntries. Matrix is immutable by design — every "modifying" operation returns a fresh instance — which is what lets the engine share matrices safely and memoise derived data like bases and kernels.

Construction goes through MatrixConstructor (matrix-con.hpp): the actual constructor is private, called only by the builder (FreeModule also friends the class for its own internal needs), so matrices reach the outside world only after degree-compatibility validation. Routine matrix operations (add, subtract, mult, negate, transpose, submatrix, direct_sum, tensor, lead_term, homogenize, ...) live in matrix.cpp; specialised operations are split into matrix-kbasis.cpp, matrix-ncbasis.cpp, matrix-sort.cpp, matrix-stream.cpp, and matrix-symm.cpp. Mutable matrix arithmetic lives in mutablemat.hpp instead.

See also
freemod.hpp
matrix-con.hpp
mutablemat.hpp

Definition in file matrix.hpp.