Macaulay2 Engine
Loading...
Searching...
No Matches

◆ backtrack_mg()

bool KBasis::backtrack_mg ( int & curr)
inlineprivate

Definition at line 327 of file matrix-kbasis.cpp.

328{
329 int vcurr = -1;
330 // if we are the end, decrease the last entry to 0
331 if (curr == mVariables.size() - 1)
332 {
333 vcurr = mVariables[curr];
334 kb_exp_weight -= var_wts[curr] * kb_exp[vcurr];
337 var_degs + (mHeftVector.size() * curr),
338 -kb_exp[vcurr],
340 kb_exp[vcurr] = 0;
341 do {
342 curr--;
343 } while (curr >= 0 && kb_exp[mVariables[curr]] == 0);
344 }
345 if (curr < 0) return false;
346 vcurr = mVariables[curr];
347 kb_exp[vcurr]--;
348 kb_exp_weight -= var_wts[curr];
351 var_degs + (mHeftVector.size() * curr),
353 curr++;
354 return true;
355}
static void divide(int nvars, ConstExponents a, ConstExponents b, Exponents result)
static void multpower(int nvars, ConstExponents a, ConstExponents b, const Exponent n, Exponents result)
int * kb_exp_multidegree
std::vector< int > mVariables
int * var_degs
std::vector< int > mHeftVector
int kb_exp_weight
int * var_wts

References ExponentVector< int, true >::divide(), kb_exp, kb_exp_multidegree, kb_exp_weight, mHeftVector, ExponentVector< int, true >::multpower(), mVariables, var_degs, and var_wts.

Referenced by basis0_multi_graded().