Frobby 0.10.0
Loading...
Searching...
No Matches
PivotEulerAlg.h
1/* Frobby: Software for monomial ideal computations.
2 Copyright (C) 2010 University of Aarhus
3 Contact Bjarke Hammersholt Roune for license information (www.broune.com)
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see http://www.gnu.org/licenses/.
17*/
18#ifndef PIVOT_EULER_ALG_GUARD
19#define PIVOT_EULER_ALG_GUARD
20
21#include "PivotStrategy.h"
22
23#include <vector>
24#include <cstdio>
25
26class Ideal;
28class EulerState;
29
30class PivotEulerAlg {
31 public:
32 PivotEulerAlg();
33
34 const mpz_class& computeEulerCharacteristic(const Ideal& ideal);
35 const mpz_class& computeEulerCharacteristic(const RawSquareFreeIdeal& ideal);
36 const mpz_class& getComputedEulerCharacteristic() const {return _euler;}
37
38 void setPivotStrategy(unique_ptr<PivotStrategy> strategy) {
39 _pivotStrategy = std::move(strategy);
40 }
41
42 void setInitialAutoTranspose(bool value) {_initialAutoTranspose = value;}
43 bool getInitialAutoTranspose() const {return _initialAutoTranspose;}
44
45 void setAutoTranspose(bool value) {_autoTranspose = value;}
46 bool getAutoTranspose() const {return _autoTranspose;}
47
48 void setUseUniqueDivSimplify(bool value) {_useUniqueDivSimplify = value;}
49 bool getUseUniqueDivSimplify() const {return _useUniqueDivSimplify;}
50
51 void setUseManyDivSimplify(bool value) {_useManyDivSimplify = value;}
52 bool getUseManyDivSimplify() const {return _useManyDivSimplify;}
53
54 void setUseAllPairsSimplify(bool value) {_useAllPairsSimplify = value;}
55 bool getUseAllPairsSimplify() const {return _useAllPairsSimplify;}
56
57 private:
58 void computeEuler(EulerState* state);
59 bool autoTranspose(EulerState& state);
60
61 EulerState* processState(EulerState& state);
62 void getPivot(const EulerState& state, Word* pivot);
63
64 mpz_class _euler;
65 Word* _termTmp;
66 vector<size_t> _divCountsTmp;
67
68 bool _useUniqueDivSimplify;
69 bool _useManyDivSimplify;
70 bool _useAllPairsSimplify;
71 bool _autoTranspose;
72 bool _initialAutoTranspose;
73 unique_ptr<PivotStrategy> _pivotStrategy;
74};
75
76#endif
Definition EulerState.h:25
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
Definition RawSquareFreeIdeal.h:37
unsigned long Word
Definition stdinc.h:60