Frobby 0.9.5
EulerState.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 EULER_STATE_GUARD
18#define EULER_STATE_GUARD
19
20#include "RawSquareFreeIdeal.h"
21
22class Ideal;
23class Arena;
24
26public:
28 static EulerState* construct
30
34
35 bool toColonSubState(const Word* pivot);
36 bool toColonSubState(size_t pivotVar);
39
42
43 void flipSign() {sign = -sign;}
44 int getSign() const {return sign;}
45
46 void transpose();
47
50 const RawSquareFreeIdeal& getIdeal() const {return *ideal;}
51 const Word* getEliminatedVars() const {return eliminated;}
52 size_t getVarCount() const {return getIdeal().getVarCount();}
53 size_t getNonEliminatedVarCount() const;
54
55 void removeGenerator(size_t index) {ideal->removeGenerator(index);}
56
58
59 void print(FILE* out);
60
61#ifdef DEBUG
62 bool debugIsValid() const;
63#endif
64
65private:
66 EulerState(const EulerState&); // unavailable
67 static EulerState* rawConstruct(size_t varCount, size_t capacity,
68 Arena* arena);
69
70 void toZero();
71
73
74 void deallocate();
75
78 int sign;
81};
82
83#endif
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
This is an arena allocator.
Definition Arena.h:53
void removeGenerator(size_t index)
Definition EulerState.h:55
static EulerState * rawConstruct(size_t varCount, size_t capacity, Arena *arena)
EulerState * makeSumSubState(size_t pivotVar)
EulerState * inPlaceGenSplit(size_t pivotIndex)
void flipSign()
Definition EulerState.h:43
void toColonSubStateNoReminimizeNecessary(size_t pivotVar)
Word * eliminated
Definition EulerState.h:77
void compactEliminatedVariablesIfProfitable()
void deallocate()
void toZero()
RawSquareFreeIdeal & getIdeal()
Definition EulerState.h:49
bool toColonSubState(const Word *pivot)
int getSign() const
Definition EulerState.h:44
static EulerState * construct(const Ideal &idealParam, Arena *arena)
const RawSquareFreeIdeal & getIdeal() const
Definition EulerState.h:50
RawSquareFreeIdeal * ideal
Definition EulerState.h:76
Arena * _alloc
Definition EulerState.h:79
void transpose()
size_t getVarCount() const
Definition EulerState.h:52
EulerState * inPlaceStdSplit(size_t pivotVar)
void print(FILE *out)
const Word * getEliminatedVars() const
Definition EulerState.h:51
EulerState * _parent
Definition EulerState.h:80
EulerState * getParent()
Definition EulerState.h:48
EulerState(const EulerState &)
void allocateIdealAndEliminated(size_t varCount, size_t capacity)
size_t getNonEliminatedVarCount() const
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
A bit packed square free ideal placed in a pre-allocated buffer.
void removeGenerator(size_t index)
Removes the generator at index.
size_t getVarCount() const
unsigned long Word
The native unsigned type for the CPU.
Definition stdinc.h:93