Frobby
0.10.0
Toggle main menu visibility
Loading...
Searching...
No Matches
src
SquareFreeIdeal.h
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
24
class
SquareFreeIdeal {
25
public
:
26
SquareFreeIdeal();
27
SquareFreeIdeal(
const
SquareFreeIdeal& ideal,
size_t
capacity);
28
SquareFreeIdeal(
const
BigIdeal
& ideal);
29
~SquareFreeIdeal();
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
42
void
swap01Exponents
() {_ideal->swap01Exponents();}
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
56
typedef
RawSquareFreeIdeal::iterator iterator;
57
iterator begin() {
return
_ideal->begin();}
58
iterator end() {
return
_ideal->end();}
59
60
typedef
RawSquareFreeIdeal::const_iterator const_iterator;
61
const_iterator begin()
const
{
return
_ideal->begin();}
62
const_iterator end()
const
{
return
_ideal->end();}
63
64
const
RawSquareFreeIdeal* getRawIdeal()
const
{
return
_ideal;}
65
RawSquareFreeIdeal* getRawIdeal() {
return
_ideal;}
66
67
private
:
68
SquareFreeIdeal(
const
SquareFreeIdeal&);
// not available
69
SquareFreeIdeal& operator=(
const
SquareFreeIdeal&);
// not available
70
71
VarNames _names;
72
RawSquareFreeIdeal* _ideal;
73
size_t
_capacity;
74
};
75
76
77
78
inline
size_t
SquareFreeIdeal::getVarCount()
const
{
79
ASSERT(_ideal != 0);
80
ASSERT(_names.getVarCount() == _ideal->getVarCount());
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
BigIdeal
Definition
BigIdeal.h:27
SquareFreeIdeal
Definition
SquareFreeIdeal.h:24
SquareFreeIdeal::swap01Exponents
void swap01Exponents()
Definition
SquareFreeIdeal.h:42
VarNames
Definition
VarNames.h:38
Word
unsigned long Word
Definition
stdinc.h:60
Generated by
1.17.0