26{
27
28
29
30 if (max_level <= 0) max_level = 1;
31
34 int origsyz;
35
36
37
38
40 if (NCP != nullptr)
41 {
44 return C;
45 }
47 if (P == nullptr)
48 {
49 ERROR(
"engine resolution strategies all require a polynomial base ring");
50 return nullptr;
51 }
54 {
55 ERROR(
"free resolutions over polynomial rings with RR or CC coefficients not yet implemented");
56 return nullptr;
57 }
59 {
61 "engine resolution strategies all require a Heft vector which is "
62 "positive for all variables");
63 return nullptr;
64 }
65 if (algorithm < 4 and !m->is_homogeneous())
66 {
67 ERROR(
"engine resolution strategies require a homogeneous module");
68 return nullptr;
69 }
70
71 switch (algorithm)
72 {
73 case 1:
74 if (!resolve_cokernel)
75 {
77 "resolution Strategy=>1 cannot resolve a cokernel with a given "
78 "presentation: use Strategy=>2 or Strategy=>3 instead");
79 return nullptr;
80 }
82 {
84 "use resolution Strategy=>2 or Strategy=>3 for non commutative "
85 "polynomial rings");
86 return nullptr;
87 }
89 C = new res_comp(m, max_level, strategy);
90 break;
91 case 0:
92 if (!resolve_cokernel)
93 {
95 "resolution Strategy=>0 cannot resolve a cokernel with a given "
96 "presentation: use Strategy=>2 or Strategy=>3 instead");
97 return nullptr;
98 }
100 {
102 "use resolution Strategy=>2 or Strategy=>3 for non commutative "
103 "polynomial rings");
104 return nullptr;
105 }
107 C = new res2_comp(
108 m, max_level, use_max_slanted_degree, max_slanted_degree, strategy);
109 break;
110 case 2:
113 C = new gbres_comp(m, max_level + 1, origsyz, strategy);
114 break;
115 case 3:
118 C = new gbres_comp(
120 break;
121 case 4:
122 case 5:
123 if (!resolve_cokernel)
124 {
126 "resolution Strategy=>4 cannot resolve a cokernel with a given "
127 "presentation: use Strategy=>2 or Strategy=>3 instead");
128 return nullptr;
129 }
131 {
133 "use resolution Strategy=>2 or Strategy=>3 for non commutative "
134 "polynomial rings");
135 return nullptr;
136 }
138 C =
createF4Res(m, max_level, strategy, numThreads, parallelizeByDegree);
139 if (C == nullptr) return nullptr;
140 break;
141 }
142 if (C == nullptr)
143 {
144 ERROR(
"unknown resolution algorithm");
145 return nullptr;
146 }
148 return C;
149}
const Ring * get_ring() const
bool primary_degrees_of_vars_positive() const
const Ring * getCoefficientRing() const
virtual const Monoid * getMonoid() const
bool is_skew_commutative() const
virtual const M2FreeAlgebraOrQuotient * cast_to_M2FreeAlgebraOrQuotient() const
virtual bool is_commutative_ring() const
virtual unsigned long get_precision() const
virtual const PolynomialRing * cast_to_PolynomialRing() const
void intern_res(ResolutionComputation *G)
ResolutionComputation * createNCRes(const Matrix *gbModuleMatrix, int max_level, int strategy)
ResolutionComputation * createF4Res(const Matrix *groebnerBasisMatrix, int max_level, int strategy, int numThreads, bool parallelizeByDegree)
void emit_line(const char *s)