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

◆ compute()

void KBasis::compute ( )
private

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

423{
424 if (limit == 0) return;
425 std::vector<int> zero_vars;
427 {
428 for (int i = 0; i < mVariables.size(); i++)
429 {
430 if (var_wts[i] == 0) { zero_vars.push_back(i); }
431 }
432 }
433
434 for (int i = 0; i < bottom_matrix->n_rows(); i++)
435 {
436 if (system_interrupted()) return;
437 kb_comp = i;
438
439 // Make the monomial ideal: this should contain only
440 // monomials involving 'mVariables'.
441 kb_monideal = bottom_matrix->make_monideal(i, true);
442 // the true means: over ZZ, don't consider monomials with non-unit lead
443 // coeffs
444
445 if (kb_monideal->is_one()) continue;
446 if (hi_degree == nullptr)
447 {
448 // check here that kb_monideal is 0-dimensional
449 // (at least for the variables being used):
451 {
452 kb_error = true;
453 ERROR("module given is not finite over the base");
454 return;
455 }
456 }
457 else if (zero_vars.size() > 0)
458 {
459 // if we have any variables with zero degrees, then kb_monideal needs
460 // to be 0-dimensional in those variables.
461 if (!all_have_pure_powers(kb_monideal, zero_vars))
462 {
463 kb_error = true;
464 ERROR(
465 "module given is not finite over the zero-degree variables");
466 return;
467 }
468 }
469
470 const int *component_degree = bottom_matrix->rows()->degree(i);
471 D->to_expvector(component_degree, kb_exp_multidegree);
474
475 // Do the recursion
476 switch (computation_type)
477 {
478 case KB_FULL:
479 basis0_full();
480 break;
481 case KB_SINGLE:
483 break;
484 case KB_MULTI:
486 break;
487 }
488 }
489}
static Exponent weight(int nvars, ConstExponents a, const std::vector< Exponent > &wts)
int * kb_exp_multidegree
const Matrix * bottom_matrix
std::vector< int > mVariables
const Monoid * D
MonomialIdeal * kb_monideal
const int * hi_degree
enum KBasis::@037164154004220152265360251131226313056117246356 computation_type
std::vector< int > mHeftVector
int kb_exp_weight
int * var_wts
void basis0_singly_graded()
bool weight_has_zeros
void basis0_full()
void basis0_multi_graded()
bool system_interrupted()
const int ERROR
Definition m2-mem.cpp:55
static bool all_have_pure_powers(const MonomialIdeal *M, std::vector< int > varlist)

References all_have_pure_powers(), basis0_full(), basis0_multi_graded(), basis0_singly_graded(), bottom_matrix, computation_type, D, ERROR, hi_degree, kb_comp, kb_error, kb_exp_multidegree, kb_exp_weight, KB_FULL, kb_monideal, KB_MULTI, KB_SINGLE, limit, mHeftVector, mVariables, system_interrupted(), var_wts, ExponentVector< int, true >::weight(), and weight_has_zeros.

Referenced by k_basis().