Class IntMatrix

java.lang.Object
fr.uga.pddl4j.util.IntMatrix
All Implemented Interfaces:
Serializable

public final class IntMatrix extends Object implements Serializable
This class implements a matrix at n-dimension. This class is used to store the predicates tables.
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Constructor
    Description
    IntMatrix​(int size, int dimension)
    Create a new n-dimensional matrix with a specified size and dimension.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    get​(int[] index)
    Get the integer at the specified index.
    int
    Return the dimension of the matrix.
    int
    Return the size of the matrix.
    void
    increment​(int[] index)
    Increment the value at a specified index.
    void
    put​(int[] index, int value)
    Put a new value at a specified index.
    void
    Set all the value of the matrix to 0.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IntMatrix

      public IntMatrix(int size, int dimension)
      Create a new n-dimensional matrix with a specified size and dimension.
      Parameters:
      size - the size of the matrix.
      dimension - the dimension of the matrix.
      Throws:
      IllegalArgumentException - if size ≤ 0.
  • Method Details

    • get

      public final int get(int[] index)
      Get the integer at the specified index.
      Parameters:
      index - the index.
      Returns:
      the integer contained in the matrix at the specified index or null if no element is at the specified index.
      Throws:
      ArrayIndexOutOfBoundsException - if index.length ≠ dimension and for all i 0 ≤ index[i] < size does not hold.
    • put

      public final void put(int[] index, int value)
      Put a new value at a specified index.
      Parameters:
      index - the index.
      value - the integer value to put.
      Throws:
      ArrayIndexOutOfBoundsException - if index.length ≠ dimension and for all i 0 ≤ index[i] < size does not hold.
    • increment

      public final void increment(int[] index)
      Increment the value at a specified index.
      Parameters:
      index - the index.
      Throws:
      ArrayIndexOutOfBoundsException - if index.length ≠ dimension and for all i 0 ≤ index[i] < size does not hold.
    • zero

      public final void zero()
      Set all the value of the matrix to 0.
    • getDimension

      public int getDimension()
      Return the dimension of the matrix.
      Returns:
      the dimension of the matrix.
    • getSize

      public final int getSize()
      Return the size of the matrix.
      Returns:
      size the size of the matrix.