public class Generator1
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
A Generator1 represents a 0- or 1-dimensional affine feature of a polyhedron (vertex, ray, or line) over variables denoted by names in an environment.
A Generator1 is implemented as a pair containing a (sparse or dense)
Generator0
and an Environment
,
manipulated in conjunction.
Direct access to the fields is prohibited, to avoid desynchronizing them.
Modifier and Type | Field and Description |
---|---|
protected Environment |
env
Environment.
|
protected Generator0 |
gen
Level 0 generator.
|
static int |
LINE
Line: { lambda * coord | lambda in R }.
|
static int |
LINEMOD
Modular line: { lambda * coord | lambda in Z }.
|
static int |
RAY
Ray: { lambda * coord | lambda >= 0 in R }.
|
static int |
RAYMOD
Modular ray: { lambda * coord | lambda in N }.
|
static int |
VERTEX
Vertex: { coord }.
|
Constructor and Description |
---|
Generator1(Environment e,
Generator0 x)
Creates a new Generator1 from a Generator0.
|
Generator1(Generator1 g)
Creates a copy of g.
|
Generator1(int k,
Linexpr1 c)
Creates a new generator of the given kind.
|
Modifier and Type | Method and Description |
---|---|
Generator1 |
clone()
Returns a copy of this.
|
boolean |
equals(java.lang.Object x)
Whether x is a Generator1 and structurally equal to this.
|
void |
extendEnvironment(Environment e)
Expands the generator to fit the given environment.
|
Generator1 |
extendEnvironmentCopy(Environment e)
Returns a generator expanded to fit the given environment.
|
Environment |
getEnvironment()
Returns the environment of the generator.
|
Generator0 |
getGenerator0()
Returns a copy of the Generator0 underlying this generator.
|
Generator0 |
getGenerator0Ref()
Returns a (read-only) reference to the Generator0 underlying
this generator.
|
int |
hashCode()
Returns a hash of the generator.
|
boolean |
isEqual(Generator1 x)
Whether this and x have identical coordinate and environment.
|
static Generator1 |
make(Environment v,
Generator0 x)
This function is used internally to construct a new level 1 generator
by referencing a level 0 generator.
|
java.lang.String |
toString()
Returns a String representation of the generator.
|
protected Generator0 gen
protected Environment env
public static final int LINE
public static final int RAY
public static final int VERTEX
public static final int LINEMOD
public static final int RAYMOD
public Generator1(int k, Linexpr1 c)
c is copied.
public Generator1(Generator1 g)
The linear expression (coordinate) is copied.
public Generator1(Environment e, Generator0 x)
All coefficients are copied.
The environment must be large enough for all variables in x.
public static Generator1 make(Environment v, Generator0 x)
The level 0 generator should no longer be used afterwards.
public Environment getEnvironment()
public Generator0 getGenerator0()
public Generator0 getGenerator0Ref()
Warning: it is dangerous to add coefficients, resize the generator, add, remove, or permute dimensions as it may desynchrnonize the Generator0 dimensions form the environment.
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void extendEnvironment(Environment e)
e must be a super-environment of that of this.
public Generator1 extendEnvironmentCopy(Environment e)
e must be a super-environment of that of this.
this is not modified.
public Generator1 clone()
clone
in class java.lang.Object
public boolean isEqual(Generator1 x)
public boolean equals(java.lang.Object x)
equals
in class java.lang.Object