CommonParamsHelper.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 COMMON_PARAMS_HELPER
#define COMMON_PARAMS_HELPER
#include "CoefTermConsumer.h"
#include "TermConsumer.h"
#include "TermTranslator.h"
#include "Ideal.h"
class CommonParams;
class Ideal;
class DataType;
class Scanner;
class CommonParams;
class BigIdeal;
class BigTermConsumer;
class CoefBigTermConsumer;
class TermTranslator;
class CommonParamsHelper {
public:
CommonParamsHelper();
~CommonParamsHelper();
void readIdealAndSetOutput(const CommonParams& params,
const DataType& output);
void readIdealAndSetPolyOutput(const CommonParams& params);
void readIdealAndSetIdealOutput(const CommonParams& params);
void setIdealAndIdealOutput(const CommonParams& params,
const BigIdeal& input,
BigTermConsumer& output);
void setIdealAndPolyOutput(const CommonParams& params,
const BigIdeal& input,
CoefBigTermConsumer& output);
const VarNames& getNames() {return _translator->getNames();}
Ideal& getIdeal() {return *_ideal;}
const Ideal& getIdeal() const {return *_ideal;}
unique_ptr<Ideal> takeIdeal() {return std::move(_ideal);}
bool hasIdeal() const {return _ideal.get() != 0;}
TermTranslator& getTranslator() {return *_translator;}
const TermTranslator& getTranslator() const {return *_translator;}
unique_ptr<TermTranslator> takeTranslator() {return std::move(_translator);}
BigTermConsumer& getIdealConsumer() {return *_idealConsumer;}
unique_ptr<TermConsumer> makeTranslatedIdealConsumer(bool split = false);
CoefBigTermConsumer& getPolyConsumer() {return *_polyConsumer;}
unique_ptr<CoefTermConsumer> makeTranslatedPolyConsumer();
unique_ptr<CoefTermConsumer> makeToUnivariatePolyConsumer();
void addPurePowersAtInfinity();
private:
// No copies
CommonParamsHelper(const CommonParamsHelper&);
CommonParamsHelper& operator=(const CommonParamsHelper&);
void readIdeal(const CommonParams& params, Scanner& in);
void setIdeal(const CommonParams& params, const BigIdeal& ideal);
unique_ptr<Ideal> _ideal;
unique_ptr<TermTranslator> _translator;
BigTermConsumer* _idealConsumer;
unique_ptr<BigTermConsumer> _idealConsumerDeleter;
CoefBigTermConsumer* _polyConsumer;
unique_ptr<CoefBigTermConsumer> _polyConsumerDeleter;
bool _produceCanonicalOutput;
};
#endif
CoefTermConsumer.h
Ideal.h
TermConsumer.h
TermTranslator.h
BigIdeal
Definition BigIdeal.h:27
BigTermConsumer
Definition BigTermConsumer.h:29
CoefBigTermConsumer
Definition CoefBigTermConsumer.h:29
CommonParamsHelper::getTranslator
TermTranslator & getTranslator()
Definition CommonParamsHelper.h:70
CommonParamsHelper::setIdeal
void setIdeal(const CommonParams &params, const BigIdeal &ideal)
Definition CommonParamsHelper.cpp:176
CommonParamsHelper::makeTranslatedIdealConsumer
unique_ptr< TermConsumer > makeTranslatedIdealConsumer(bool split=false)
Definition CommonParamsHelper.cpp:129
CommonParamsHelper::getPolyConsumer
CoefBigTermConsumer & getPolyConsumer()
Definition CommonParamsHelper.h:78
CommonParamsHelper::_produceCanonicalOutput
bool _produceCanonicalOutput
Definition CommonParamsHelper.h:101
CommonParamsHelper::readIdeal
void readIdeal(const CommonParams &params, Scanner &in)
Definition CommonParamsHelper.cpp:168
CommonParamsHelper::CommonParamsHelper
CommonParamsHelper()
Definition CommonParamsHelper.cpp:43
CommonParamsHelper::addPurePowersAtInfinity
void addPurePowersAtInfinity()
Definition CommonParamsHelper.cpp:164
CommonParamsHelper::_polyConsumerDeleter
unique_ptr< CoefBigTermConsumer > _polyConsumerDeleter
Definition CommonParamsHelper.h:99
CommonParamsHelper::setIdealAndIdealOutput
void setIdealAndIdealOutput(const CommonParams &params, const BigIdeal &input, BigTermConsumer &output)
Use given ideal and support ideal output.
Definition CommonParamsHelper.cpp:110
CommonParamsHelper::CommonParamsHelper
CommonParamsHelper(const CommonParamsHelper &)
CommonParamsHelper::getIdealConsumer
BigTermConsumer & getIdealConsumer()
Definition CommonParamsHelper.h:74
CommonParamsHelper::_ideal
unique_ptr< Ideal > _ideal
Definition CommonParamsHelper.h:92
CommonParamsHelper::_idealConsumerDeleter
unique_ptr< BigTermConsumer > _idealConsumerDeleter
Definition CommonParamsHelper.h:96
CommonParamsHelper::getNames
const VarNames & getNames()
Definition CommonParamsHelper.h:63
CommonParamsHelper::readIdealAndSetOutput
void readIdealAndSetOutput(const CommonParams &params, const DataType &output)
Read input ideal and support specified kind of output.
Definition CommonParamsHelper.cpp:54
CommonParamsHelper::takeTranslator
unique_ptr< TermTranslator > takeTranslator()
Definition CommonParamsHelper.h:72
CommonParamsHelper::readIdealAndSetIdealOutput
void readIdealAndSetIdealOutput(const CommonParams &params)
Read input and support ideal output.
Definition CommonParamsHelper.cpp:98
CommonParamsHelper::getTranslator
const TermTranslator & getTranslator() const
Definition CommonParamsHelper.h:71
CommonParamsHelper::getIdeal
Ideal & getIdeal()
Definition CommonParamsHelper.h:65
CommonParamsHelper::operator=
CommonParamsHelper & operator=(const CommonParamsHelper &)
CommonParamsHelper::getIdeal
const Ideal & getIdeal() const
Definition CommonParamsHelper.h:66
CommonParamsHelper::readIdealAndSetPolyOutput
void readIdealAndSetPolyOutput(const CommonParams &params)
Read input and support polynomial output.
Definition CommonParamsHelper.cpp:85
CommonParamsHelper::_idealConsumer
BigTermConsumer * _idealConsumer
Definition CommonParamsHelper.h:95
CommonParamsHelper::takeIdeal
unique_ptr< Ideal > takeIdeal()
Definition CommonParamsHelper.h:67
CommonParamsHelper::makeTranslatedPolyConsumer
unique_ptr< CoefTermConsumer > makeTranslatedPolyConsumer()
Definition CommonParamsHelper.cpp:149
CommonParamsHelper::makeToUnivariatePolyConsumer
unique_ptr< CoefTermConsumer > makeToUnivariatePolyConsumer()
Definition CommonParamsHelper.cpp:159
CommonParamsHelper::hasIdeal
bool hasIdeal() const
Definition CommonParamsHelper.h:68
CommonParamsHelper::setIdealAndPolyOutput
void setIdealAndPolyOutput(const CommonParams &params, const BigIdeal &input, CoefBigTermConsumer &output)
Use given ideal and support polynomial output.
Definition CommonParamsHelper.cpp:119
CommonParamsHelper::_polyConsumer
CoefBigTermConsumer * _polyConsumer
Definition CommonParamsHelper.h:98
CommonParamsHelper::~CommonParamsHelper
~CommonParamsHelper()
Definition CommonParamsHelper.cpp:49
CommonParamsHelper::_translator
unique_ptr< TermTranslator > _translator
Definition CommonParamsHelper.h:93
CommonParams
Definition CommonParams.h:25
DataType
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
Definition DataType.h:29
Ideal
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
Scanner
This class offers an input interface which is more convenient and for some purposes more efficient th...
Definition Scanner.h:50
TermTranslator
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Definition TermTranslator.h:41
VarNames
Defines the variables of a polynomial ring and facilities IO involving them.
Definition VarNames.h:40