createF4Res The only function to create an (F4) resolution computation The constructor for this class is private. This function provides all of the logic, and throws an exception if there is a problem.
32{
33
34
35
36
37
38
39
40 (void) strategy;
43 if (origR == nullptr)
44 {
45 ERROR(
"expected polynomial ring");
46 return nullptr;
47 }
49 {
50 ERROR(
"cannot use res(...,FastNonminimal=>true) for quotient rings");
51 return nullptr;
52 }
54 {
55 ERROR(
"cannot use res(...,FastNonminimal=>true) over Weyl algebras");
56 return nullptr;
57 }
59 {
61 "cannot use res(...,FastNonminimal=>true) over non-commutative "
62 "algebras");
63 return nullptr;
64 }
65
66
67
68
69
70
71
72
73
74
75
77 {
78 ERROR(
"expected the degree of each variable to be positive");
79 return nullptr;
80 }
81
82
83
91
95 motype);
98 {
100 }
101 else
102 {
104 }
105 auto result =
new F4ResComputation(origR, R, groebnerBasisMatrix, max_level, numThreads, parallelizeByDegree);
106
107
108
110 int maxdeg = 0;
112 {
114 for (
int j = 1; j < F->
rank(); j++)
116 }
117
118
119
121 for (
int i = 0; i < F->
rank(); i++)
122 {
125 MI->one(i, elem);
127 }
129
130
133 -1 );
134
135 std::vector<ResPolynomial> input_polys;
136 for (
int i = 0; i < groebnerBasisMatrix->
n_cols(); i++)
137 {
140 input_polys.emplace_back(std::move(f));
141 }
142
143
144 for (
int j = 0; j < F->
rank(); j++)
145 {
146
147 for (int i = 0; i < pos->len; i++)
148 {
149 int loc = pos->array[i];
151 if (f.
len == 0)
continue;
152 if (MI->get_component(f.
monoms.data()) != j)
continue;
155 MI->copy(f.
monoms.data(), elem);
156
159 {
161 "input polynomials/vectors were computed in a non-compatible "
162 "monomial order");
163
164 return nullptr;
165 }
166 }
167 }
169
170
171 delete leadterms;
172
174}
ResolutionComputation subclass that drives the F4 resolution engine (SchreyerFrame + F4Res) from the ...
int primary_degree(int i) const
Engine-side free module R^n over a Ring.
const Ring * get_ring() const
ring_elem elem(int i, int j) const
const FreeModule * rows() const
Matrix * lead_term(int n=-1) const
M2_arrayint sort(int degorder, int monorder) const
const FreeModule * cols() const
bool primary_degrees_of_vars_positive() const
std::vector< int > getPrimaryDegreeVector() const
const MonomialOrdering * getMonomialOrdering() const
std::vector< int > getFirstWeightVector() const
virtual bool is_solvable_algebra() const
virtual const Monoid * getMonoid() const
bool is_quotient_ring() const
virtual const Ring * getCoefficients() const
virtual bool is_weyl_algebra() const
const SkewMultiplication & getSkewInfo() const
bool is_skew_commutative() const
Abstract base for the engine's polynomial-ring hierarchy.
static void from_M2_vec(const ResPolyRing &R, const FreeModule *F, vec v, ResPolynomial &result)
The polynomial-ring view the F4 resolution engine reduces against: coefficient arithmetic plus the en...
std::vector< res_monomial_word > monoms
Polynomial type used by the F4 resolution engine: parallel coefficient vector and concatenated monomi...
virtual const PolynomialRing * cast_to_PolynomialRing() const
void insertLevelZero(res_packed_monomial monom, int degree, int maxdeglevel0)
ResMemoryBlock< res_monomial_word > & monomialBlock()
bool insertLevelOne(res_packed_monomial monom, int degree, ResPolynomial &syzygy)
State container for the in-progress free resolution built by the F4 resolution engine.
VALGRIND_MAKE_MEM_DEFINED & result(result)
int moIsLex(const MonomialOrdering *mo)
int moIsGRevLex(const MonomialOrdering *mo)
res_monomial_word * res_packed_monomial