Frobby 0.10.0
Loading...
Searching...
No Matches
CommonParamsHelper.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 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
26class CommonParams;
27class Ideal;
28class DataType;
29class Scanner;
30class CommonParams;
31class BigIdeal;
32class BigTermConsumer;
34class TermTranslator;
35
38class CommonParamsHelper {
39 public:
40 CommonParamsHelper();
41 ~CommonParamsHelper();
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 unique_ptr<Ideal> takeIdeal() {return std::move(_ideal);}
68 bool hasIdeal() const {return _ideal.get() != 0;}
69
70 TermTranslator& getTranslator() {return *_translator;}
71 const TermTranslator& getTranslator() const {return *_translator;}
72 unique_ptr<TermTranslator> takeTranslator() {return std::move(_translator);}
73
74 BigTermConsumer& getIdealConsumer() {return *_idealConsumer;}
75
76 unique_ptr<TermConsumer> makeTranslatedIdealConsumer(bool split = false);
77
78 CoefBigTermConsumer& getPolyConsumer() {return *_polyConsumer;}
79 unique_ptr<CoefTermConsumer> makeTranslatedPolyConsumer();
80 unique_ptr<CoefTermConsumer> makeToUnivariatePolyConsumer();
81
82 void addPurePowersAtInfinity();
83
84 private:
85 // No copies
86 CommonParamsHelper(const CommonParamsHelper&);
87 CommonParamsHelper& operator=(const CommonParamsHelper&);
88
89 void readIdeal(const CommonParams& params, Scanner& in);
90 void setIdeal(const CommonParams& params, const BigIdeal& ideal);
91
92 unique_ptr<Ideal> _ideal;
93 unique_ptr<TermTranslator> _translator;
94
95 BigTermConsumer* _idealConsumer;
96 unique_ptr<BigTermConsumer> _idealConsumerDeleter;
97
98 CoefBigTermConsumer* _polyConsumer;
99 unique_ptr<CoefBigTermConsumer> _polyConsumerDeleter;
100
101 bool _produceCanonicalOutput;
102};
103
104#endif
Definition BigIdeal.h:27
Definition BigTermConsumer.h:29
Definition CoefBigTermConsumer.h:29
void setIdealAndIdealOutput(const CommonParams &params, const BigIdeal &input, BigTermConsumer &output)
Definition CommonParamsHelper.cpp:110
void readIdealAndSetOutput(const CommonParams &params, const DataType &output)
Definition CommonParamsHelper.cpp:54
void readIdealAndSetIdealOutput(const CommonParams &params)
Definition CommonParamsHelper.cpp:98
void readIdealAndSetPolyOutput(const CommonParams &params)
Definition CommonParamsHelper.cpp:85
void setIdealAndPolyOutput(const CommonParams &params, const BigIdeal &input, CoefBigTermConsumer &output)
Definition CommonParamsHelper.cpp:119
Definition CommonParams.h:25
Definition DataType.h:29
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
Definition Scanner.h:50
Definition TermTranslator.h:41
Definition VarNames.h:38