PolyWriter.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
Copyright (C) 2009 University of Aarhus
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#ifndef POLY_WRITER_GUARD
#define POLY_WRITER_GUARD
#include "CoefBigTermConsumer.h"
#include "VarNames.h"
namespace IO {
class PolyWriter : public CoefBigTermConsumer {
public:
PolyWriter(FILE* out);
virtual void consumeRing(const VarNames& names);
virtual void beginConsuming();
virtual void consume(const mpz_class& coef,
const Term& term,
const TermTranslator& translator);
virtual void consume(const mpz_class& coef, const vector<mpz_class>& term);
virtual void doneConsuming();
virtual void consume(const BigPolynomial& poly);
FILE* getFile() {return _out;}
const VarNames& getNames() const {return _names;}
private:
virtual void doWriteHeader(size_t generatorCount);
virtual void doWriteHeader() = 0;
virtual void doWriteTerm(const mpz_class& coef,
const Term& term,
const TermTranslator& translator,
bool firstGenerator) = 0;
virtual void doWriteTerm(const mpz_class& coef,
const vector<mpz_class>& term,
bool firstGenerator) = 0;
virtual void doWriteFooter(bool wasZero) = 0;
FILE* const _out;
bool _firstTerm;
VarNames _names;
};
}
#endif
CoefBigTermConsumer.h
VarNames.h
BigPolynomial
Definition BigPolynomial.h:27
CoefBigTermConsumer
Definition CoefBigTermConsumer.h:29
IO::PolyWriter::doWriteFooter
virtual void doWriteFooter(bool wasZero)=0
IO::PolyWriter::PolyWriter
PolyWriter(FILE *out)
Definition PolyWriter.cpp:25
IO::PolyWriter::getFile
FILE * getFile()
Definition PolyWriter.h:40
IO::PolyWriter::doneConsuming
virtual void doneConsuming()
Definition PolyWriter.cpp:55
IO::PolyWriter::doWriteHeader
virtual void doWriteHeader()=0
IO::PolyWriter::getNames
const VarNames & getNames() const
Definition PolyWriter.h:41
IO::PolyWriter::beginConsuming
virtual void beginConsuming()
Definition PolyWriter.cpp:34
IO::PolyWriter::consumeRing
virtual void consumeRing(const VarNames &names)
Definition PolyWriter.cpp:30
IO::PolyWriter::_out
FILE *const _out
Definition PolyWriter.h:55
IO::PolyWriter::doWriteTerm
virtual void doWriteTerm(const mpz_class &coef, const Term &term, const TermTranslator &translator, bool firstGenerator)=0
IO::PolyWriter::_firstTerm
bool _firstTerm
Definition PolyWriter.h:56
IO::PolyWriter::doWriteTerm
virtual void doWriteTerm(const mpz_class &coef, const vector< mpz_class > &term, bool firstGenerator)=0
IO::PolyWriter::_names
VarNames _names
Definition PolyWriter.h:57
IO::PolyWriter::consume
virtual void consume(const mpz_class &coef, const Term &term, const TermTranslator &translator)
Definition PolyWriter.cpp:39
TermTranslator
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Definition TermTranslator.h:41
Term
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49
VarNames
Defines the variables of a polynomial ring and facilities IO involving them.
Definition VarNames.h:40
IO
Definition CoCoA4IOHandler.cpp:33