Macaulay2 Engine
Loading...
Searching...
No Matches
gbweight.hpp
Go to the documentation of this file.
1// Copyright 2004. Michael E. Stillman
2
3#ifndef _gbweight_hpp_
4#define _gbweight_hpp_
5
39
40#include "engine-includes.hpp" // for M2_arrayint
41
42#include "ExponentVector.hpp" // for const_exponents
43#include "monoid.hpp" // for const_monomial
44#include "newdelete.hpp" // for our_new_delete
45
46class FreeModule;
47class GBRing;
48class gbvector;
49
65// A class to compute the "heuristic weight" of elements
66// Mainly for use with Groebner basis computation
67{
70 const FreeModule *F_;
71
72 int nvars_;
74
75 size_t exp_size; // length in bytes of temporary exponent vectors
76 long *Fdegs_;
77
78 public:
79 GBWeight(const FreeModule *F, M2_arrayint wts);
80
82 M2_arrayint get_weights() const { return wts_; }
83 // All of these routines expect components in the range 1..N,
84 // or, if the component is 0, then it is in the ring, not in the
85 // free module F_
86
87 int exponents_weight(const_exponents e, int comp) const;
88
89 int gbvector_term_weight(const gbvector *f) const;
90
91 int gbvector_weight(const gbvector *f) const;
92
93 int gbvector_weight(const gbvector *f, int &lead_term_weight) const;
94
95 int monomial_weight(const_monomial m, int comp) const;
96};
97
98#endif
99
100// Local Variables:
101// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
102// indent-tabs-mode: nil
103// End:
exponents::ConstExponents const_exponents
Dense exponent-vector template [e_0, ..., e_{nvars-1}] for monomial operations.
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
Polynomial-ring view tuned for the inner loop of classical Buchberger Groebner-basis computations.
Definition gbring.hpp:120
int gbvector_term_weight(const gbvector *f) const
Definition gbweight.cpp:65
int monomial_weight(const_monomial m, int comp) const
Definition gbweight.cpp:99
M2_arrayint get_weights() const
Definition gbweight.hpp:82
GBRing * R_
Definition gbweight.hpp:73
M2_arrayint wts_
Definition gbweight.hpp:68
bool use_component_degrees_
Definition gbweight.hpp:69
const FreeModule * F_
Definition gbweight.hpp:70
size_t exp_size
Definition gbweight.hpp:75
int gbvector_weight(const gbvector *f) const
Definition gbweight.cpp:93
int nvars_
Definition gbweight.hpp:72
GBWeight(const FreeModule *F, M2_arrayint wts)
Definition gbweight.cpp:7
long * Fdegs_
Definition gbweight.hpp:76
int exponents_weight(const_exponents e, int comp) const
Definition gbweight.cpp:58
Engine-wide include prelude — a single point of truth for portability shims.
const int * const_monomial
Definition imonorder.hpp:45
Monoid — variable count, naming, grading, and monomial order of a polynomial ring.
our_new_delete — per-class opt-in routing of new / delete through bdwgc.