Frobby  0.9.5
IOFacade.h
Go to the documentation of this file.
1 /* Frobby: Software for monomial ideal computations.
2  Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see http://www.gnu.org/licenses/.
16 */
17 #ifndef IO_FACADE_GUARD
18 #define IO_FACADE_GUARD
19 
20 #include "Facade.h"
21 #include <vector>
22 
23 class BigIdeal;
24 class Scanner;
25 class IOHandler;
26 class BigPolynomial;
27 class VarNames;
28 class BigTermConsumer;
29 class SatBinomIdeal;
30 class SatBinomConsumer;
31 class SquareFreeIdeal;
32 
39 class IOFacade : private Facade {
40  public:
41  IOFacade(bool printActions);
42 
43  bool isValidMonomialIdealFormat(const string& format);
44 
46  void readSatBinomIdeal(Scanner& in, SatBinomConsumer& consumer);
47 
50  void readSatBinomIdeal(Scanner& in, SatBinomIdeal& ideal);
51 
53  void readIdeal(Scanner& in, BigTermConsumer& consumer);
54 
56  void readIdeal(Scanner& in, BigIdeal& ideal);
57 
61 
66  void readIdeals(Scanner& in, vector<BigIdeal*>& ideals, VarNames& names);
67 
68  void writeIdeal(const BigIdeal& ideal, IOHandler* handler, FILE* out);
69 
70  void writeIdeals(const vector<BigIdeal*>& ideals,
71  const VarNames& names,
72  IOHandler* handler,
73  FILE* out);
74 
75  void readPolynomial(Scanner& in, BigPolynomial& polynomial);
76  void writePolynomial(const BigPolynomial& polynomial,
77  IOHandler* handler,
78  FILE* out);
79  void writeTerm(const vector<mpz_class>& term,
80  const VarNames& names,
81  IOHandler* handler,
82  FILE* out);
83 
84  void readFrobeniusInstance(Scanner& in, vector<mpz_class>& instance);
86  (Scanner& in, BigIdeal& ideal, vector<mpz_class>& instance);
87  void writeFrobeniusInstance(FILE* out, vector<mpz_class>& instance);
88 
90  (Scanner& in, BigIdeal& ideal, vector<mpz_class>& term);
91 
92  void readVector(Scanner& in, vector<mpz_class>& v, size_t integerCount);
93 
94  bool isValidLatticeFormat(const string& format);
95  void readLattice(Scanner& in, BigIdeal& ideal);
96  void writeLattice(FILE* out, const BigIdeal& ideal, const string& format);
97 };
98 
99 #endif
This is the super class of all facades.
Definition: Facade.h:32
A facade for input and output of mathematical objects.
Definition: IOFacade.h:39
bool isValidLatticeFormat(const string &format)
Definition: IOFacade.cpp:318
void writeFrobeniusInstance(FILE *out, vector< mpz_class > &instance)
Definition: IOFacade.cpp:305
void readFrobeniusInstance(Scanner &in, vector< mpz_class > &instance)
Definition: IOFacade.cpp:267
void writePolynomial(const BigPolynomial &polynomial, IOHandler *handler, FILE *out)
Definition: IOFacade.cpp:205
bool isValidMonomialIdealFormat(const string &format)
Definition: IOFacade.cpp:42
void readPolynomial(Scanner &in, BigPolynomial &polynomial)
Definition: IOFacade.cpp:192
void readFrobeniusInstanceWithGrobnerBasis(Scanner &in, BigIdeal &ideal, vector< mpz_class > &instance)
Definition: IOFacade.cpp:276
void writeIdeal(const BigIdeal &ideal, IOHandler *handler, FILE *out)
Definition: IOFacade.cpp:156
void writeTerm(const vector< mpz_class > &term, const VarNames &names, IOHandler *handler, FILE *out)
Definition: IOFacade.cpp:218
void readIdeals(Scanner &in, vector< BigIdeal * > &ideals, VarNames &names)
Insert the ideals that are read into the parameter ideals.
Definition: IOFacade.cpp:132
void readLattice(Scanner &in, BigIdeal &ideal)
Definition: IOFacade.cpp:329
void readIdeal(Scanner &in, BigTermConsumer &consumer)
Read an ideal from in and feed it to consumer.
Definition: IOFacade.cpp:81
void readSquareFreeIdeal(Scanner &in, SquareFreeIdeal &ideal)
Read a square free ideal from in and place it in the parameter ideal.
Definition: IOFacade.cpp:116
void readSatBinomIdeal(Scanner &in, SatBinomConsumer &consumer)
Read a saturated binomial ideal from in and feed it to consumer.
Definition: IOFacade.cpp:57
void writeIdeals(const vector< BigIdeal * > &ideals, const VarNames &names, IOHandler *handler, FILE *out)
Definition: IOFacade.cpp:168
IOFacade(bool printActions)
Definition: IOFacade.cpp:38
void writeLattice(FILE *out, const BigIdeal &ideal, const string &format)
Definition: IOFacade.cpp:344
void readVector(Scanner &in, vector< mpz_class > &v, size_t integerCount)
Definition: IOFacade.cpp:256
bool readAlexanderDualInstance(Scanner &in, BigIdeal &ideal, vector< mpz_class > &term)
Definition: IOFacade.cpp:230
An IOHandler implements input and output for some format in such a way that client code does not need...
Definition: IOHandler.h:41
Represents a saturated binomial ideal.
Definition: SatBinomIdeal.h:28
This class offers an input interface which is more convenient and for some purposes more efficient th...
Definition: Scanner.h:50
Defines the variables of a polynomial ring and facilities IO involving them.
Definition: VarNames.h:40