Frobby  0.9.5
CommonParamsHelper.h
Go to the documentation of this file.
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 COMMON_PARAMS_HELPER
19 #define COMMON_PARAMS_HELPER
20 
21 #include "CoefTermConsumer.h"
22 #include "TermConsumer.h"
23 #include "TermTranslator.h"
24 #include "Ideal.h"
25 
26 class CommonParams;
27 class Ideal;
28 class DataType;
29 class Scanner;
30 class CommonParams;
31 class BigIdeal;
32 class BigTermConsumer;
34 class TermTranslator;
35 
39  public:
42 
44  void readIdealAndSetOutput(const CommonParams& params,
45  const DataType& output);
46 
48  void readIdealAndSetPolyOutput(const CommonParams& params);
49 
51  void readIdealAndSetIdealOutput(const CommonParams& params);
52 
54  void setIdealAndIdealOutput(const CommonParams& params,
55  const BigIdeal& input,
56  BigTermConsumer& output);
57 
59  void setIdealAndPolyOutput(const CommonParams& params,
60  const BigIdeal& input,
61  CoefBigTermConsumer& output);
62 
63  const VarNames& getNames() {return _translator->getNames();}
64 
65  Ideal& getIdeal() {return *_ideal;}
66  const Ideal& getIdeal() const {return *_ideal;}
67  auto_ptr<Ideal> takeIdeal() {return _ideal;}
68  bool hasIdeal() const {return _ideal.get() != 0;}
69 
71  const TermTranslator& getTranslator() const {return *_translator;}
72  auto_ptr<TermTranslator> takeTranslator() {return _translator;}
73 
75 
76  auto_ptr<TermConsumer> makeTranslatedIdealConsumer(bool split = false);
77 
79  auto_ptr<CoefTermConsumer> makeTranslatedPolyConsumer();
80  auto_ptr<CoefTermConsumer> makeToUnivariatePolyConsumer();
81 
83 
84  private:
85  // No copies
88 
89  void readIdeal(const CommonParams& params, Scanner& in);
90  void setIdeal(const CommonParams& params, const BigIdeal& ideal);
91 
92  auto_ptr<Ideal> _ideal;
93  auto_ptr<TermTranslator> _translator;
94 
96  auto_ptr<BigTermConsumer> _idealConsumerDeleter;
97 
99  auto_ptr<CoefBigTermConsumer> _polyConsumerDeleter;
100 
102 };
103 
104 #endif
Utility class for dealing with the contents of CommonParams.
void setIdeal(const CommonParams &params, const BigIdeal &ideal)
TermTranslator & getTranslator()
void readIdeal(const CommonParams &params, Scanner &in)
auto_ptr< TermConsumer > makeTranslatedIdealConsumer(bool split=false)
const VarNames & getNames()
BigTermConsumer & getIdealConsumer()
void setIdealAndIdealOutput(const CommonParams &params, const BigIdeal &input, BigTermConsumer &output)
Use given ideal and support ideal output.
CommonParamsHelper(const CommonParamsHelper &)
auto_ptr< TermTranslator > takeTranslator()
auto_ptr< CoefTermConsumer > makeToUnivariatePolyConsumer()
void readIdealAndSetOutput(const CommonParams &params, const DataType &output)
Read input ideal and support specified kind of output.
void readIdealAndSetIdealOutput(const CommonParams &params)
Read input and support ideal output.
void readIdealAndSetPolyOutput(const CommonParams &params)
Read input and support polynomial output.
auto_ptr< BigTermConsumer > _idealConsumerDeleter
BigTermConsumer * _idealConsumer
CoefBigTermConsumer & getPolyConsumer()
const Ideal & getIdeal() const
auto_ptr< CoefBigTermConsumer > _polyConsumerDeleter
auto_ptr< Ideal > takeIdeal()
const TermTranslator & getTranslator() const
void setIdealAndPolyOutput(const CommonParams &params, const BigIdeal &input, CoefBigTermConsumer &output)
Use given ideal and support polynomial output.
CoefBigTermConsumer * _polyConsumer
auto_ptr< TermTranslator > _translator
auto_ptr< Ideal > _ideal
CommonParamsHelper & operator=(const CommonParamsHelper &)
auto_ptr< CoefTermConsumer > makeTranslatedPolyConsumer()
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
Definition: DataType.h:29
Represents a monomial ideal with int exponents.
Definition: Ideal.h:27
This class offers an input interface which is more convenient and for some purposes more efficient th...
Definition: Scanner.h:50
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Defines the variables of a polynomial ring and facilities IO involving them.
Definition: VarNames.h:40