3` trailers name the
M2-side binding.
13 * Promotion / lifting between coefficient rings:
17 * (`rawNumberOfRows` / `rawNumberOfColumns`),
21 * (`rawIsZero` / `rawIsEqual` / `rawIsHomogeneous`), plus
22 * `rawIsDense`. Construction: `rawIdentity`, `rawZero`,
23 * `rawMatrix1` / `rawMatrix2` (vec-list and ring-element-list
24 * variants), `rawSparseMatrix1` / `rawSparseMatrix2`,
25 * `rawMatrixRemake1` / `rawMatrixRemake2`,
26 * `rawRandomConstantMatrix`, plus
28 * for ingesting MSolve-format text.
30 * Combinators: `rawConcat`, `rawDirectSum`, `rawTensor`,
33 * `rawSymmetricPower`, `rawExteriorPower`, `rawSortColumns`.
34 * Determinantal: `
rawMinors`, `rawPfaffians`. Cleanup /
37 * Differential and polynomial-term operations:
38 * `rawMatrixDiff`, `rawMatrixContract`, `rawHomogenize`,
41 * `rawKeepVariables`, `rawDivideByVariable`. There are **no**
42 * element-wise `add` / `
subtract` / `multiply` bindings in
43 * this header --- those operations live at the
M2 interpreter
46 * `
Matrix` is immutable, so every transformation returns a
47 * fresh pointer; the implementation in `matrix.cpp` validates
48 * ring and dimension agreement before delegating to
53 * @see
mutable-matrix.h
54 * @see engine-includes.hpp
60# if defined(__cplusplus)
76# if defined(__cplusplus)
131 const engine_RawRingElementArray M,
138 const engine_RawRingElementArray M,
146 const engine_RawRingElementArray entries,
155 const engine_RawRingElementArray entries,
187 double fraction_non_zero,
212 const engine_RawMatrixArray Ms);
215 const engine_RawMatrixArray Ms);
286 int n_minors_to_compute,
483# if defined(__cplusplus)
Engine-side free module R^n over a Ring.
Mutable builder used to assemble an immutable Matrix one column (or one term) at a time.
Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meani...
Engine-wide include prelude — a single point of truth for portability shims.
void subtract(int &result, int a, int b)
int IM2_Matrix_n_rows(const Matrix *M)
const Matrix * rawMatrixReadMsolveString(const Ring *R, M2_string contents)
const FreeModule * IM2_Matrix_get_target(const Matrix *M)
engine_RawMatrixPairOrNull rawTopCoefficients(const Matrix *M)
const Matrix * rawCoefficients(M2_arrayint vars, const Matrix *monoms, const Matrix *M)
const Matrix * rawRemoveMonomialFactors(const Matrix *m, M2_bool make_squarefree_only)
const RingElement * IM2_Matrix_get_entry(const Matrix *M, int r, int c)
const Matrix * rawMatrixReadMsolveFile(const Ring *R, M2_string filename)
M2_arrayint IM2_Matrix_get_degree(const Matrix *M)
const Matrix * rawKoszulMonomials(int nskew, const Matrix *M, const Matrix *N)
const Matrix * rawMatrixCompress(const Matrix *M)
const Matrix * IM2_Matrix_promote(const FreeModule *newTarget, const Matrix *f)
M2_bool IM2_Matrix_is_zero(const Matrix *M)
const Matrix * rawWedgeProduct(int p, int q, const FreeModule *F)
const Matrix * rawMinors(int p, const Matrix *M, int strategy, int n_minors_to_compute, M2_arrayintOrNull first_row_set, M2_arrayintOrNull first_col_set)
const Matrix * IM2_Matrix_lift(int *success_return, const FreeModule *newTarget, const Matrix *f)
VALGRIND_MAKE_MEM_DEFINED & result(result)
M2_arrayint M2_arrayintOrNull
struct engine_RawMatrixAndInt_struct * engine_RawMatrixAndInt
engine_RawMatrixPair engine_RawMatrixPairOrNull
engine_RawRingElementArrayArray engine_RawRingElementArrayArrayOrNull
const Matrix * IM2_Matrix_monomials(M2_arrayint vars, const Matrix *M)
const Matrix * IM2_Matrix_homogenize(const Matrix *M, int var, M2_arrayint wts)
M2_bool IM2_Matrix_is_implemented_as_dense(const Matrix *M)
const Matrix * IM2_Matrix_remove_content(const Matrix *M)
const Matrix * IM2_Matrix_koszul(int p, const Matrix *M)
int IM2_Matrix_n_rows(const Matrix *M)
const Matrix * rawMatrixReadMsolveString(const Ring *R, M2_string contents)
const Matrix * IM2_Matrix_tensor(const Matrix *M, const Matrix *N)
M2_string IM2_Matrix_to_string(const Matrix *M)
const FreeModule * IM2_Matrix_get_target(const Matrix *M)
const Matrix * IM2_Matrix_submatrix1(const Matrix *M, M2_arrayint cols)
engine_RawMatrixPairOrNull rawTopCoefficients(const Matrix *M)
const Matrix * rawCoefficients(M2_arrayint vars, const Matrix *monoms, const Matrix *M)
const Matrix * rawMatrixRemoveContent(const Matrix *M)
const Matrix * IM2_Matrix_make2(const FreeModule *target, const FreeModule *source, M2_arrayint deg, const engine_RawRingElementArray M, int preference)
const Matrix * IM2_Matrix_submatrix(const Matrix *M, M2_arrayint rows, M2_arrayint cols)
const Matrix * rawRemoveMonomialFactors(const Matrix *m, M2_bool make_squarefree_only)
const Matrix * IM2_Matrix_reduce_by_ideal(const Matrix *M, const Matrix *N)
const Matrix * IM2_Matrix_concat(const engine_RawMatrixArray Ms)
const Matrix * IM2_Matrix_make_sparse1(const FreeModule *target, int ncols, M2_arrayint rows, M2_arrayint cols, const engine_RawRingElementArray entries, int preference)
const RingElement * IM2_Matrix_get_entry(const Matrix *M, int r, int c)
const Matrix * IM2_Matrix_minors(int p, const Matrix *M, int strategy)
const Matrix * IM2_Matrix_reduce(const Matrix *M, const Matrix *N)
const Matrix * IM2_Matrix_transpose(const Matrix *M)
const Matrix * IM2_Matrix_reshape(const Matrix *M, const FreeModule *F, const FreeModule *G)
const Matrix * IM2_Matrix_auto_reduce(const Matrix *M)
int IM2_Matrix_is_equal(const Matrix *M, const Matrix *N)
const Matrix * IM2_Matrix_exterior(int p, const Matrix *M, int strategy)
const Matrix * IM2_Matrix_uniquify(const Matrix *M)
unsigned int rawMatrixHash(const Matrix *M)
int IM2_Matrix_dimension(const Matrix *M)
const Matrix * IM2_Matrix_contract(const Matrix *M, const Matrix *N)
const Matrix * rawBasis(const Matrix *M, M2_arrayint lo_degree, M2_arrayint hi_degree, M2_arrayint wt, M2_arrayint vars, M2_bool do_truncation, int limit)
const Matrix * IM2_Matrix_remake2(const FreeModule *target, const FreeModule *source, M2_arrayint deg, const Matrix *M, int preference)
const Matrix * rawMatrixContent(const Matrix *M)
M2_arrayint IM2_Matrix_sort_columns(const Matrix *M, int deg_order, int mon_order)
int IM2_Matrix_n_cols(const Matrix *M)
engine_RawMatrixAndInt IM2_Matrix_divide_by_var(const Matrix *M, int var, int maxdegree)
const Matrix * rawMatrixReadMsolveFile(const Ring *R, M2_string filename)
const Matrix * IM2_Matrix_direct_sum(const engine_RawMatrixArray Ms)
M2_arrayint IM2_Matrix_get_degree(const Matrix *M)
M2_arrayint IM2_Matrix_elim_vars(int nparts, const Matrix *M)
const Matrix * IM2_Matrix_make_sparse2(const FreeModule *target, const FreeModule *source, M2_arrayint deg, M2_arrayint rows, M2_arrayint cols, const engine_RawRingElementArray entries, int preference)
const Matrix * IM2_Matrix_zero(const FreeModule *F, const FreeModule *G, int preference)
engine_RawRingElementArrayArrayOrNull IM2_Matrix_get_entries(const Matrix *M)
const Matrix * IM2_Matrix_remake1(const FreeModule *target, const Matrix *M, int preference)
const Matrix * IM2_Matrix_diff(const Matrix *M, const Matrix *N)
const Matrix * rawKoszulMonomials(int nskew, const Matrix *M, const Matrix *N)
const Matrix * IM2_Matrix_initial(int nparts, const Matrix *M)
const RingElement * IM2_Matrix_pfaffian(const Matrix *M)
const Matrix * rawModuleTensor(const Matrix *M, const Matrix *N)
const Matrix * IM2_Matrix_flip(const FreeModule *F, const FreeModule *G)
M2_arrayint IM2_Matrix_keep_vars(int nparts, const Matrix *M)
const Matrix * IM2_Matrix_symm(int p, const Matrix *M)
M2_bool IM2_Matrix_is_graded(const Matrix *M)
const Matrix * rawMatrixSplitContent(const Matrix *M, const Matrix **result)
const Matrix * rawMatrixCompress(const Matrix *M)
const Matrix * IM2_Matrix_promote(const FreeModule *newTarget, const Matrix *f)
const Matrix * IM2_Matrix_pfaffians(int p, const Matrix *M)
M2_bool IM2_Matrix_is_zero(const Matrix *M)
const Matrix * rawWedgeProduct(int p, int q, const FreeModule *F)
const Matrix * rawRemoveScalarMultiples(const Matrix *m)
const FreeModule * IM2_Matrix_get_source(const Matrix *M)
const Matrix * IM2_Matrix_identity(const FreeModule *F, int preference)
M2_arrayint IM2_Matrix_min_leadterms(const Matrix *M, M2_arrayint vars)
const Matrix * IM2_Matrix_random(const Ring *R, int r, int c, double fraction_non_zero, int special_type, int preference)
const Matrix * rawMinors(int p, const Matrix *M, int strategy, int n_minors_to_compute, M2_arrayintOrNull first_row_set, M2_arrayintOrNull first_col_set)
const Matrix * IM2_Matrix_lift(int *success_return, const FreeModule *newTarget, const Matrix *f)
const Matrix * IM2_Matrix_make1(const FreeModule *target, int ncols, const engine_RawRingElementArray M, int preference)
M2_arrayintOrNull rawMatrixIndices(const Matrix *f)