Macaulay2 Engine
Loading...
Searching...
No Matches
Matrix Class Reference

Engine-side matrix: a map between two free modules, stored as a column-vector list. More...

#include <matrix.hpp>

Inheritance diagram for Matrix:
EngineObject our_new_delete

Classes

class  iterator
 Reseatable iterator over the non-zero entries of one column of the matrix. More...
class  column_iterator
 Standards-style forward iterator over the vecterms of one column. More...

Public Member Functions

const Matrixremake (const FreeModule *target, const FreeModule *source, M2_arrayint deg) const
const Matrixremake (const FreeModule *target) const
const Ringget_ring () const
vec & operator[] (int i)
const vec & operator[] (int i) const
ring_elem elem (int i, int j) const
vec & elem (int i)
const vec & elem (int i) const
const FreeModulerows () const
const FreeModulecols () const
int n_rows () const
int n_cols () const
const_monomial degree_shift () const
MonomialIdealmake_monideal (int n, bool use_only_monomials_with_unit_coeffs=false) const
Matrixclean (gmp_RR epsilon) const
gmp_RRorNull norm (gmp_RR p) const
Matrixsub_matrix (M2_arrayint r, M2_arrayint c) const
Matrixsub_matrix (M2_arrayint c) const
Matrixtranspose () const
Matrixoperator+ (const Matrix &m) const
Matrixoperator- () const
Matrixoperator- (const Matrix &m) const
Matrixscalar_mult (const ring_elem r, bool opposite_mult) const
Matrixmult (const Matrix *m, bool opposite_mult) const
Matrixconcat (const Matrix &m) const
Matrixkoszul (int p) const
Matrixreshape (const FreeModule *G, const FreeModule *H) const
Matrixdirect_sum (const Matrix *m) const
Matrixmodule_tensor (const Matrix *m) const
Matrixtensor (const Matrix *m) const
Matrixdiff (const Matrix *m, int use_coef) const
Matrixsymm (int n) const
Matrixcoeffs (M2_arrayint vars, const Matrix *monoms) const
Matrixmonomials (M2_arrayint vars) const
M2_arrayintOrNull support () const
Matrixtop_coefficients (Matrix *&monoms) const
const Matrixbasis (M2_arrayint lo_degree, M2_arrayint hi_degree, M2_arrayint wt, M2_arrayint vars, bool do_truncation, int limit) const
Matrixexterior (int p, int strategy) const
Matrixminors (int p, int strategy) const
Matrixminors (int p, int strategy, int n_to_compute, M2_arrayintOrNull first_row, M2_arrayintOrNull first_col) const
Matrixpfaffians (int p) const
ring_elem pfaffian () const
bool is_equal (const Matrix &m) const
bool is_zero () const
bool is_homogeneous () const
Matrixhomogenize (int v, const std::vector< int > &wts) const
Matrixsimplify (int n) const
Matrixauto_reduce () const
M2_arrayint sort (int degorder, int monorder) const
Matrixlead_term (int n=-1) const
int dimension1 () const
const Matrixcontent () const
const Matrixremove_content () const
const Matrixsplit_off_content (const Matrix *&result) const
void minimal_lead_terms (gc_vector< int > &result) const
M2_arrayint elim_vars (int nparts) const
M2_arrayint elim_keep (int nparts) const
Matrixdivide_by_var (int n, int maxd, int &maxdivided) const
Matrixcompress () const
Matrixremove_monomial_factors (bool make_squarefree_only) const
Matrixremove_scalar_multiples () const
void text_out (buffer &o) const
Public Member Functions inherited from EngineObject
 EngineObject ()
virtual ~EngineObject ()
unsigned int hash () const

Static Public Member Functions

static const Matrixmake (const FreeModule *target, int ncols, const engine_RawRingElementArray M)
static const Matrixmake (const FreeModule *target, const FreeModule *source, M2_arrayint deg, const engine_RawRingElementArray M)
static const Matrixmake_sparse (const FreeModule *target, int ncols, M2_arrayint rows, M2_arrayint cols, const engine_RawRingElementArray entries)
static const Matrixmake_sparse (const FreeModule *target, const FreeModule *source, M2_arrayint deg, M2_arrayint rows, M2_arrayint cols, const engine_RawRingElementArray entries)
static const Matrixmake (const MonomialIdeal *mi)
static Matrixidentity (const FreeModule *F)
static Matrixzero (const FreeModule *F, const FreeModule *G)
static Matrixkoszul (const Matrix *rows, const Matrix *cols)
static Matrixkoszul_monomials (int nskew, const Matrix *rows, const Matrix *cols)
static Matrixflip (const FreeModule *G, const FreeModule *H)
static Matrixwedge_product (int p, int q, const FreeModule *F)
static Matrixrandom (const Ring *R, int r, int c)
static Matrixrandom (const Ring *R, int r, int c, double fraction_non_zero, int special_type)
Static Public Member Functions inherited from our_new_delete
static void * operator new (size_t size)
static void * operator new[] (size_t size)
static void operator delete (void *obj)
static void operator delete[] (void *obj)
static void * operator new (size_t size, void *existing_memory)
static void * operator new[] (size_t size, void *existing_memory)
static void operator delete (void *obj, void *existing_memory)
static void operator delete[] (void *obj, void *existing_memory)

Protected Member Functions

virtual unsigned int computeHashValue () const

Private Member Functions

 Matrix (const FreeModule *rows, const FreeModule *cols, const_monomial degree_shift, VECTOR(vec) &entries)
void minimal_lead_terms_ZZ (gc_vector< int > &result) const

Static Private Member Functions

static bool make_sparse_vecs (MatrixConstructor &mat, const FreeModule *target, int ncols, M2_arrayint rows, M2_arrayint cols, const engine_RawRingElementArray entries)

Private Attributes

FreeModulemTarget
FreeModulemSource
monomial mDegreeShift
gc_vector< vec > mEntries

Friends

class FreeModule
class MatrixConstructor

Detailed Description

Engine-side matrix: a map between two free modules, stored as a column-vector list.

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

Holds a target FreeModule (rows), a source FreeModule (columns), a mDegreeShift element of the degree monoid, and a gc_vector<vec> mEntries where each vec is the sparse linked-list representation of one column. The class is immutable once exposed to the front end (its computeHashValue pins the hash), so all mutating construction goes through the helper MatrixConstructor. Static make / make_sparse factories convert raw engine_RawRingElementArray input into a fully populated Matrix*.

Definition at line 66 of file matrix.hpp.


The documentation for this class was generated from the following files: