SquareFreeIdeal.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2011 Bjarke Hammersholt Roune (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 SQUARE_FREE_IDEAL_GUARD
#define SQUARE_FREE_IDEAL_GUARD
#include "VarNames.h"
#include "RawSquareFreeIdeal.h"
class BigIdeal;
class SquareFreeIdeal {
public:
SquareFreeIdeal();
SquareFreeIdeal(const SquareFreeIdeal& ideal, size_t capacity);
SquareFreeIdeal(const BigIdeal& ideal);
~SquareFreeIdeal();
SquareFreeIdeal& operator=(const BigIdeal& ideal);
void minimize();
void renameVars(const VarNames& names);
void insert(Word* term);
void insertIdentity();
bool insert(const std::vector<std::string>& term);
void swap01Exponents() {_ideal->swap01Exponents();}
void clear();
void swap(SquareFreeIdeal& ideal);
void reserve(size_t capacity);
const VarNames& getNames() const {return _names;}
size_t getVarCount() const;
size_t getGeneratorCount() const;
size_t getCapacity() const {return _capacity;}
Word* back() {return _ideal->back();}
const Word* back() const {return _ideal->back();}
typedef RawSquareFreeIdeal::iterator iterator;
iterator begin() {return _ideal->begin();}
iterator end() {return _ideal->end();}
typedef RawSquareFreeIdeal::const_iterator const_iterator;
const_iterator begin() const {return _ideal->begin();}
const_iterator end() const {return _ideal->end();}
const RawSquareFreeIdeal* getRawIdeal() const {return _ideal;}
RawSquareFreeIdeal* getRawIdeal() {return _ideal;}
private:
SquareFreeIdeal(const SquareFreeIdeal&); // not available
SquareFreeIdeal& operator=(const SquareFreeIdeal&); // not available
VarNames _names;
RawSquareFreeIdeal* _ideal;
size_t _capacity;
};
inline size_t SquareFreeIdeal::getVarCount() const {
ASSERT(_ideal != 0);
ASSERT(_names.getVarCount() == _ideal->getVarCount());
return _names.getVarCount();
}
inline size_t SquareFreeIdeal::getGeneratorCount() const {
ASSERT(_ideal != 0);
return _ideal->getGeneratorCount();
}
#endif
RawSquareFreeIdeal.h
VarNames.h
BigIdeal
Definition BigIdeal.h:27
RawSquareFreeIdeal::const_iterator
const_iterator doesn't have all it needs to be a proper STL iterator.
Definition RawSquareFreeIdeal.h:219
RawSquareFreeIdeal::iterator
iterator doesn't have all it needs to be a proper STL iterator.
Definition RawSquareFreeIdeal.h:259
RawSquareFreeIdeal
A bit packed square free ideal placed in a pre-allocated buffer.
Definition RawSquareFreeIdeal.h:37
SquareFreeIdeal
Definition SquareFreeIdeal.h:24
SquareFreeIdeal::SquareFreeIdeal
SquareFreeIdeal(const SquareFreeIdeal &)
SquareFreeIdeal::end
iterator end()
Definition SquareFreeIdeal.h:58
SquareFreeIdeal::clear
void clear()
Definition SquareFreeIdeal.cpp:88
SquareFreeIdeal::SquareFreeIdeal
SquareFreeIdeal()
Definition SquareFreeIdeal.cpp:24
SquareFreeIdeal::end
const_iterator end() const
Definition SquareFreeIdeal.h:62
SquareFreeIdeal::const_iterator
RawSquareFreeIdeal::const_iterator const_iterator
Definition SquareFreeIdeal.h:60
SquareFreeIdeal::begin
iterator begin()
Definition SquareFreeIdeal.h:57
SquareFreeIdeal::begin
const_iterator begin() const
Definition SquareFreeIdeal.h:61
SquareFreeIdeal::_capacity
size_t _capacity
Definition SquareFreeIdeal.h:73
SquareFreeIdeal::getRawIdeal
const RawSquareFreeIdeal * getRawIdeal() const
Definition SquareFreeIdeal.h:64
SquareFreeIdeal::reserve
void reserve(size_t capacity)
Definition SquareFreeIdeal.cpp:101
SquareFreeIdeal::back
Word * back()
Definition SquareFreeIdeal.h:53
SquareFreeIdeal::operator=
SquareFreeIdeal & operator=(const BigIdeal &ideal)
Definition SquareFreeIdeal.cpp:47
SquareFreeIdeal::~SquareFreeIdeal
~SquareFreeIdeal()
Definition SquareFreeIdeal.cpp:43
SquareFreeIdeal::_ideal
RawSquareFreeIdeal * _ideal
Definition SquareFreeIdeal.h:72
SquareFreeIdeal::getVarCount
size_t getVarCount() const
Definition SquareFreeIdeal.h:78
SquareFreeIdeal::back
const Word * back() const
Definition SquareFreeIdeal.h:54
SquareFreeIdeal::insert
void insert(Word *term)
Definition SquareFreeIdeal.cpp:70
SquareFreeIdeal::renameVars
void renameVars(const VarNames &names)
Definition SquareFreeIdeal.cpp:58
SquareFreeIdeal::getCapacity
size_t getCapacity() const
Definition SquareFreeIdeal.h:51
SquareFreeIdeal::getNames
const VarNames & getNames() const
Definition SquareFreeIdeal.h:48
SquareFreeIdeal::swap
void swap(SquareFreeIdeal &ideal)
Definition SquareFreeIdeal.cpp:95
SquareFreeIdeal::_names
VarNames _names
Definition SquareFreeIdeal.h:71
SquareFreeIdeal::getRawIdeal
RawSquareFreeIdeal * getRawIdeal()
Definition SquareFreeIdeal.h:65
SquareFreeIdeal::iterator
RawSquareFreeIdeal::iterator iterator
Definition SquareFreeIdeal.h:56
SquareFreeIdeal::getGeneratorCount
size_t getGeneratorCount() const
Definition SquareFreeIdeal.h:84
SquareFreeIdeal::insertIdentity
void insertIdentity()
Definition SquareFreeIdeal.cpp:64
SquareFreeIdeal::minimize
void minimize()
Definition SquareFreeIdeal.cpp:53
SquareFreeIdeal::operator=
SquareFreeIdeal & operator=(const SquareFreeIdeal &)
SquareFreeIdeal::swap01Exponents
void swap01Exponents()
Change 0 exponents into 1 and vice versa.
Definition SquareFreeIdeal.h:42
VarNames
Defines the variables of a polynomial ring and facilities IO involving them.
Definition VarNames.h:40
Word
unsigned long Word
The native unsigned type for the CPU.
Definition stdinc.h:93
ASSERT
#define ASSERT(X)
Definition stdinc.h:86