43 beginAction(
"Validating monomial ideal format name.");
48 }
catch (
const UnknownNameException&) {
61 ASSERT(handler.get() != 0);
63 handler->readSatBinomIdeal(in, consumer);
72 ASSERT(handler.get() != 0);
76 handler->readSatBinomIdeal(in, recorder);
85 ASSERT(handler.get() != 0);
88 handler->readIdeal(in, middleman);
102 ASSERT(handler.get() != 0);
105 handler->readIdeal(in, recorder);
120 ASSERT(handler.get() != 0);
124 handler->readIdeal(in, consumer);
133 vector<BigIdeal*>& ideals,
145 handler->readIdeals(in, recorder);
148 while (!recorder.
empty())
179 consumer->beginConsumingList();
180 consumer->consumeRing(names);
182 for (vector<BigIdeal*>::const_iterator it = ideals.begin();
183 it != ideals.end(); ++it)
184 consumer->consume(**it);
186 consumer->doneConsumingList();
197 ASSERT(handler.get() != 0);
200 handler->readPolynomial(in, recorder);
234 ASSERT(handler.get() != 0);
237 handler->readIdeal(in, recorder);
244 bool pointSpecified =
false;
245 if (handler->hasMoreInput(in)) {
246 handler->readTerm(in, ideal.
getNames(), term);
247 pointSpecified =
true;
252 return pointSpecified;
256 (
Scanner& in, vector<mpz_class>& v,
size_t integerCount) {
259 v.resize(integerCount);
260 for (
size_t i = 0; i < integerCount; ++i)
277 beginAction(
"Reading frobenius instance with Grobner basis.");
283 if (instance.empty())
285 (in,
"The Grobner basis is not followed by a Frobenius instance.");
290 errorMsg <<
"The Grobner basis has "
292 <<
" entries, and the Frobenius instance should then also have "
294 <<
" entries, but in fact it has "
308 for (
size_t i = 0; i < instance.size(); ++i) {
311 gmp_fprintf(out,
"%Zd", instance[i].get_mpz_t());
321 bool valid = (format ==
"4ti2" || format ==
"fplll");
347 if (format ==
"4ti2")
349 else if (format ==
"fplll")
void exceptionSafePushBack(Container &container, auto_ptr< Element > pointer)
auto_ptr< IOHandler > createIOHandler(const string &prefix)
Returns an IOHandler for the format whose name has the given prefix.
void swap(BigIdeal &ideal)
size_t getVarCount() const
const VarNames & getNames() const
virtual void consume(const vector< mpz_class > &term)=0
This is the super class of all facades.
void beginAction(const char *message)
Prints message to standard error if printing is turned on, and records the time when the action start...
void endAction()
Prints to standard error the time since the last call to beginAction.
A replacement for stringstream.
bool isValidLatticeFormat(const string &format)
void writeFrobeniusInstance(FILE *out, vector< mpz_class > &instance)
void readFrobeniusInstance(Scanner &in, vector< mpz_class > &instance)
void writePolynomial(const BigPolynomial &polynomial, IOHandler *handler, FILE *out)
bool isValidMonomialIdealFormat(const string &format)
void readPolynomial(Scanner &in, BigPolynomial &polynomial)
void readFrobeniusInstanceWithGrobnerBasis(Scanner &in, BigIdeal &ideal, vector< mpz_class > &instance)
void writeIdeal(const BigIdeal &ideal, IOHandler *handler, FILE *out)
void writeTerm(const vector< mpz_class > &term, const VarNames &names, IOHandler *handler, FILE *out)
void readIdeals(Scanner &in, vector< BigIdeal * > &ideals, VarNames &names)
Insert the ideals that are read into the parameter ideals.
void readLattice(Scanner &in, BigIdeal &ideal)
void readIdeal(Scanner &in, BigTermConsumer &consumer)
Read an ideal from in and feed it to consumer.
void readSquareFreeIdeal(Scanner &in, SquareFreeIdeal &ideal)
Read a square free ideal from in and place it in the parameter ideal.
void readSatBinomIdeal(Scanner &in, SatBinomConsumer &consumer)
Read a saturated binomial ideal from in and feed it to consumer.
void writeIdeals(const vector< BigIdeal * > &ideals, const VarNames &names, IOHandler *handler, FILE *out)
IOFacade(bool printActions)
void writeLattice(FILE *out, const BigIdeal &ideal, const string &format)
void readVector(Scanner &in, vector< mpz_class > &v, size_t integerCount)
bool readAlexanderDualInstance(Scanner &in, BigIdeal &ideal, vector< mpz_class > &term)
An IOHandler implements input and output for some format in such a way that client code does not need...
void writeTerm(const vector< mpz_class > &term, const VarNames &names, FILE *out)
auto_ptr< BigTermConsumer > createIdealWriter(FILE *out)
auto_ptr< CoefBigTermConsumer > createPolynomialWriter(FILE *out)
Represents a saturated binomial ideal.
SatBinomRecorder records all consumed saturated binomials into a passed-in ideal.
This class offers an input interface which is more convenient and for some purposes more efficient th...
const string & getFormat() const
auto_ptr< IOHandler > createIOHandler() const
void readInteger(mpz_class &integer)
Read an arbitrary-precision integer.
void swap(SquareFreeIdeal &ideal)
Defines the variables of a polynomial ring and facilities IO involving them.
void reportSyntaxError(const Scanner &scanner, const string &errorMsg)
void readGrobnerBasis(Scanner &scanner, BigIdeal &basis)
void readLatticeBasis(Scanner &scanner, BigIdeal &basis)
void writeLatticeBasis(FILE *out, const BigIdeal &basis)
void readLatticeBasis(Scanner &scanner, BigIdeal &basis)
void writeLatticeBasis(FILE *out, const BigIdeal &basis)