57 for (
size_t var = 0; var <
varCount; ++var)
71 for (
size_t var = 0; var <
varCount; ++var)
117 const vector<mpz_class>& term,
136 "Format understandable by the program Macaulay 2.") {
175 (
in,
"Expected name of ring to start with an upper case R.");
182 if (
in.peek() ==
'Z') {
183 displayNote(
"In the Macaulay 2 format, writing ZZ as the ground field "
184 "instead of QQ is deprecated and may not work in future "
185 "releases of Frobby.");
195 displayNote(
"In the Macaulay 2 format, putting braces { } around the "
196 "variables is deprecated and may not work in future "
197 "releases of Frobby.");
200 if (
in.peekIdentifier()) {
202 names.addVarSyntaxCheckUnique(
in,
in.readIdentifier());
203 }
while (
in.match(
','));
213 return in.peek(
'R') ||
in.peek(
'r');
222 in.expect(
"monomialIdeal");
233 }
while (
in.match(
','));
244 vector<mpz_class> term(
names.getVarCount());
256 }
while (!
in.match(
';'));
267 name =
"R" +
i.get_str();
277 const char*
pre =
"";
278 for (
unsigned int i = 0;
i <
names.getVarCount(); ++
i) {
280 if (
names.getName(
i) ==
"R") {
282 "The name of the ring in Macaulay 2 format is usually named R,\n"
283 "but in this case there is already a variable named R. Thus,\n"
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
static const DataType & getMonomialIdealListType()
Returns the one and only instance for monomial ideal lists.
static const DataType & getMonomialIdealType()
Returns the one and only instance for monomial ideals.
static const DataType & getPolynomialType()
Returns the one and only instance for polynomials.
This class contains further functionality that makes it more convenient to derive from than IOHandler...
void registerInput(const DataType &type)
Specify that input of the argument type is supported.
void registerOutput(const DataType &type)
Specify that output of the argument type is supported.
const VarNames & getNames()
virtual void doWriteTerm(const vector< mpz_class > &term, bool first)
virtual void doWriteFooter(bool wasZeroIdeal)
virtual void doWriteTerm(const Term &term, const TermTranslator &translator, bool first)
virtual void doWriteHeader(bool first)
virtual void doWriteEmptyList()
virtual void doWriteFooter(bool wasZero)
virtual void doWriteTerm(const mpz_class &coef, const vector< mpz_class > &term, bool firstGenerator)
virtual void doWriteHeader()
virtual void doWriteTerm(const mpz_class &coef, const Term &term, const TermTranslator &translator, bool firstGenerator)
virtual bool doPeekRing(Scanner &in)
virtual void doReadBareIdeal(Scanner &in, InputConsumer &consumer)
virtual CoefBigTermConsumer * doCreatePolynomialWriter(FILE *out)
static const char * staticGetName()
virtual void doWriteTerm(const vector< mpz_class > &term, const VarNames &names, FILE *out)
virtual void doReadRing(Scanner &in, VarNames &names)
virtual BigTermConsumer * doCreateIdealWriter(FILE *out)
virtual void doReadTerm(Scanner &in, InputConsumer &consumer)
virtual void doReadBarePolynomial(Scanner &in, const VarNames &names, CoefBigTermConsumer &consumer)
const VarNames & getNames() const
This class offers an input interface which is more convenient and for some purposes more efficient th...
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Term represents a product of variables which does not include a coefficient.
Defines the variables of a polynomial ring and facilities IO involving them.
void displayNote(const string &msg)
Display msg to standard error in a way that indicates that this is something that the user should tak...
This file contains functions for printing strings to standard error.
void reportSyntaxError(const Scanner &scanner, const string &errorMsg)
void writeCoefTermProduct(const mpz_class &coef, const Term &term, const TermTranslator &translator, bool hidePlus, FILE *out)
void readCoefTerm(BigPolynomial &polynomial, bool firstTerm, Scanner &in)
void writeTermProduct(const Term &term, const TermTranslator &translator, FILE *out)