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

◆ backtrack()

bool KBasis::backtrack ( int & curr)
inlineprivate

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

254{
255 // if we are the end, decrease the last entry to 0
256 if (curr == mVariables.size() - 1)
257 {
258 kb_exp_weight -= var_wts[curr] * kb_exp[mVariables[curr]];
259 kb_exp[mVariables[curr]] = 0;
260 do {
261 curr--;
262 } while (curr >= 0 && kb_exp[mVariables[curr]] == 0);
263 }
264 if (curr < 0) return false;
265 kb_exp[mVariables[curr]]--;
266 kb_exp_weight -= var_wts[curr];
267 curr++;
268 return true;
269}
std::vector< int > mVariables
int kb_exp_weight
int * var_wts

References kb_exp, kb_exp_weight, mVariables, and var_wts.

Referenced by basis0_full(), and basis0_singly_graded().