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

◆ set_hilbert_function()

Computation * gbA::set_hilbert_function ( const RingElement * h)
virtual

Reimplemented from GBComputation.

Definition at line 2684 of file gb-default.cpp.

2685{
2686 // TODO Problems here:
2687 // -- check that the ring is correct
2688 // -- if the computation has already been started, this will fail
2689 // So probably an error should be given, and 0 returned in this case.
2690
2691 // We may only use the Hilbert function if syzygies are not being collected
2692 // since otherwise we will miss syzygies
2693
2694 if (over_ZZ())
2695 {
2696 ERROR(
2697 "cannot use Hilbert function for Groebner basis computation over the "
2698 "integers");
2699 return nullptr;
2700 }
2701 if (!_collect_syz)
2702 {
2703 hf_orig = hf;
2704 hf_diff = RingElement::make_raw(hf->get_ring(), ZERO_RINGELEM);
2705 use_hilb = true;
2706 hilb_new_elems = true;
2707 state = STATE_HILB;
2708 }
2709
2710 return this;
2711}
static RingElement * make_raw(const Ring *R, ring_elem f)
Definition relem.cpp:20
enum gbA::gbA_state state
bool use_hilb
@ STATE_HILB
bool _collect_syz
bool hilb_new_elems
bool over_ZZ() const
RingElement * hf_diff
const RingElement * hf_orig
const int ERROR
Definition m2-mem.cpp:55
#define ZERO_RINGELEM
Definition ring.hpp:677

References _collect_syz, Computation::Computation(), ERROR, RingElement::get_ring(), hf_diff, hf_orig, hilb_new_elems, RingElement::make_raw(), over_ZZ(), state, STATE_HILB, use_hilb, and ZERO_RINGELEM.