Gröbner basis project
Codebase for research into Gröbner basis computation
algorithm_buchberger_dynamic.hpp
1 #ifndef __ALGORITHM_BUCHBERGER_DYNAMIC_HPP_
2 #define __ALGORITHM_BUCHBERGER_DYNAMIC_HPP_
3 
4 /*****************************************************************************\
5 * This file is part of DynGB. *
6 * *
7 * DynGB is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * Foobar is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with DynGB. If not, see <http://www.gnu.org/licenses/>. *
19 \*****************************************************************************/
20 
21 #include <set>
22 #include <list>
23 #include <iostream>
24 
25 using std::list;
26 using std::cout; using std::endl;
27 using std::next;
28 using std::set;
29 
30 #include "system_constants.hpp"
31 
32 #include "fields.hpp"
33 #include "monomial.hpp"
34 #include "polynomial.hpp"
35 #include "critical_pair.hpp"
36 #include "normal_strategy.hpp"
37 #include "polynomial_array.hpp"
38 #include "polynomial_geobucket.hpp"
39 #include "polynomial_linked_list.hpp"
40 #include "polynomial_double_buffered.hpp"
41 
42 #include "sugar_strategy.hpp"
43 #include "weighted_sugar_strategy.hpp"
44 
45 #include "dynamic_engine.hpp"
46 #include "algorithm_buchberger_basic.hpp"
47 
62  Mutable_Polynomial **sp, const list<Abstract_Polynomial *> G
63 );
64 
79  SKELETON_SOLVER = 1,
80  GLPK_SOLVER,
81  PPL_SOLVER,
82  GLPK_ORACLE_SOLVER
83 };
84 
93 void initial_analysis(
94  const list<Abstract_Polynomial *> & F,
95  Monomial_Ordering * & mord,
96  LP_Solver * solver
97 );
98 
126 list<Constant_Polynomial *> buchberger_dynamic(
127  const list<Abstract_Polynomial *> &F,
128  SPolyCreationFlags method = SPolyCreationFlags::GEOBUCKETS,
129  StrategyFlags strategy = StrategyFlags::SUGAR_STRATEGY,
130  WT_TYPE * strategy_weights = nullptr,
131  DynamicHeuristic heuristic = DynamicHeuristic::ORD_HILBERT_THEN_DEG,
132  DynamicSolver solver = SKELETON_SOLVER,
133  bool analyze_inputs = false
134 );
135 
136 // instantiation of templated functions
137 
138 template bool no_triplet<Critical_Pair_Dynamic>(
139  const Critical_Pair_Dynamic *, const list<Critical_Pair_Dynamic *>
140 );
141 
142 template void report_critical_pairs<Critical_Pair_Dynamic>(
143  const list<Critical_Pair_Dynamic *>, bool
144 );
145 
146 template void sort_pairs_by_strategy<Critical_Pair_Dynamic>(
147  list<Critical_Pair_Dynamic *> &
148 );
149 
150 #endif
void reduce_over_basis_dynamic(Mutable_Polynomial **sp, const list< Abstract_Polynomial *> G)
Reduce the polynomial r over the basis G.
Controls the creation of s-polynomials, specialized for the dynamic algorithm.
StrategyFlags
flag indicating which strategy to use for computation
Definition: strategies.hpp:34
SPolyCreationFlags
flag indicating which structure to use for an s-polynomial
DynamicHeuristic
exact or approximate polyhedral cone solution, with methods allowing definition and refinement ...
Definition: lp_solver.hpp:504
Polynomials that need arithmetic typically descend from this class.
Definition: polynomial.hpp:305
interface to a monomial ordering
DynamicSolver
used by buchberger_dynamic() to decide which solver to use
list< Constant_Polynomial * > buchberger_dynamic(const list< Abstract_Polynomial *> &F, SPolyCreationFlags method=SPolyCreationFlags::GEOBUCKETS, StrategyFlags strategy=StrategyFlags::SUGAR_STRATEGY, WT_TYPE *strategy_weights=nullptr, DynamicHeuristic heuristic=DynamicHeuristic::ORD_HILBERT_THEN_DEG, DynamicSolver solver=SKELETON_SOLVER, bool analyze_inputs=false)
implementation of the dynamic Buchberger algorithm