PolyBoRi
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
groebner
include
polybori
groebner
LexHelper.h
Go to the documentation of this file.
1
// -*- c++ -*-
2
//*****************************************************************************
14
//*****************************************************************************
15
16
#ifndef polybori_groebner_LexHelper_h_
17
#define polybori_groebner_LexHelper_h_
18
19
// include basic definitions
20
#include "
groebner_defs.h
"
21
#include "
IsEcart0Predicate.h
"
22
#include "
ReductionStrategy.h
"
23
#include "
nf.h
"
24
25
BEGIN_NAMESPACE_PBORIGB
26
31
class
LexHelper
{
32
public
:
33
static
bool
irreducible_lead
(
const
Monomial
& m,
const
ReductionStrategy
& strat){
34
if
(strat.
optRedTailDegGrowth
)
return
PBORINAME::groebner::irreducible_lead
(m,strat);
35
else
{
36
BooleSet
ms=strat.
leadingTerms
.intersect(m.
divisors
());
37
if
(ms.
isZero
())
38
return
true
;
39
else
{
40
return
std::find_if(ms.
expBegin
(),ms.
expEnd
(),
IsEcart0Predicate
(strat))==ms.
expEnd
();
41
}
42
}
43
44
}
45
static
Polynomial::const_iterator
begin
(
const
Polynomial
& p){
46
return
p.
begin
();
47
}
48
static
Polynomial::const_iterator
end
(
const
Polynomial
& p){
49
return
p.
end
();
50
}
51
static
Polynomial
nf
(
const
ReductionStrategy
& strat,
const
Polynomial
& p,
const
Monomial
& m){
52
//return nf3_lexbuckets(strat,p,m);
53
if
(strat.
optRedTailDegGrowth
)
return
nf3
(strat,p,m);
54
else
return
nf3_no_deg_growth
(strat,p,m);
55
}
56
typedef
Polynomial::const_iterator
iterator_type
;
57
const
static
bool
isDegreeOrder=
false
;
58
const
static
bool
isLexicographicalOrder=
true
;
59
static
bool
knowRestIsIrreducible
(
const
iterator_type
& it,
const
ReductionStrategy
& strat){
60
if
( (it.deg()>0) && (it.firstIndex()>strat.
reducibleUntil
))
61
return
true
;
62
else
return
false
;
63
64
}
65
static
Polynomial
sum_range(std::vector<Monomial>& vec,
const
iterator_type
&
66
it,
const
iterator_type
& end,
Polynomial
init){
67
if
(vec.size()==1)
return
vec[0];
68
if
(it!=end)
69
return
term_accumulate
(it,end, init);
70
else
return
init;
71
}
72
};
73
74
END_NAMESPACE_PBORIGB
75
76
#endif
/* polybori_LexHelper_h_ */
Generated by
1.8.3.1