498{
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
526
527 const PolynomialRing *
D =
P->get_degree_ring();
530
531 if (heftvec.size() >
D->n_vars())
532 {
533 ERROR(
"expected heft vector of length <= %d",
D->n_vars());
534 return nullptr;
535 }
536
537 if (lo && heftvec.size() !=
lo_degree->len)
538 {
539 ERROR(
"expected degrees of length %d", heftvec.size());
540 return nullptr;
541 }
542
543 if (hi && heftvec.size() !=
hi_degree->len)
544 {
545 ERROR(
"expected degrees of length %d", heftvec.size());
546 return nullptr;
547 }
548
549
550
551 if (heftvec.size() > 1 && lo && hi)
552 for (int i = 0; i < heftvec.size(); i++)
554 {
555 ERROR(
"expected degree bounds to be equal");
556 return nullptr;
557 }
558
560
561
562
563 if (lo || hi)
564 for (int i = 0; i < varlist.size(); i++)
565 if (KB.var_wts[i] < 0)
566 {
568 "basis: computation requires a heft form non-negative on the "
569 "degrees of the variables");
570 return nullptr;
571 }
572
573
574
575 if (lo != nullptr && hi != nullptr && lo[0] > hi[0]) return KB.value();
576
577 KB.compute();
579 return KB.value();
580}
KBasis(const Matrix *bottom, const int *lo_degree, const int *hi_degree, std::vector< int > heftvec, std::vector< int > varlist, bool do_truncation, int limit)
const Ring * get_ring() const
static Matrix * identity(const FreeModule *F)
const FreeModule * rows() const
virtual const PolynomialRing * cast_to_PolynomialRing() const
bool system_interrupted()