Package apron

Class Dimperm

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

public class Dimperm extends Object implements Cloneable, Serializable
Class of dimension permutations for level 0 objects.

A Dimperm object encapsulates an ap_dimperm_t Apron object allocated in the C heap.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Dimperm(int size)
    Creates an identity permutation of dimensions 0 to size-1.
    Dimperm(int[] dim)
    Creates a permutation.
    Creates a copy of this.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a copy of this.
    Returns a permutation equal to this composed with op.
    boolean
    Whether x is a Dimperm and structurally equal to this.
    protected void
    Deallocates the underlying Apron object.
    int[]
    Returns the permutation map.
    int
    getElem(int i)
    Gets the variable index i is mapped to.
    int
    Returns the number of elements in this permutation.
    Returns a new permutation which is the inverse of this.
    boolean
    Whether x is equal to this.
    void
    setElem(int i, int dim)
    Changes the permutation so that i maps to dim.
    void
    Sets this to the identity permutation.
    Returns a String representation of the permutation.

    Methods inherited from class java.lang.Object

    getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Dimperm

      public Dimperm(int[] dim)
      Creates a permutation.

      The permutation maps dimension i to dimension dim[i].

    • Dimperm

      public Dimperm(int size)
      Creates an identity permutation of dimensions 0 to size-1.
    • Dimperm

      public Dimperm(Dimperm x)
      Creates a copy of this.
  • Method Details

    • finalize

      protected void finalize()
      Deallocates the underlying Apron object.
      Overrides:
      finalize in class Object
    • setId

      public void setId()
      Sets this to the identity permutation.
    • setElem

      public void setElem(int i, int dim)
      Changes the permutation so that i maps to dim.
    • getElem

      public int getElem(int i)
      Gets the variable index i is mapped to.
    • getSize

      public int getSize()
      Returns the number of elements in this permutation.
    • getContents

      public int[] getContents()
      Returns the permutation map.

      if x=a.getContents(), then a maps dimension i to x[i].

    • invert

      public Dimperm invert()
      Returns a new permutation which is the inverse of this.

      this is not modified.

    • compose

      public Dimperm compose(Dimperm op)
      Returns a permutation equal to this composed with op.

      The result maps i to op[this[i]].

      this and op must have the same size.

      this is not changed.

    • toString

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

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

      public boolean isEqual(Dimperm x)
      Whether x is equal to this.
    • equals

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