Frobby
0.10.0
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Projection.h
1
/* Frobby: Software for monomial ideal computations.
2
Copyright (C) 2007 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 PROJECTION_GUARD
18
#define PROJECTION_GUARD
19
20
#include <vector>
21
22
class
Partition
;
23
class
Term
;
24
25
// Recall that a function maps elements from its domain to its
26
// range. Projection represents a function that maps variables from
27
// its range ring to its domain ring, where some variables can be
28
// mapped to zero.
29
class
Projection {
30
public
:
31
Projection() {}
32
33
void
reset(
const
Partition
& partition,
int
set);
34
void
reset(
const
vector<size_t>& inverseProjections);
35
void
setToIdentity(
size_t
varCount);
36
37
size_t
getRangeVarCount()
const
;
38
39
size_t
getDomainVar(
size_t
rangeVar);
40
41
void
project(Exponent* to,
const
Exponent* from)
const
;
42
43
void
inverseProject(
Term
& to,
const
Exponent* from)
const
;
44
size_t
inverseProjectVar(
size_t
rangeVar)
const
;
45
46
void
swap(Projection& projection);
47
48
void
print(FILE* file)
const
;
49
50
bool
domainVarHasProjection(
size_t
var)
const
;
51
52
private
:
53
void
updateHasProjections();
54
55
vector<size_t> _offsets;
56
mutable
vector<int> _domainVarHasProjection;
57
};
58
59
#endif
Partition
Definition
Partition.h:20
Term
Definition
Term.h:49
Generated by
1.17.0