IdealWriter.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2009 University of Aarhus
Contact Bjarke Hammersholt Roune for license information (www.broune.com)
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 IDEAL_WRITER_GUARD
#define IDEAL_WRITER_GUARD
#include "VarNames.h"
#include "BigTermConsumer.h"
class TermTranslator;
class Term;
namespace IO {
class IdealWriter : public BigTermConsumer {
public:
IdealWriter(FILE* out);
virtual void consumeRing(const VarNames& names);
virtual void beginConsumingList();
virtual void beginConsuming();
virtual void consume(const Term& term, const TermTranslator& translator);
virtual void consume(const vector<mpz_class>& term);
virtual void doneConsuming();
virtual void doneConsumingList();
virtual void consume(const BigIdeal& ideal);
FILE* getFile() {return _out;}
const VarNames& getNames() {return _names;}
private:
virtual void doWriteHeader(bool firstIdeal, size_t generatorCount);
virtual void doWriteHeader(bool firstIdeal) = 0;
virtual void doWriteTerm(const Term& term,
const TermTranslator& translator,
bool firstGenerator) = 0;
virtual void doWriteTerm(const vector<mpz_class>& term,
bool firstGenerator) = 0;
virtual void doWriteFooter(bool wasZeroIdeal) = 0;
virtual void doWriteEmptyList() = 0;
FILE* const _out;
bool _firstIdeal;
bool _firstGenerator;
VarNames _names;
};
}
#endif
BigTermConsumer.h
VarNames.h
BigIdeal
Definition BigIdeal.h:27
BigTermConsumer
Definition BigTermConsumer.h:29
IO::IdealWriter::_firstGenerator
bool _firstGenerator
Definition IdealWriter.h:59
IO::IdealWriter::_out
FILE *const _out
Definition IdealWriter.h:57
IO::IdealWriter::getFile
FILE * getFile()
Definition IdealWriter.h:43
IO::IdealWriter::consume
virtual void consume(const Term &term, const TermTranslator &translator)
Definition IdealWriter.cpp:47
IO::IdealWriter::doneConsumingList
virtual void doneConsumingList()
Must be called once after each time beginConsumingList has been called.
Definition IdealWriter.cpp:66
IO::IdealWriter::doneConsuming
virtual void doneConsuming()
Must be called once after each time beginConsuming has been called.
Definition IdealWriter.cpp:61
IO::IdealWriter::IdealWriter
IdealWriter(FILE *out)
Definition IdealWriter.cpp:25
IO::IdealWriter::doWriteTerm
virtual void doWriteTerm(const Term &term, const TermTranslator &translator, bool firstGenerator)=0
IO::IdealWriter::doWriteEmptyList
virtual void doWriteEmptyList()=0
IO::IdealWriter::doWriteHeader
virtual void doWriteHeader(bool firstIdeal, size_t generatorCount)
Definition IdealWriter.cpp:81
IO::IdealWriter::beginConsuming
virtual void beginConsuming()
Tell the consumer to begin consuming an ideal.
Definition IdealWriter.cpp:42
IO::IdealWriter::getNames
const VarNames & getNames()
Definition IdealWriter.h:44
IO::IdealWriter::consumeRing
virtual void consumeRing(const VarNames &names)
Tell the consumer which ring is being used.
Definition IdealWriter.cpp:31
IO::IdealWriter::_firstIdeal
bool _firstIdeal
Definition IdealWriter.h:58
IO::IdealWriter::_names
VarNames _names
Definition IdealWriter.h:60
IO::IdealWriter::doWriteFooter
virtual void doWriteFooter(bool wasZeroIdeal)=0
IO::IdealWriter::doWriteHeader
virtual void doWriteHeader(bool firstIdeal)=0
IO::IdealWriter::beginConsumingList
virtual void beginConsumingList()
Tell the consumer that the ideals that are consumed until the next call to doneConsumingList are to b...
Definition IdealWriter.cpp:38
IO::IdealWriter::doWriteTerm
virtual void doWriteTerm(const vector< mpz_class > &term, bool firstGenerator)=0
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