Frobby  0.9.5
SquareFreeIdeal.h
Go to the documentation of this file.
1 /* Frobby: Software for monomial ideal computations.
2  Copyright (C) 2011 Bjarke Hammersholt Roune (www.broune.com)
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see http://www.gnu.org/licenses/.
16 */
17 #ifndef SQUARE_FREE_IDEAL_GUARD
18 #define SQUARE_FREE_IDEAL_GUARD
19 
20 #include "VarNames.h"
21 #include "RawSquareFreeIdeal.h"
22 class BigIdeal;
23 
25  public:
27  SquareFreeIdeal(const SquareFreeIdeal& ideal, size_t capacity);
28  SquareFreeIdeal(const BigIdeal& ideal);
30 
31  SquareFreeIdeal& operator=(const BigIdeal& ideal);
32 
33  void minimize();
34  void renameVars(const VarNames& names);
35  void insert(Word* term);
36  void insertIdentity();
37 
39  bool insert(const std::vector<std::string>& term);
40 
43 
44  void clear();
45  void swap(SquareFreeIdeal& ideal);
46  void reserve(size_t capacity);
47 
48  const VarNames& getNames() const {return _names;}
49  size_t getVarCount() const;
50  size_t getGeneratorCount() const;
51  size_t getCapacity() const {return _capacity;}
52 
53  Word* back() {return _ideal->back();}
54  const Word* back() const {return _ideal->back();}
55 
57  iterator begin() {return _ideal->begin();}
58  iterator end() {return _ideal->end();}
59 
61  const_iterator begin() const {return _ideal->begin();}
62  const_iterator end() const {return _ideal->end();}
63 
64  const RawSquareFreeIdeal* getRawIdeal() const {return _ideal;}
66 
67  private:
68  SquareFreeIdeal(const SquareFreeIdeal&); // not available
69  SquareFreeIdeal& operator=(const SquareFreeIdeal&); // not available
70 
73  size_t _capacity;
74 };
75 
76 
77 
78 inline size_t SquareFreeIdeal::getVarCount() const {
79  ASSERT(_ideal != 0);
81  return _names.getVarCount();
82 }
83 
84 inline size_t SquareFreeIdeal::getGeneratorCount() const {
85  ASSERT(_ideal != 0);
86  return _ideal->getGeneratorCount();
87 }
88 
89 #endif
const_iterator doesn't have all it needs to be a proper STL iterator.
iterator doesn't have all it needs to be a proper STL iterator.
A bit packed square free ideal placed in a pre-allocated buffer.
size_t getVarCount() const
size_t getGeneratorCount() const
void swap01Exponents()
Change 0 exponents into 1 and vice versa.
SquareFreeIdeal(const SquareFreeIdeal &)
const VarNames & getNames() const
const_iterator end() const
RawSquareFreeIdeal::const_iterator const_iterator
iterator begin()
const_iterator begin() const
RawSquareFreeIdeal * getRawIdeal()
void reserve(size_t capacity)
const Word * back() const
SquareFreeIdeal & operator=(const SquareFreeIdeal &)
SquareFreeIdeal & operator=(const BigIdeal &ideal)
RawSquareFreeIdeal * _ideal
const RawSquareFreeIdeal * getRawIdeal() const
size_t getVarCount() const
void insert(Word *term)
void renameVars(const VarNames &names)
size_t getCapacity() const
void swap(SquareFreeIdeal &ideal)
RawSquareFreeIdeal::iterator iterator
size_t getGeneratorCount() const
void swap01Exponents()
Change 0 exponents into 1 and vice versa.
Defines the variables of a polynomial ring and facilities IO involving them.
Definition: VarNames.h:40
size_t getVarCount() const
Returns the current number of variables.
Definition: VarNames.h:113
unsigned long Word
The native unsigned type for the CPU.
Definition: stdinc.h:93
#define ASSERT(X)
Definition: stdinc.h:86