43 fputc(
'[', getFile());
49 fputs(first ?
"\n " :
",\n ", getFile());
55 fputs(first ?
"\n " :
",\n ", getFile());
60 fputs(
"\n];\n", getFile());
70 "Older format used by the program Monos.") {
101 }
while (in.
match(
','));
114 if (!in.
match(
']')) {
117 }
while (in.
match(
','));
118 if (!in.
match(
']')) {
132 const char* pre =
"";
133 for (
unsigned int i = 0; i < names.
getVarCount(); ++i) {
135 fputs(names.
getName(i).c_str(), out);
This class contains further functionality that makes it more convenient to derive from than IOHandler...
virtual void doReadTerm(Scanner &in, InputConsumer &consumer)
static const DataType & getMonomialIdealListType()
Returns the one and only instance for monomial ideal lists.
void writeRing(const VarNames &names, FILE *out)
virtual void doWriteHeader(bool first)
void clear()
Resets the number of variables to zero.
virtual void doWriteEmptyList()
void registerOutput(const DataType &type)
Specify that output of the argument type is supported.
virtual void doWriteTerm(const vector< mpz_class > &term, bool first)
Defines the variables of a polynomial ring and facilities IO involving them.
static const char * staticGetName()
virtual void doWriteTerm(const vector< mpz_class > &term, const VarNames &names, FILE *out)
void addVarSyntaxCheckUnique(const Scanner &in, const string &name)
As addvar, except it reports a syntax error if name is already a variable.
virtual void doWriteTerm(const Term &term, const TermTranslator &translator, bool first)
This class offers an input interface which is more convenient and for some purposes more efficient th...
virtual void doReadRing(Scanner &in, VarNames &names)
virtual void doWriteFooter(bool wasZeroIdeal)
bool peekIdentifier()
Skips whitespace and returns true if the next token is an identifier.
void registerInput(const DataType &type)
Specify that input of the argument type is supported.
virtual BigTermConsumer * doCreateIdealWriter(FILE *out)
bool peek(char character)
Skips whitespace and returns true if the next character is equal to the parameter(s).
const char * readIdentifier()
The returned string is only valid until the next method on this object gets called.
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
void expect(char expected)
Require the next character to be equal to expected.
static const DataType & getMonomialIdealType()
Returns the one and only instance for monomial ideals.
MonosIdealWriter(FILE *out)
void writeTermProduct(const Term &term, const TermTranslator &translator, FILE *out)
size_t getVarCount() const
Returns the current number of variables.
const string & getName(size_t index) const
The returned reference can become invalid next time addVar is called.
virtual void doReadBareIdeal(Scanner &in, InputConsumer &consumer)
Term represents a product of variables which does not include a coefficient.
bool match(char c)
Return true if the next character is c, and in that case skip past it.
virtual bool doPeekRing(Scanner &in)