Macaulay2 Engine
Loading...
Searching...
No Matches
m2-types.h File Reference

Engine-to-interpreter type vocabulary across the C++ / .dd boundary. More...

#include <stdint.h>
#include <M2/config.h>
#include <M2/math-include.h>

Go to the source code of this file.

Classes

struct  M2_string
 Length-prefixed byte string passed between the M2 front end and the engine. More...
struct  M2_arrayint
 Length-prefixed int array, the integer counterpart of M2_string. More...
struct  M2_ArrayString
 Length-prefixed array of M2_string pointers. More...
struct  BASECLASS
 Synthetic documentation entry for the BASECLASS preprocessor macro (no real struct of this name exists). More...
struct  gmp_arrayZZ
struct  engine_RawMonomialArray
struct  engine_RawRingElementArray
struct  engine_RawRingElementArrayArray
struct  engine_RawMutableMatrixArray
struct  engine_RawMatrixArray
struct  engine_RawMonomialOrderingArray

Macros

#define _GNU_SOURCE
#define hash_t   uint64_t
#define BASECLASS

Typedefs

typedef char M2_bool
typedef M2_arrayint M2_arrayintOrNull
typedef M2_ArrayString M2_ArrayStringOrNull
typedef mpz_ptr gmp_ZZmutable
typedef mpz_srcptr gmp_ZZ
typedef mpz_srcptr gmp_ZZorNull
typedef mpq_ptr gmp_QQmutable
typedef mpq_srcptr gmp_QQ
typedef mpq_srcptr gmp_QQorNull
typedef mpfr_srcptr gmp_RR
typedef mpfr_srcptr gmp_RRorNull
typedef mpfr_ptr gmp_RRmutable
typedef mpfi_ptr gmp_RRimutable
typedef mpfi_srcptr gmp_RRi
typedef mpfi_srcptr gmp_RRiorNull
typedef struct gmp_CC_struct * gmp_CC
typedef gmp_CC gmp_CCorNull
typedef struct gmp_CCmutable_struct * gmp_CCmutable
typedef struct gmp_CCi_struct * gmp_CCi
typedef gmp_CCi gmp_CCiorNull
typedef struct gmp_CCimutable_struct * gmp_CCimutable
typedef const struct RingElementengine_RawRingElement
typedef engine_RawRingElementArray engine_RawRingElementArrayOrNull
typedef engine_RawRingElementArrayArray engine_RawRingElementArrayArrayOrNull
typedef struct engine_RawArrayPair_struct * engine_RawArrayPair
typedef engine_RawArrayPair engine_RawArrayPairOrNull
typedef struct engine_RawArrayIntPair_struct * engine_RawArrayIntPair
typedef engine_RawArrayIntPair engine_RawArrayIntPairOrNull
typedef engine_RawMutableMatrixArray engine_RawMutableMatrixArrayOrNull
typedef engine_RawMatrixArray engine_RawMatrixArrayOrNull
typedef struct engine_RawMatrixAndInt_struct * engine_RawMatrixAndInt
typedef struct engine_RawMatrixPair_struct * engine_RawMatrixPair
typedef engine_RawMatrixPair engine_RawMatrixPairOrNull
typedef struct engine_RawRingElementPair_struct * engine_RawRingElementPair
typedef engine_RawRingElementPair engine_RawRingElementPairOrNull
typedef struct gmp_ZZpair_struct * gmp_ZZpair
typedef gmp_ZZpair gmp_ZZpairOrNull

Functions

M2_arrayint M2_makearrayint (int n)
char * M2_tocharstar (M2_string s)
M2_string M2_join (M2_string x, M2_string y)
M2_string M2_tostring (const char *s)
M2_string M2_tostringn (char *s, int n)

Variables

char newline []
int M2_numTBBThreads
int M2_gbTrace
int M2_numericalAlgebraicGeometryTrace

Detailed Description

Engine-to-interpreter type vocabulary across the C++ / .dd boundary.

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

Declares the bridging types every interface/*.h header uses: scalars (M2_bool, hash_t = uint64_t); GC-managed length-prefixed arrays (M2_arrayint, M2_string, M2_ArrayString); pointer aliases over GMP / MPFR / MPFI (gmp_ZZ, gmp_QQ, gmp_RR, gmp_RRi, gmp_CC, gmp_CCi with their mutable and orNull variants); and the engine_RawXxxArray / RawArrayPair / RawMatrixPair / RawRingElementPair structs the interpreter sees as opaque containers of engine pointers. Forward declarations for Ring, Matrix, FreeModule, MonomialOrdering, and the SLP types let downstream headers refer to engine classes without dragging in their C++ definitions.

The IWYU pragma: private annotation routes callers through engine-includes.hpp instead of including this file directly. The BASECLASS macro expands to : public our_new_delete in C++ and to nothing in C so the struct definitions compile on either side; a handful of helpers (M2_makearrayint, M2_tostring, M2_join, M2_tocharstar) and the global trace counters (M2_gbTrace, M2_numTBBThreads, M2_numericalAlgebraicGeometryTrace) are exported alongside the types.

See also
engine-includes.hpp
m2-mem.h

Definition in file m2-types.h.