Macaulay2 Engine
Loading...
Searching...
No Matches
engine.h
Go to the documentation of this file.
1/* Copyright 2002 by Michael E. Stillman */
2
3#ifndef _engine_h_
4#define _engine_h_
5
44
48
49#include "engine-includes.hpp"
50
51#if defined(__cplusplus)
52class FreeModule;
53class Matrix;
54class MutableMatrix;
55class RingMap;
56class Computation;
57class MutableComplex;
58#else
59/* Define the externally visible types here */
60typedef struct FreeModule FreeModule;
61typedef struct Matrix Matrix;
62typedef struct MutableMatrix MutableMatrix;
63typedef struct RingMap RingMap;
64typedef struct Computation Computation;
65typedef struct MutableComplex MutableComplex;
66#endif
67
68#include "interface/aring.h"
70#include "interface/cra.h"
71#include "interface/factory.h"
72#include "interface/flint.h"
74#include "interface/groebner.h"
75#include "interface/matrix.h"
76#include "interface/monoid.h"
80#include "interface/random.h"
81#include "interface/ring.h"
83#include "interface/ringmap.h"
84
85#include "interface/NAG.h"
86
87#if defined(__cplusplus)
88extern "C" {
89#endif
90 void IM2_initialize(void); /* drg: connected */
91 M2_string IM2_last_error_message(void); /* drg: connected */
92
93 M2_string engineMemory(); /* connected MES to engineMemory */
94
95 /**************************************************/
96 /**** Monomial routines ***************************/
97 /**************************************************/
98 /* Monomials in the engine: are not associated with a monoid,
99 * and may have negative exponents. Monomials are immutable objects.
100 */
101
102 /**************************************************/
103 /**** Mutable Complex routines ********************/
104 /**************************************************/
105
106 M2_string rawMutableComplexToString(const MutableComplex *M);
107
108 unsigned int rawMutableComplexHash(const MutableComplex *M);
109
110 MutableComplex* rawMutableComplex(const engine_RawMutableMatrixArray M);
111
112 M2_arrayint rawPruneBetti(MutableComplex* C, int n, int f);
113
115
116 engine_RawMutableMatrixArray rawPruningMorphism(MutableComplex* C, int n, int f);
117
118 /**************************************************/
119 /**** Local Ring routines *************************/
120 /**************************************************/
121
122 Matrix * rawLiftLocalMatrix(const Ring * R, const Matrix *m);
124
125 /**************************************************/
126 /**** Groebner basis and resolution routines ******/
127 /**************************************************/
128
130 M2_bool always_stop, /* 1 */
131 M2_arrayint degree_limit, /* 2*/
132 int basis_element_limit, /* 3 */
133 int syzygy_limit, /* 4 */
134 int pair_limit, /* 5 */
135 int codim_limit, /* 6 */
136 int subring_limit, /* 7 */
137 M2_bool just_min_gens, /* 8 */
138 M2_arrayint length_limit /* 9 */ /* not for GB */
139 ); /* drg: connected rawGBSetStop */
140
141 /* Each of these routines can return NULL, because of errors */
142
144 /* start or continue the computation */
145
147
148 int rawStatus2(Computation *C);
149 /* The computation is complete up to and including this degree.
150 The exact meaning of 'degree' is computation specific */
151
152 M2_string IM2_GB_to_string(Computation *C); /* drg: connected, in actors4.d */
153
154 unsigned int rawComputationHash(const Computation *C); /* drg: connected, in basic.d */
155
156 void rawShowComputation(const Computation *C); /* Dan: connected to rawShowComputation */
157
158 /*******************************************
159 * Computation routines for Resolutions ****
160 *******************************************/
161
162 /* LongPolynomial, Sort, Primary, Inhomogeneous, Homogeneous */
163 /* Res: SortStrategy, 0, 1, 2, 3 ?? */
164
165 Computation /* or null */ *IM2_res_make(const Matrix *m,
166 M2_bool resolve_cokernel,
167 int max_level,
168 M2_bool use_max_slanted_degree,
169 int max_slanted_degree,
170 int algorithm,
171 int strategy, /* drg: connected rawResolution */
172 M2_bool parallelizeByDegree
173 );
174
175 const Matrix /* or null */ *rawResolutionGetMatrix(Computation *G,int level);
176 /* rawResolutionGetMatrix */
177
178 MutableMatrix /* or null */ *rawResolutionGetMatrix2(Computation *G,int level,int degree);
179 /* rawResolutionGetMatrix2 */
180
181 // This might be temporary!
182 MutableMatrix /* or null */ *
184 const Ring* R, // A polynomial ring with coeffs = RR, or a finite field used in C, same monoid as C's ring.
185 int level);
186
187 // This might be temporary!
188 MutableMatrix /* or null */ *
190 const Ring* KK, // should be RR, or a finite field used in C.
191 int level,
192 int degree);
193
194 const FreeModule /* or null */ *rawResolutionGetFree(Computation *G, int level);
195 /*drg: connected rawResolutionGetFree*/
196
198 int type); /* drg: connected rawGBBetti */
199 /* type:
200 0: minimal betti numbers, (for FastNonminimal=>true, the ACTUAL betti numbers)
201 1: non-minimal betti numbers (skeleton size, or size of GB's).
202 (for FastNonminimal=>true, same as "0" case)
203 2: number of S-pairs remaining to consider
204 3: number of monomials in polynomials at this slot
205 4: for FastNonminimal=>true resolutions, the minimal betti numbers
206 other cases, this is an error.
207 Not all of these may be accessible with all algorithms. If not available,
208 A betti diagram with all -1's is displayed.
209 */
210
211 /* I don't know what this is supposed to do (mike) */
213 int * complete_up_through_this_degree,
214 int * complete_up_through_this_level); /* drg: TODO */
215 /* -1: error condition, and the error message is set.
216 0: not made, and in fact it won't ever be done...
217 1: not started,
218 2: started,
219 3: stopped because of a stopping condition
220 4: finished the computation completely
221 */
222
224 int level,
225 M2_bool minimize,
226 int * complete_up_through_this_degree);
227 /* WARNING: 'minimize' is completely ignored, and should be removed from the interface */
228 /* drg: connected rawResolutionStatusLevel */
229
230 /**************************************************/
231 /**** Specialized operations **********************/
232 /**************************************************/
233
234 Matrix /* or null */ * rawSubduction(int numparts,
235 const Matrix *M,
236 const RingMap *F,
237 Computation *C);
238 /*
239 Perform a subalgebra reduction of the entries of the one row matrix M.
240 C should be a GB computed in high enough degree to handle the elements of M,
241 of an ideal of the form y_i - m_i (m_i is the lead monomial of f_i).
242 F should be a ring map R --> R, sending y_i to f_i.
243 M should be a matrix over the ring R, usually only involving the variables in the f_i.
244 R should be a ring containing the variables of the f_i, and the variables y_i,
245 with a monomial order eliminating the first set of variables (which is 'numparts' parts of the
246 monomial ordering).
247 numparts: number of parts in the monomial order of the original ring.
248 The resulting matrix will have no monomials which are in the subalgebra
249 generated by the monomials m_i, and each entry of M and the corresponding entry of the
250 result differ by an element of the subalgebra generated by the f_i.
251 */
252
254 const MutableMatrix *Pts,
255 Matrix /* or null */ ** result_GB,
256 Matrix /* or null */ ** result_std_monoms);
257 /* Returns false if an error occurred.
258 Input: R: a polynomial ring of the form K[x1,...,xn]
259 Pts: an n by d matrix over K.
260 Action: Compute the ideal of the points in n-space
261 given by the columns of 'Pts'
262 Output: result_GB: the GB of this ideal
263 result_std_monoms: the standard monomials (1 by d matrix)
264 Question: should this return the separators as well?
265 */
266
267 const Matrix /* or null */ *rawGbBoolean(const Matrix *m);
268 const Matrix /* or null */ *rawBIBasis(const Matrix* m, int toGroebner);
269
270#if defined(__cplusplus)
271}
272#endif
273
274#endif
275
276/*
277// Local Variables:
278// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
279// indent-tabs-mode: nil
280// End:
281*/
Engine-boundary C API for the Numerical Algebraic Geometry subsystem.
Engine-boundary C API for constructing aring-backed coefficient rings.
Abstract base for long-running, resumable engine computations (GBComputation, ResolutionComputation,...
Definition comp.hpp:70
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
Sequence of MutableMatrix differentials representing an in-progress chain complex,...
Abstract base class for mutable matrices over an arbitrary engine Ring, the in-place counterpart of t...
Definition mat.hpp:79
Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meani...
Definition relem.hpp:67
xxx xxx xxx
Definition ring.hpp:102
Engine-side ring homomorphism: stores, for each source-ring variable, the target-ring element it maps...
Definition ringmap.hpp:60
ComputationStatusCode
Definition computation.h:53
ComputationStatusCode / StopConditions / StrategyValues / Algorithms / gbTraceValues — engine-to-inte...
Engine-boundary C API for Chinese-remainder lifting and rational reconstruction.
Engine-wide include prelude — a single point of truth for portability shims.
Matrix * rawSubduction(int numparts, const Matrix *M, const RingMap *F, Computation *C)
Definition groebner.cpp:649
MutableMatrix * rawResolutionGetMatrix2(Computation *G, int level, int degree)
Definition groebner.cpp:502
unsigned int rawComputationHash(const Computation *C)
Definition groebner.cpp:648
unsigned int rawMutableComplexHash(const MutableComplex *M)
MutableComplex * rawPruneComplex(MutableComplex *C, int n, int f)
void IM2_initialize(void)
Definition engine.cpp:76
const Matrix * rawBIBasis(const Matrix *m, int toGroebner)
Definition bibasis.cpp:39
Computation * IM2_res_make(const Matrix *m, M2_bool resolve_cokernel, int max_level, M2_bool use_max_slanted_degree, int max_slanted_degree, int algorithm, int strategy, M2_bool parallelizeByDegree)
Definition groebner.cpp:124
int IM2_Resolution_status(Computation *G, int *complete_up_through_this_degree, int *complete_up_through_this_level)
Definition groebner.cpp:579
enum ComputationStatusCode rawStatus1(Computation *C)
Definition groebner.cpp:317
engine_RawMutableMatrixArray rawPruningMorphism(MutableComplex *C, int n, int f)
Computation * rawStartComputation(Computation *G)
Definition groebner.cpp:264
const Matrix * rawResolutionGetMatrix(Computation *G, int level)
Definition groebner.cpp:486
int rawStatus2(Computation *C)
Definition groebner.cpp:318
void rawShowComputation(const Computation *C)
Definition groebner.cpp:319
M2_arrayint rawPruneBetti(MutableComplex *C, int n, int f)
M2_arrayint rawResolutionBetti(Computation *G, int type)
Definition groebner.cpp:617
MutableMatrix * rawResolutionGetMutableMatrix2B(Computation *C, const Ring *KK, int level, int degree)
Definition groebner.cpp:543
MutableMatrix * rawResolutionGetMutableMatrixB(Computation *C, const Ring *R, int level)
Definition groebner.cpp:520
M2_bool rawIsLocalUnit(const RingElement *f)
MutableComplex * rawMutableComplex(const engine_RawMutableMatrixArray M)
Matrix * rawLiftLocalMatrix(const Ring *R, const Matrix *m)
M2_string engineMemory()
Definition finalize.cpp:221
const FreeModule * rawResolutionGetFree(Computation *G, int level)
Definition groebner.cpp:563
M2_string IM2_GB_to_string(Computation *C)
Definition groebner.cpp:633
const Matrix * rawGbBoolean(const Matrix *m)
Computation * IM2_Computation_set_stop(Computation *G, M2_bool always_stop, M2_arrayint degree_limit, int basis_element_limit, int syzygy_limit, int pair_limit, int codim_limit, int subring_limit, M2_bool just_min_gens, M2_arrayint length_limit)
Definition groebner.cpp:231
M2_bool rawIdealOfPoints(const Ring *R, const MutableMatrix *Pts, Matrix **result_GB, Matrix **result_std_monoms)
Definition points.cpp:13
M2_string rawMutableComplexToString(const MutableComplex *M)
enum ComputationStatusCode IM2_Resolution_status_level(Computation *G, int level, M2_bool minimize, int *complete_up_through_this_degree)
Definition groebner.cpp:593
M2_string IM2_last_error_message(void)
Definition engine.cpp:99
#define Matrix
Definition factory.cpp:14
Engine-boundary C API for polynomial GCD, factorisation, and root finding.
Engine-boundary C API exposing FLINT's integer primality and factorisation services.
Engine-boundary C API for constructing and querying FreeModules.
Engine-boundary C API for Gröbner basis, resolution, and Hilbert-series computations.
char M2_bool
Definition m2-types.h:82
Engine-boundary C API for constructing, transforming, and inspecting immutable Matrix objects.
Engine-boundary C API for constructing and inspecting Monoid objects.
Engine-boundary C API for constructing and operating on MonomialIdeals.
Engine-boundary C API for assembling block-level MonomialOrderings from declarative pieces.
Engine-boundary C API for the engine's in-place MutableMatrix, including dense linear algebra.
Engine-boundary C API for the engine's PRNG and rational / real / complex random draws.
tbb::flow::graph G
Engine-boundary C API for the legacy Ring hierarchy — coefficient, polynomial, and composite rings.
Engine-boundary C API for constructing, querying, and operating on RingElement values.
Engine-boundary C API for constructing and evaluating RingMap homomorphisms.