Macaulay2 Engine
Loading...
Searching...
No Matches
freemodule.h
Go to the documentation of this file.
1#ifndef _freemodule_h_
2# define _freemodule_h_
3`
35 * trailers mark the M2-side binding for each C entry point.
36 *
37 * @see freemodule.cpp
38 * @see engine-includes.hpp
39 */
40
41# include "engine-includes.hpp"
42
43// TODO: fix this
44# if defined(__cplusplus)
45class FreeModule;
46class Matrix;
47class Ring;
48# else
49typedef struct FreeModule FreeModule;
50typedef struct Matrix Matrix;
51typedef struct Ring Ring;
52# endif
53
73
74# if defined(__cplusplus)
75extern "C" {
76# endif
77
78const Ring *IM2_FreeModule_ring(const FreeModule *F);
79/* drg: connected rawRing*/
80
82/* drg: connected rawRank*/
83
84M2_string IM2_FreeModule_to_string(const FreeModule *F);
85/* drg: connected */
86
87unsigned int rawFreeModuleHash(const FreeModule *F);
88/* not quite connected */
89
90const FreeModule /* or null */ *IM2_FreeModule_make(const Ring *R, int rank);
91/* drg: connected rawFreeModule*/
92
93const FreeModule /* or null */ *IM2_FreeModule_make_degs(const Ring *R,
94 M2_arrayint degs);
95/* drg: connected rawFreeModule*/
96/* Make a graded free module over R. 'degs' should be of length
97 * divisible by the length 'd' of a degree vector, and the
98 * i th degree will be degs[i*d]..degs[i*d+d-1], starting at
99 * i = 0.
100 */
101
102const FreeModule /* or null */ *IM2_FreeModule_make_schreyer(const Matrix *m);
103/* drg: connected rawSchreyerSource */
104/* Returns G, (a copy of) the source free module of 'm', modified to
105 * use the induced order via m: compare two monomials of G via
106 * x^A e_i > x^B e_j iff either
107 * leadmonomial((in m)(x^A e_i)) > leadmonomial((in m)(x^B e_j))
108 * or these are the same monomial, and i > j.
109 * The case where the target of 'm' has a Schreyer order is
110 * handled efficiently.
111 */
112
114/* drg: connected rawMultiDegree*/
115
117/* drg: connected rawGetSchreyer*/
118
120/* drg: connected === */
121/* Determines if F and G are the same graded module. If one has a
122 * Schreyer order and one does not, but their ranks and degrees are the
123 * same, then they are considered equal by this routine.
124 */
125
126const FreeModule /* or null */ *IM2_FreeModule_sum(const FreeModule *F,
127 const FreeModule *G);
128/* drg: connected rawDirectSum */
129/* The direct sum of two free modules over the same ring, or NULL.
130 * If F or G has a Schreyer order, then so does their direct sum
131 */
132
133const FreeModule /* or null */ *IM2_FreeModule_tensor(const FreeModule *F,
134 const FreeModule *G);
135/* drg: connected rawTensor*/
136/* The tensor product of two free modules over the same ring, or NULL.
137 * If F has (ordered) basis {f_1,...,f_r}, and
138 * G has (ordered) basis {g_1, ..., g_s}, then
139 * the result has (ordered) basis
140 * {f_1 ** g_1, f_1 ** g_2, ..., f_1 ** g_s,
141 * f_2 ** g_1, f_2 ** g_2, ..., f_2 ** g_s,
142 * ...
143 * f_r ** g_1, ... f_r ** g_s}.
144 * If F or G has a Schreyer order, what about their tensor product?
145 * At the moment, the answer is almost yes...
146 */
147
148const FreeModule /* or null */ *IM2_FreeModule_dual(const FreeModule *F);
149/* drg: connected rawDual*/
150/* Returns the graded dual F^* of F: if F has basis {f_1,...,f_r},
151 * with degrees {d_1, ..., d_r}, then F^* has rank r, with
152 * degrees {-d_1, ..., -d_r}. The result does not have a
153 * Schreyer order (even if F does).
154 */
155
156const FreeModule *IM2_FreeModule_symm(int n, const FreeModule *F);
157/* drg: connected rawSymmetricPower*/
158/* Returns the n th symmetric power G of F.
159 * If F has basis {f_1,...,f_r}, then G has basis
160 * the monomials of f_1, ..., f_r of degree exactly n, in
161 * descending lexicographic order.
162 * If F has a Schreyer order, then G is set to have one as well.
163 */
164
165const FreeModule *IM2_FreeModule_exterior(int n, const FreeModule *F);
166/* drg: connected rawExteriorPower*/
167/* Returns the n th exterior power G of F.
168 * If F has basis {f_1,...,f_r}, then G has basis
169 * the squarefree monomials of f_1, ..., f_r of degree exactly n, in
170 * descending reverse lexicographic order.
171 * If F has a Schreyer order, then G is set to have one as well.
172 */
173
174const FreeModule /* or null */ *IM2_FreeModule_submodule(const FreeModule *F,
175 M2_arrayint selection);
176/* drg: connected rawSubmodule*/
177/* Returns a free module obtained by choosing basis elements of F:
178 * if F has basis {f_0, ..., f_(r-1)} with degrees {d_0, ..,d_(r-1)},
179 * and selection = [i_1, ..., i_s], where 0 <= i_j < r for all j,
180 * then return a free module of rank s, having degrees
181 * d_(i_1), ..., d_(i_s). 'selection' may include duplicate values.
182 * If F has a Schreyer order, the result has one as well.
183 */
184
186 M2_arrayint lo,
187 M2_arrayint hi);
188/* If F_i has multi-degree >= lo, AND <= hi, then add i to the result
189 IF: lo has length 0, then treat that as -infinity in each component.
190 Same with hi.
191*/
192
193# if defined(__cplusplus)
194}
195# endif
196
197#endif /* _freemodule_h_ */
198
199// Local Variables:
200// indent-tabs-mode: nil
201// End:
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
xxx xxx xxx
Definition ring.hpp:102
Engine-wide include prelude — a single point of truth for portability shims.
#define Matrix
Definition factory.cpp:14
const Ring * IM2_FreeModule_ring(const FreeModule *F)
unsigned int rawFreeModuleHash(const FreeModule *F)
M2_bool IM2_FreeModule_is_equal(const FreeModule *F, const FreeModule *G)
const FreeModule * IM2_FreeModule_tensor(const FreeModule *F, const FreeModule *G)
const FreeModule * IM2_FreeModule_symm(int n, const FreeModule *F)
const Matrix * IM2_FreeModule_get_schreyer(const FreeModule *F)
const FreeModule * IM2_FreeModule_exterior(int n, const FreeModule *F)
const FreeModule * IM2_FreeModule_submodule(const FreeModule *F, M2_arrayint selection)
const FreeModule * IM2_FreeModule_sum(const FreeModule *F, const FreeModule *G)
const FreeModule * IM2_FreeModule_dual(const FreeModule *F)
int IM2_FreeModule_rank(const FreeModule *F)
M2_arrayintOrNull rawFreeModuleSelectByDegrees(const FreeModule *F, M2_arrayint lo, M2_arrayint hi)
const FreeModule * IM2_FreeModule_make(const Ring *R, int rank)
const FreeModule * IM2_FreeModule_make_degs(const Ring *R, M2_arrayint degs)
M2_string IM2_FreeModule_to_string(const FreeModule *F)
M2_arrayint IM2_FreeModule_get_degrees(const FreeModule *F)
const FreeModule * IM2_FreeModule_make_schreyer(const Matrix *m)
M2_arrayint M2_arrayintOrNull
Definition m2-types.h:99
char M2_bool
Definition m2-types.h:82
Definition aring-CC.cpp:3
tbb::flow::graph G