19typedef mgb::GroebnerConfiguration::VarIndex
VarIndex;
20typedef mgb::GroebnerConfiguration::Exponent
Exponent;
21typedef mgb::GroebnerConfiguration::BaseOrder
BaseOrder;
113 mgb::GroebnerConfiguration::BaseOrder
baseOrder =
114 mgb::GroebnerConfiguration::RevLexDescendingBaseOrder;
122 if (r->block0[
block] < 0 || r->block1[
block] < 0)
124 WerrorS(
"Unexpected negative block0/block1 in ring.");
129 const int*
const weights = r->wvhdl[
block];
132 WerrorS(
"Unexpected block0 > block1 in ring.");
139 if (block0 != 0 || block1 != 0 || weights != 0)
141 WerrorS(
"Unexpected non-zero fields on c/C block in ring.");
146 WerrorS(
"Unexpected two c/C blocks in ring.");
152 conf.setComponentBefore
153 (mgb::GroebnerConfiguration::ComponentAfterBaseOrder);
159 if (block0 == 0 || block1 == 0)
161 WerrorS(
"Expected block0 != 0 and block1 != 0 in ring.");
164 if (block1 > varCount)
167 WerrorS(
"Expected block1 <= #vars in ring.");
172 const size_t dim =
static_cast<size_t>(block1 - block0 + 1);
192 WerrorS(
"Block type a64 not supported for MathicGB interface.");
210 WerrorS(
"Expect wvhdl == 0 in Dp/dp/Ds/ds-block in ring.");
214 for (
int var = block0 - 1; var < block1; ++var)
221 WerrorS(
"Expect wvhdl != 0 in a/Wp/wp/ws/Ws-block in ring.");
226 for (
int var = 0; var <
dim; ++var)
227 gradings[begin + (block0 - 1) + var] = weights[var];
231 for (
int var = 0; var <
dim; ++var)
232 gradings[begin + (block0 - 1) + var] = -weights[var];
263 baseOrder = mgb::GroebnerConfiguration::LexAscendingBaseOrder;
265 baseOrder = mgb::GroebnerConfiguration::RevLexDescendingBaseOrder;
267 baseOrder = mgb::GroebnerConfiguration::LexDescendingBaseOrder;
269 baseOrder = mgb::GroebnerConfiguration::RevLexAscendingBaseOrder;
273 const size_t begin =
gradings.size();
278 for (
size_t row = 0; row <
dim; ++row)
279 gradings[begin + row * varCount + (block0 - 1) + row] = value;
283 for (
size_t row = 0; row <
dim; ++row)
284 gradings[begin + row * varCount + (block1 - 1) - row] = value;
294 WerrorS(
"Expected wvhdl != 0 in M-block in ring.");
297 const size_t begin =
gradings.size();
299 for (
size_t row = 0; row <
dim; ++row)
300 for (
size_t col = block0 - 1; col < block1; ++col)
301 gradings[begin + row * varCount + col] = weights[row *
dim + col];
313 WerrorS(
"Schreyer order s/S/IS not supported in MathicGB interface.");
320 WerrorS(
"Block type am not supported in MathicGB interface");
325 WerrorS(
"Invalid L-block found in order of ring.");
331 WerrorS(
"aa ordering not supported by the MathicGB interface.");
336 WerrorS(
"Invalid unspec-block found in order of ring.");
339 WerrorS(
"Unknown block type found in order of ring.");
345 WerrorS(
"Expected to find a c/C block in ring.");
351 WerrorS(
"MathicGB does not support non-global orders.");
359 const int varCount = r->N;
363 const std::vector<Exponent>&
gradings =
conf.monomialOrder().second;
364 if (
gradings.size() % varCount != 0)
366 WerrorS(
"Expected matrix to be a multiple of varCount.");
370 std::cout <<
"Order matrix:\n";
371 for (
size_t row = 0; row <
rowCount; ++row)
373 for (
size_t col = 0; col < varCount; ++col)
374 std::cerr <<
' ' <<
gradings[row * varCount + col];
379 << mgb::GroebnerConfiguration::baseOrderName(
conf.monomialOrder().
first)
381 std::cerr <<
"Component before: " <<
conf.componentBefore() <<
'\n';
382 std::cerr <<
"Components ascending: " <<
conf.componentsAscending() <<
'\n';
383 std::cerr <<
"Schreyering: " <<
conf.schreyering() <<
'\n';
389 std::cout <<
"Printing order of ring.\n";
392 switch (r->order[
block])
491 std::cout <<
"unspec";
494 const int b0 = r->block0[
block];
495 const int b1 = r->block1[
block];
496 std::cout <<
' ' <<
b0 <<
':' <<
b1 <<
" (" << r->wvhdl[
block] <<
")" << std::flush;
497 if (r->wvhdl[
block] != 0 &&
b0 != 0)
499 for (
int v = 0;
v <=
b1 -
b0; ++
v)
500 std::cout <<
' ' << r->wvhdl[
block][
v];
502 std::cout <<
" null";
511 WerrorS(
"There is no current ring.");
527 WerrorS(
"Syntax: mathicgb(<ideal>/<module>)");
532 WerrorS(
"Polynomial ring must be over Zp.");
546 conf.setLogging(
"all");
555 const poly
origP =
id->m[
i];
581template class std::vector<Exponent>;
void appendPolynomialDone()
void appendTermBegin(const mgb::GroebnerConfiguration::Component c)
VarIndex varCount() const
Coefficient modulus() const
void idealBegin(size_t polyCount)
MathicToSingStream(Coefficient modulus, VarIndex varCount)
void appendTermDone(Coefficient coefficient)
void appendExponent(VarIndex index, Exponent exponent)
void appendPolynomialBegin(size_t termCount)
const Coefficient mModulus
Class used for (list of) interpreter objects.
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
feOptIndex feGetOptIndex(const char *name)
EXTERN_VAR struct fe_option feOptSpec[]
#define idDelete(H)
delete an ideal
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
static int index(p_Length length, p_Ord ord)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
#define pGetComp(p)
Component.
#define pGetExp(p, i)
Exponent.
#define pInit()
allocates a new monomial and initializes everything to 0
static BOOLEAN rField_is_Zp(const ring r)
@ ringorder_a64
for int64 weights
@ ringorder_aa
for idElimination, like a, except pFDeg, pWeigths ignore it
@ ringorder_IS
Induced (Schreyer) ordering.
ideal idInit(int idsize, int rank)
initialise an ideal / module
mgb::GroebnerConfiguration::Coefficient Coefficient
BOOLEAN mathicgb(leftv result, leftv arg)
int SI_MOD_INIT singmathic(SModulFunctions *psModulFunctions)
BOOLEAN prOrderX(leftv result, leftv arg)
mgb::GroebnerConfiguration::Exponent Exponent
bool prOrderMatrix(ring r)
bool setOrder(ring r, mgb::GroebnerConfiguration &conf)
mgb::GroebnerConfiguration::VarIndex VarIndex
mgb::GroebnerConfiguration::BaseOrder BaseOrder