PolyBoRi
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
groebner
src
nf.h
Go to the documentation of this file.
1
/*
2
* nf.h
3
* PolyBoRi
4
*
5
* Created by Michael Brickenstein on 25.04.06.
6
* Copyright 2006 The PolyBoRi Team. See LICENSE file.
7
*
8
*/
9
#include <algorithm>
10
#include <vector>
11
#include <queue>
12
#include "
groebner_alg.h
"
13
#ifndef PBORI_GB_NF_H
14
#define PBORI_GB_NF_H
15
BEGIN_NAMESPACE_PBORIGB
16
Polynomial
add_up_exponents
(
const
std::vector<Exponent>& vec);
17
Polynomial
add_up_monomials
(
const
std::vector<Monomial>& res_vec);
18
int
select1
(
const
GroebnerStrategy& strat,
const
Polynomial
& p);
19
int
select1
(
const
GroebnerStrategy& strat,
const
Monomial
& m);
20
21
int
select_no_deg_growth
(
const
GroebnerStrategy& strat,
const
Monomial
& m);
22
23
static
int
select_short(
const
GroebnerStrategy& strat,
const
Polynomial
& p);
24
static
int
select_short(
const
GroebnerStrategy& strat,
const
Monomial
& m);
25
26
Polynomial
nf1
(GroebnerStrategy& strat,
Polynomial
p);
27
28
Polynomial
nf2
(GroebnerStrategy& strat,
Polynomial
p);
29
Polynomial
nf2_short
(GroebnerStrategy& strat,
Polynomial
p);
30
31
Polynomial
nf_delaying
(GroebnerStrategy& strat,
Polynomial
p);
32
Polynomial
nf_delaying_exchanging
(GroebnerStrategy& strat,
Polynomial
p);
33
34
class
LMLessCompare
{
35
public
:
36
bool
operator() (
const
Polynomial
& p1,
const
Polynomial
& p2){
37
return
p1.
lead
()<p2.
lead
();
38
}
39
};
40
41
const
int
SLIMGB_SIMPLEST
=0;
42
template
<
int
variant>
class
SlimgbReduction
{
43
private
:
44
GroebnerStrategy
* strat;
45
std::priority_queue<Polynomial, std::vector<Polynomial>,
LMLessCompare
> to_reduce;
46
public
:
47
std::vector<Polynomial>
result
;
48
49
SlimgbReduction
(
GroebnerStrategy
& strat){
50
this->strat=&strat;
51
}
52
SlimgbReduction
(){}
53
void
addPolynomial(
const
Polynomial
& p);
54
void
reduce();
55
//return zero at the end
56
Polynomial
nextResult();
57
};
58
template
<
int
variant>
void
SlimgbReduction<variant>::addPolynomial
(
const
Polynomial
& p){
59
if
(!(p.
isZero
())){
60
to_reduce.push(p);
61
}
62
}
63
template
<
int
variant>
Polynomial
SlimgbReduction<variant>::nextResult
(){
64
if
(result.size()==0)
return
Polynomial
();
65
Polynomial
res=result.back();
66
result.pop_back();
67
return
res;
68
}
69
typedef
SlimgbReduction<SLIMGB_SIMPLEST>
slimgb_reduction_type
;
70
std::vector<Polynomial>
parallel_reduce
(std::vector<Polynomial> inp,
GroebnerStrategy
& strat,
int
average_steps,
double
delay_f);
71
Polynomial
red_tail
(
const
GroebnerStrategy
& strat,
Polynomial
p);
72
Polynomial
red_tail_short
(
const
GroebnerStrategy
& strat,
Polynomial
p);
73
Polynomial
nf3
(
const
GroebnerStrategy
& strat,
Polynomial
p,
Monomial
rest_lead);
74
Polynomial
nf3_short
(
const
GroebnerStrategy
& strat,
Polynomial
p);
75
Polynomial
red_tail_self_tuning
(
const
GroebnerStrategy
& strat,
Polynomial
p);
76
Polynomial
ll_red_nf
(
const
Polynomial
& p,
const
BooleSet
& reductors);
77
78
Polynomial
ll_red_nf_noredsb
(
const
Polynomial
& p,
const
BooleSet
& reductors);
79
Polynomial
add_up_polynomials
(
const
std::vector<Polynomial>& vec);
80
Polynomial
plug_1
(
const
Polynomial
& p,
const
MonomialSet
& m_plus_ones);
81
MonomialSet
mod_mon_set
(
const
MonomialSet
& as,
const
MonomialSet
&vs);
82
END_NAMESPACE_PBORIGB
83
#endif
Generated on Wed Apr 16 2014 05:41:15 for PolyBoRi by
1.8.1.2