PivotEulerAlg.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2010 University of Aarhus
Contact Bjarke Hammersholt Roune for license information (www.broune.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#ifndef PIVOT_EULER_ALG_GUARD
#define PIVOT_EULER_ALG_GUARD
#include "PivotStrategy.h"
#include <vector>
#include <cstdio>
class Ideal;
class RawSquareFreeIdeal;
class EulerState;
class PivotEulerAlg {
public:
PivotEulerAlg();
const mpz_class& computeEulerCharacteristic(const Ideal& ideal);
const mpz_class& computeEulerCharacteristic(const RawSquareFreeIdeal& ideal);
const mpz_class& getComputedEulerCharacteristic() const {return _euler;}
void setPivotStrategy(unique_ptr<PivotStrategy> strategy) {
_pivotStrategy = std::move(strategy);
}
void setInitialAutoTranspose(bool value) {_initialAutoTranspose = value;}
bool getInitialAutoTranspose() const {return _initialAutoTranspose;}
void setAutoTranspose(bool value) {_autoTranspose = value;}
bool getAutoTranspose() const {return _autoTranspose;}
void setUseUniqueDivSimplify(bool value) {_useUniqueDivSimplify = value;}
bool getUseUniqueDivSimplify() const {return _useUniqueDivSimplify;}
void setUseManyDivSimplify(bool value) {_useManyDivSimplify = value;}
bool getUseManyDivSimplify() const {return _useManyDivSimplify;}
void setUseAllPairsSimplify(bool value) {_useAllPairsSimplify = value;}
bool getUseAllPairsSimplify() const {return _useAllPairsSimplify;}
private:
void computeEuler(EulerState* state);
bool autoTranspose(EulerState& state);
EulerState* processState(EulerState& state);
void getPivot(const EulerState& state, Word* pivot);
mpz_class _euler;
Word* _termTmp;
vector<size_t> _divCountsTmp;
bool _useUniqueDivSimplify;
bool _useManyDivSimplify;
bool _useAllPairsSimplify;
bool _autoTranspose;
bool _initialAutoTranspose;
unique_ptr<PivotStrategy> _pivotStrategy;
};
#endif
PivotStrategy.h
EulerState
Definition EulerState.h:25
Ideal
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
PivotEulerAlg::getInitialAutoTranspose
bool getInitialAutoTranspose() const
Definition PivotEulerAlg.h:43
PivotEulerAlg::_useAllPairsSimplify
bool _useAllPairsSimplify
Definition PivotEulerAlg.h:70
PivotEulerAlg::getUseUniqueDivSimplify
bool getUseUniqueDivSimplify() const
Definition PivotEulerAlg.h:49
PivotEulerAlg::setAutoTranspose
void setAutoTranspose(bool value)
Definition PivotEulerAlg.h:45
PivotEulerAlg::getUseAllPairsSimplify
bool getUseAllPairsSimplify() const
Definition PivotEulerAlg.h:55
PivotEulerAlg::_useManyDivSimplify
bool _useManyDivSimplify
Definition PivotEulerAlg.h:69
PivotEulerAlg::setUseUniqueDivSimplify
void setUseUniqueDivSimplify(bool value)
Definition PivotEulerAlg.h:48
PivotEulerAlg::PivotEulerAlg
PivotEulerAlg()
Definition PivotEulerAlg.cpp:243
PivotEulerAlg::processState
EulerState * processState(EulerState &state)
Definition PivotEulerAlg.cpp:199
PivotEulerAlg::_useUniqueDivSimplify
bool _useUniqueDivSimplify
Definition PivotEulerAlg.h:68
PivotEulerAlg::_autoTranspose
bool _autoTranspose
Definition PivotEulerAlg.h:71
PivotEulerAlg::computeEulerCharacteristic
const mpz_class & computeEulerCharacteristic(const Ideal &ideal)
Definition PivotEulerAlg.cpp:253
PivotEulerAlg::_euler
mpz_class _euler
Definition PivotEulerAlg.h:64
PivotEulerAlg::setUseManyDivSimplify
void setUseManyDivSimplify(bool value)
Definition PivotEulerAlg.h:51
PivotEulerAlg::getUseManyDivSimplify
bool getUseManyDivSimplify() const
Definition PivotEulerAlg.h:52
PivotEulerAlg::setPivotStrategy
void setPivotStrategy(unique_ptr< PivotStrategy > strategy)
Definition PivotEulerAlg.h:38
PivotEulerAlg::_divCountsTmp
vector< size_t > _divCountsTmp
Definition PivotEulerAlg.h:66
PivotEulerAlg::setUseAllPairsSimplify
void setUseAllPairsSimplify(bool value)
Definition PivotEulerAlg.h:54
PivotEulerAlg::_termTmp
Word * _termTmp
Definition PivotEulerAlg.h:65
PivotEulerAlg::_initialAutoTranspose
bool _initialAutoTranspose
Definition PivotEulerAlg.h:72
PivotEulerAlg::autoTranspose
bool autoTranspose(EulerState &state)
Definition PivotEulerAlg.cpp:311
PivotEulerAlg::_pivotStrategy
unique_ptr< PivotStrategy > _pivotStrategy
Definition PivotEulerAlg.h:73
PivotEulerAlg::setInitialAutoTranspose
void setInitialAutoTranspose(bool value)
Definition PivotEulerAlg.h:42
PivotEulerAlg::computeEuler
void computeEuler(EulerState *state)
Definition PivotEulerAlg.cpp:297
PivotEulerAlg::getComputedEulerCharacteristic
const mpz_class & getComputedEulerCharacteristic() const
Definition PivotEulerAlg.h:36
PivotEulerAlg::getPivot
void getPivot(const EulerState &state, Word *pivot)
Definition PivotEulerAlg.cpp:239
PivotEulerAlg::getAutoTranspose
bool getAutoTranspose() const
Definition PivotEulerAlg.h:46
RawSquareFreeIdeal
A bit packed square free ideal placed in a pre-allocated buffer.
Definition RawSquareFreeIdeal.h:37
Word
unsigned long Word
The native unsigned type for the CPU.
Definition stdinc.h:93