Macaulay2 Engine
Loading...
Searching...
No Matches
m2-types.h
Go to the documentation of this file.
1#pragma once
2// IWYU pragma: private, include "engine-includes.hpp"
3
36
37#ifndef _GNU_SOURCE
38 #define _GNU_SOURCE
39#endif
40#include <stdint.h>
41#define hash_t uint64_t
42#include <M2/config.h>
43 extern char newline[];
44
45#ifdef HAVE_UNISTD_H
46 #include <unistd.h>
47#endif
48#ifdef HAVE_MATH_H
49 #include <math.h>
50#endif
51#ifdef HAVE_SYS_RESOURCE_H
52 #include <sys/resource.h>
53#endif
54
72#ifdef __cplusplus
73 #define BASECLASS : public our_new_delete
74 #include "newdelete.hpp"
75#else
76 #define BASECLASS
77#endif
78
79 #include <M2/math-include.h>
80
81#if !defined(SAFEC_EXPORTS)
82typedef char M2_bool;
83
84typedef struct M2_string_struct * M2_string;
96struct M2_string_struct {int len;signed char array[];};
97
98typedef struct M2_arrayint_struct * M2_arrayint;
110struct M2_arrayint_struct {int len;int array[];};
111
112typedef struct M2_ArrayString_struct * M2_ArrayString;
113typedef M2_ArrayString M2_ArrayStringOrNull;
124struct M2_ArrayString_struct {int len;M2_string array[];};
125
126struct MonomialOrdering;
127struct Ring;
128struct M2SLEvaluator;
129struct M2SLProgram;
131struct PathTracker;
132struct M2PointArray;
133struct MutableMatrix;
134struct MutableComplex;
135struct Matrix;
136struct FreeModule;
137struct Monoid;
138struct MonomialIdeal;
139
140typedef mpz_ptr gmp_ZZmutable;
141typedef mpz_srcptr gmp_ZZ;
142typedef mpz_srcptr gmp_ZZorNull;
143
144typedef mpq_ptr gmp_QQmutable;
145typedef mpq_srcptr gmp_QQ;
146typedef mpq_srcptr gmp_QQorNull;
147
148typedef mpfr_srcptr gmp_RR;
149typedef mpfr_srcptr gmp_RRorNull;
150typedef mpfr_ptr gmp_RRmutable;
151
152typedef mpfi_ptr gmp_RRimutable;
153typedef mpfi_srcptr gmp_RRi;
154typedef mpfi_srcptr gmp_RRiorNull;
155
156typedef struct gmp_CC_struct * gmp_CC;
158struct gmp_CC_struct BASECLASS {mpfr_srcptr re;mpfr_srcptr im;};
159typedef struct gmp_CCmutable_struct * gmp_CCmutable;
160struct gmp_CCmutable_struct BASECLASS {mpfr_ptr re;mpfr_ptr im;};
161
162typedef struct gmp_CCi_struct * gmp_CCi;
164struct gmp_CCi_struct BASECLASS {mpfi_srcptr re;mpfi_srcptr im;};
165typedef struct gmp_CCimutable_struct * gmp_CCimutable;
166struct gmp_CCimutable_struct BASECLASS {mpfi_ptr re;mpfi_ptr im;};
167
168typedef struct gmp_arrayZZ_struct * gmp_arrayZZ;
169struct gmp_arrayZZ_struct {int len;mpz_srcptr array[];};
170
171typedef struct engine_RawMonomialArray_struct * engine_RawMonomialArray;
173typedef const struct RingElement * engine_RawRingElement;
174
175typedef struct engine_RawRingElementArray_struct * engine_RawRingElementArray;
176typedef engine_RawRingElementArray engine_RawRingElementArrayOrNull;
178
179typedef struct engine_RawRingElementArrayArray_struct * engine_RawRingElementArrayArray;
180typedef engine_RawRingElementArrayArray engine_RawRingElementArrayArrayOrNull;
181struct engine_RawRingElementArrayArray_struct {int len;engine_RawRingElementArray array[];};
182
183typedef struct engine_RawArrayPair_struct * engine_RawArrayPair;
185struct engine_RawArrayPair_struct BASECLASS {engine_RawMonomialArray monoms;engine_RawRingElementArray coeffs;};
186
187typedef struct engine_RawArrayIntPair_struct * engine_RawArrayIntPair;
189struct engine_RawArrayIntPair_struct BASECLASS {M2_arrayint a;M2_arrayint b;};
190
191typedef struct engine_RawMutableMatrixArray_struct * engine_RawMutableMatrixArray;
192typedef engine_RawMutableMatrixArray engine_RawMutableMatrixArrayOrNull;
194
195typedef struct engine_RawMatrixArray_struct * engine_RawMatrixArray;
196typedef engine_RawMatrixArray engine_RawMatrixArrayOrNull;
197struct engine_RawMatrixArray_struct {int len;const struct Matrix * array[];};
198
199typedef struct engine_RawMatrixAndInt_struct * engine_RawMatrixAndInt;
200struct engine_RawMatrixAndInt_struct BASECLASS {const struct Matrix * M;int i;};
201
202typedef struct engine_RawMatrixPair_struct * engine_RawMatrixPair;
204struct engine_RawMatrixPair_struct BASECLASS {const struct Matrix * a;const struct Matrix * b;};
205
206typedef struct engine_RawRingElementPair_struct * engine_RawRingElementPair;
208struct engine_RawRingElementPair_struct BASECLASS {const struct RingElement * a;const struct RingElement * b;};
209
210typedef struct gmp_ZZpair_struct * gmp_ZZpair;
212struct gmp_ZZpair_struct BASECLASS {mpz_srcptr a;mpz_srcptr b;};
213
214//typedef struct M2SLEvaluator * engine_RawSLEvaluator;
215//typedef struct M2SLEvaluator * engine_RawSLEvaluatorOrNull;
216
217/* typedef const struct MonomialOrdering * engine_RawMonomialOrdering; */
218/* typedef const struct MonomialOrdering * engine_RawMonomialOrderingOrNull; */
219
220typedef struct engine_RawMonomialOrderingArray_struct * engine_RawMonomialOrderingArray;
222
223/*
224struct EngineMonomial;
225typedef const struct MonomialOrdering * engine_RawMonomialOrdering;
226typedef const struct MonomialOrdering * engine_RawMonomialOrderingOrNull;
227typedef const struct Monoid * engine_RawMonoid;
228typedef const struct Monoid * engine_RawMonoidOrNull;
229typedef const struct Ring * engine_RawRing;
230typedef const struct RingMap * engine_RawRingMap;
231typedef const struct Ring * engine_RawRingOrNull;
232typedef const struct RingElement * engine_RawRingElement;
233typedef const struct RingElement * engine_RawRingElementOrNull;
234typedef const struct MonomialIdeal * engine_RawMonomialIdeal;
235typedef const struct MonomialIdeal * engine_RawMonomialIdealOrNull;
236typedef const struct FreeModule * engine_RawFreeModule;
237typedef const struct FreeModule * engine_RawFreeModuleOrNull;
238typedef const struct Matrix * engine_RawMatrix;
239typedef const struct Matrix * engine_RawMatrixOrNull;
240*/
241
242#if defined(__cplusplus)
243extern "C" {
244#endif
245
247 char * M2_tocharstar(M2_string s);
248 M2_string M2_join(M2_string x, M2_string y);
249 M2_string M2_tostring(const char* s);
250 M2_string M2_tostringn(char *s, int n);
251
252#if defined(__cplusplus)
253}
254#endif
255
256
257extern char newline[];
258extern int M2_numTBBThreads;
259extern int M2_gbTrace;
261
262#else
263typedef struct gmp_CC_struct * gmp_CC;
264
265#endif // !defined(SAFEC_EXPORTS)
266
Engine-side immutable monomial value type wrapping a varpower- encoded exponent vector.
Definition monomial.hpp:61
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
MutableEngineObject wrapper that owns a PointArray via unique_ptr.
Definition NAG.hpp:88
MutableEngineObject wrapper holding a raw SLEvaluator*.
Definition SLP-defs.hpp:248
MutableEngineObject wrapper that owns an SLProgram via unique_ptr.
Definition SLP-defs.hpp:64
Engine-side commutative monomial monoid: variable names, ordering, multidegree machinery,...
Definition monoid.hpp:89
Engine-side monomial ideal: a decision tree of Nmi_nodes storing the (typically minimal) generators b...
Definition monideal.hpp:136
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
Numerical homotopy-continuation path tracker for systems of polynomial equations.
Definition NAG.hpp:654
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
#define Matrix
Definition factory.cpp:14
void size_t s
Definition m2-mem.cpp:271
int M2_numericalAlgebraicGeometryTrace
Definition m2-types.cpp:53
char newline[]
Definition m2-types.cpp:49
int M2_gbTrace
Definition m2-types.cpp:52
int M2_numTBBThreads
Definition m2-types.cpp:51
mpfr_srcptr gmp_RR
Definition m2-types.h:148
M2_arrayint M2_arrayintOrNull
Definition m2-types.h:99
const struct RingElement * engine_RawRingElement
Definition m2-types.h:173
M2_string M2_tostringn(char *s, int n)
Definition m2-types.cpp:40
mpz_ptr gmp_ZZmutable
Definition m2-types.h:140
struct gmp_CC_struct * gmp_CC
Definition m2-types.h:156
struct engine_RawMatrixAndInt_struct * engine_RawMatrixAndInt
Definition m2-types.h:199
engine_RawMatrixArray engine_RawMatrixArrayOrNull
Definition m2-types.h:196
engine_RawRingElementArray engine_RawRingElementArrayOrNull
Definition m2-types.h:176
mpfr_ptr gmp_RRmutable
Definition m2-types.h:150
engine_RawMutableMatrixArray engine_RawMutableMatrixArrayOrNull
Definition m2-types.h:192
engine_RawArrayIntPair engine_RawArrayIntPairOrNull
Definition m2-types.h:188
#define BASECLASS
Definition m2-types.h:76
mpfi_ptr gmp_RRimutable
Definition m2-types.h:152
mpq_srcptr gmp_QQorNull
Definition m2-types.h:146
struct gmp_CCmutable_struct * gmp_CCmutable
Definition m2-types.h:159
M2_string M2_tostring(const char *s)
Definition m2-types.cpp:31
gmp_CCi gmp_CCiorNull
Definition m2-types.h:163
M2_ArrayString M2_ArrayStringOrNull
Definition m2-types.h:113
mpfr_srcptr gmp_RRorNull
Definition m2-types.h:149
char M2_bool
Definition m2-types.h:82
engine_RawRingElementPair engine_RawRingElementPairOrNull
Definition m2-types.h:207
struct engine_RawArrayPair_struct * engine_RawArrayPair
Definition m2-types.h:183
gmp_ZZpair gmp_ZZpairOrNull
Definition m2-types.h:211
gmp_CC gmp_CCorNull
Definition m2-types.h:157
char * M2_tocharstar(M2_string s)
Definition m2-types.cpp:13
mpfi_srcptr gmp_RRi
Definition m2-types.h:153
M2_arrayint M2_makearrayint(int n)
Definition m2-types.cpp:6
mpz_srcptr gmp_ZZ
Definition m2-types.h:141
mpq_ptr gmp_QQmutable
Definition m2-types.h:144
mpz_srcptr gmp_ZZorNull
Definition m2-types.h:142
struct engine_RawRingElementPair_struct * engine_RawRingElementPair
Definition m2-types.h:206
struct gmp_ZZpair_struct * gmp_ZZpair
Definition m2-types.h:210
mpq_srcptr gmp_QQ
Definition m2-types.h:145
engine_RawArrayPair engine_RawArrayPairOrNull
Definition m2-types.h:184
mpfi_srcptr gmp_RRiorNull
Definition m2-types.h:154
engine_RawMatrixPair engine_RawMatrixPairOrNull
Definition m2-types.h:203
M2_string M2_join(M2_string x, M2_string y)
Definition m2-types.cpp:21
struct gmp_CCi_struct * gmp_CCi
Definition m2-types.h:162
struct gmp_CCimutable_struct * gmp_CCimutable
Definition m2-types.h:165
struct engine_RawArrayIntPair_struct * engine_RawArrayIntPair
Definition m2-types.h:187
engine_RawRingElementArrayArray engine_RawRingElementArrayArrayOrNull
Definition m2-types.h:180
struct engine_RawMatrixPair_struct * engine_RawMatrixPair
Definition m2-types.h:202
our_new_delete — per-class opt-in routing of new / delete through bdwgc.
volatile int x
mpfr_srcptr re
Definition m2-types.h:158
engine_RawRingElementArray coeffs
Definition m2-types.h:185
mpfr_srcptr im
Definition m2-types.h:158
M2_arrayint b
Definition m2-types.h:189
M2_arrayint a
Definition m2-types.h:189
engine_RawMonomialArray monoms
Definition m2-types.h:185
const struct Matrix * M
Definition m2-types.h:200
M2_string array[]
Definition m2-types.h:124
Length-prefixed array of M2_string pointers.
Definition m2-types.h:124
Length-prefixed int array, the integer counterpart of M2_string.
Definition m2-types.h:110
signed char array[]
Definition m2-types.h:96
Length-prefixed byte string passed between the M2 front end and the engine.
Definition m2-types.h:96
Front-end-side description of a monomial ordering as a list of mon_part blocks.
const struct Matrix * array[]
Definition m2-types.h:197
const struct EngineMonomial * array[]
Definition m2-types.h:172
const struct MonomialOrdering * array[]
Definition m2-types.h:221
struct MutableMatrix * array[]
Definition m2-types.h:193
const struct RingElement * array[]
Definition m2-types.h:177
engine_RawRingElementArray array[]
Definition m2-types.h:181
mpz_srcptr array[]
Definition m2-types.h:169