Package apron

Class Generator1

java.lang.Object
apron.Generator1
All Implemented Interfaces:
Serializable, Cloneable

public class Generator1 extends Object implements Cloneable, Serializable
Class of geometrical features of level 1 linear abstract elements.

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.

See Also:
  • Field Details

    • gen

      protected Generator0 gen
      Level 0 generator.
    • env

      protected Environment env
      Environment.
    • LINE

      public static final int LINE
      Line: { lambda * coord | lambda in R }.
      See Also:
    • RAY

      public static final int RAY
      Ray: { lambda * coord | lambda >= 0 in R }.
      See Also:
    • VERTEX

      public static final int VERTEX
      Vertex: { coord }.
      See Also:
    • LINEMOD

      public static final int LINEMOD
      Modular line: { lambda * coord | lambda in Z }.
      See Also:
    • RAYMOD

      public static final int RAYMOD
      Modular ray: { lambda * coord | lambda in N }.
      See Also:
  • Constructor Details

    • Generator1

      public Generator1(int k, Linexpr1 c)
      Creates a new generator of the given kind.

      c is copied.

    • Generator1

      public Generator1(Generator1 g)
      Creates a copy of g.

      The linear expression (coordinate) is copied.

    • Generator1

      public Generator1(Environment e, Generator0 x)
      Creates a new Generator1 from a Generator0.

      All coefficients are copied.

      The environment must be large enough for all variables in x.

  • Method Details

    • make

      public 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.

      The level 0 generator should no longer be used afterwards.

    • getEnvironment

      public Environment getEnvironment()
      Returns the environment of the generator.
    • getGenerator0

      public Generator0 getGenerator0()
      Returns a copy of the Generator0 underlying this generator.
    • getGenerator0Ref

      public Generator0 getGenerator0Ref()
      Returns a (read-only) reference to the Generator0 underlying this generator.

      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.

    • toString

      public String toString()
      Returns a String representation of the generator.
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Returns a hash of the generator.
      Overrides:
      hashCode in class Object
    • extendEnvironment

      public void extendEnvironment(Environment e)
      Expands the generator to fit the given environment.

      e must be a super-environment of that of this.

    • extendEnvironmentCopy

      public Generator1 extendEnvironmentCopy(Environment e)
      Returns a generator expanded to fit the given environment.

      e must be a super-environment of that of this.

      this is not modified.

    • clone

      public Generator1 clone()
      Returns a copy of this.
      Overrides:
      clone in class Object
    • isEqual

      public boolean isEqual(Generator1 x)
      Whether this and x have identical coordinate and environment.
    • equals

      public boolean equals(Object x)
      Whether x is a Generator1 and structurally equal to this.
      Overrides:
      equals in class Object