Go to the documentation of this file.
55 doReadTerm(in, consumer);
60 ASSERT(ideal->getGeneratorCount() == 1);
91 throwError<UnsupportedException>
93 " format does not support output of a monomial ideal.");
100 throwError<UnsupportedException>
102 " format does not support output of a list of monomial ideals.");
112 throwError<UnsupportedException>
114 " format does not support output of a polynomial.");
129 IOHandlerFactory getIOHandlerFactory() {
130 IOHandlerFactory factory(
"format");
132 nameFactoryRegister<IO::Macaulay2IOHandler>(factory);
133 nameFactoryRegister<IO::CoCoA4IOHandler>(factory);
134 nameFactoryRegister<IO::SingularIOHandler>(factory);
135 nameFactoryRegister<IO::MonosIOHandler>(factory);
136 nameFactoryRegister<IO::NewMonosIOHandler>(factory);
137 nameFactoryRegister<IO::Fourti2IOHandler>(factory);
138 nameFactoryRegister<IO::NullIOHandler>(factory);
139 nameFactoryRegister<IO::CountingIOHandler>(factory);
157 getIOHandlerFactory().getNamesWithPrefix(
"", names);
170 errorMsg <<
"Read the number " << n
171 <<
" while reading Frobenius instance. "
172 <<
"Only integers strictly larger than 1 are valid.";
176 numbers.push_back(n);
181 (in,
"Read empty Frobenius instance, which is not allowed.");
183 mpz_class
gcd = numbers[0];
184 for (
size_t i = 1; i < numbers.size(); ++i)
185 mpz_gcd(
gcd.get_mpz_t(),
gcd.get_mpz_t(), numbers[i].get_mpz_t());
191 errorMsg <<
"The numbers in the Frobenius instance are not "
192 <<
"relatively prime. They are all divisible by "
216 case '0':
case '1':
case '2':
case '3':
case '4':
217 case '5':
case '6':
case '7':
case '8':
case '9':
virtual void doReadSatBinomIdeal(Scanner &in, SatBinomConsumer &consumer)=0
void readPolynomial(Scanner &in, CoefBigTermConsumer &consumer)
virtual void doReadPolynomial(Scanner &in, CoefBigTermConsumer &consumer)=0
static const DataType & getMonomialIdealListType()
Returns the one and only instance for monomial ideal lists.
void readSatBinomIdeal(Scanner &in, SatBinomConsumer &consumer)
void readInteger(mpz_class &integer)
Read an arbitrary-precision integer.
static const char * staticGetName()
string getFormatNameIndicatingToGuessTheInputFormat()
Using the returned string in place of an (input) format name indicates to guess the format based on w...
static const DataType & getPolynomialType()
Returns the one and only instance for polynomials.
virtual const char * doGetDescription() const =0
virtual bool doSupportsOutput(const DataType &type) const =0
virtual void doWriteTerm(const vector< mpz_class > &term, const VarNames &names, FILE *out)=0
This class offers an input interface which is more convenient and for some purposes more efficient th...
virtual void doReadIdeal(Scanner &in, InputConsumer &consumer)=0
virtual const char * doGetName() const =0
auto_ptr< AbstractProduct > createWithPrefix(const NameFactory< AbstractProduct > &factory, const string &prefix)
Creates the unique product that has the indicated prefix, or create the actual product that has name ...
void readIdeal(Scanner &in, InputConsumer &consumer)
Read an ideal and feed it to the consumer.
virtual void doReadIdeals(Scanner &in, InputConsumer &consumer)=0
auto_ptr< BigTermConsumer > createIdealWriter(FILE *out)
A NameFactory takes a name and then creates an instance of a class that has been previously registere...
const char * getName() const
static const char * staticGetName()
bool hasMoreInput(Scanner &in) const
static const char * staticGetName()
static const char * staticGetName()
bool matchEOF()
Return true if no more input.
bool supportsOutput(const DataType &type) const
virtual bool doHasMoreInput(Scanner &in) const =0
void reportSyntaxError(const Scanner &scanner, const string &errorMsg)
void getIOHandlerNames(vector< string > &names)
Add the name of each fomat to names.
virtual bool doSupportsInput(const DataType &type) const =0
auto_ptr< IOHandler > createIOHandler(const string &prefix)
Returns an IOHandler for the format whose name has the given prefix.
static const DataType & getMonomialIdealType()
Returns the one and only instance for monomial ideals.
void readFrobeniusInstance(Scanner &in, vector< mpz_class > &numbers)
bool supportsInput(const DataType &type) const
auto_ptr< CoefBigTermConsumer > createPolynomialWriter(FILE *out)
virtual CoefBigTermConsumer * doCreatePolynomialWriter(FILE *out)=0
const char * getDescription() const
A replacement for stringstream.
void eatWhite()
Reads past any whitespace, where whitespace is defined by the standard function isspace().
auto_ptr< IOHandler > createOHandler(const string &input, const string &output)
Returns an IOHandler for the output format.
static const char * staticGetName()
void readTerm(Scanner &in, const VarNames &names, vector< mpz_class > &term)
virtual BigTermConsumer * doCreateIdealWriter(FILE *out)=0
void writeTerm(const vector< mpz_class > &term, const VarNames &names, FILE *out)
Defines the variables of a polynomial ring and facilities IO involving them.
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
auto_ptr< BigTermConsumer > createIdealListWriter(FILE *out)
bool peek(char character)
Skips whitespace and returns true if the next character is equal to the parameter(s).
string autoDetectFormat(Scanner &in)
Return the format of what in is reading based on the first non-whitespace character.
static const char * staticGetName()
void readIdeals(Scanner &in, InputConsumer &consumer)
Read a number of ideals and feed them to the consumer.
string getFormatNameIndicatingToUseInputFormatAsOutputFormat()
Using the returned string in place of an (output) format name indicates to use the input format as th...
void gcd(Word *res, const Word *resEnd, const Word *a, const Word *b)