Class Z3

java.lang.Object
xal.tools.math.r3.Z3
All Implemented Interfaces:
Serializable

public class Z3 extends Object implements Serializable
Represents an element of Z^3, the three-dimensional cartesian product of integers.
Author:
Christopher Allen
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Z3()
    Creates a new instance of Z3, the zero element.
    Z3(int i, int j, int k)
    Creates a new instance of Z3 initialized to arguments.
    Z3(Z3 vecPt)
    Creates a new instance of Z3 initialized to argument.
  • Method Summary

    Modifier and Type
    Method
    Description
    Performs a deep copy operation.
    boolean
    Element by element equivalence comparison (i.e., this==r)
    int
    Return first coordinate value.
    int
    Return second coordinate value.
    int
    Return third coordinate value.
    boolean
    Element by element greater than comparison (i.e., this>r)
    int
     
    boolean
    Element by element less than comparison (i.e., this<r)
    minus(Z3 r)
    Vector subtraction.
    int
    Compute the l1 norm of the vector in Z3.
    int
    Compute the l-infinity norm of the vector in Z3.
    plus(Z3 r)
    Vector addition.
    void
    Print out centents on an output stream.
    void
    Print out centents on an output stream, terminate with new line character.
    void
    set(int s)
    Set all coordinates to value
    void
    seti(int i)
    Set first coordinate value.
    void
    setj(int j)
    Set second coordinate value.
    void
    setk(int k)
    Set third coordinate value.
    times(int s)
    Scalar multiplication.
    times(Z3 r)
    Vector multiplication using three-dimensional cross product.

    Methods inherited from class java.lang.Object

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

    • Z3

      public Z3()
      Creates a new instance of Z3, the zero element.
    • Z3

      public Z3(int i, int j, int k)
      Creates a new instance of Z3 initialized to arguments.
      Parameters:
      i - first coordinate value
      j - first coordinate value
      k - first coordinate value
    • Z3

      public Z3(Z3 vecPt)
      Creates a new instance of Z3 initialized to argument.
      Parameters:
      vecPt - deep copies this value
  • Method Details

    • copy

      public Z3 copy()
      Performs a deep copy operation.
      Returns:
      cloned Z3 object
    • seti

      public void seti(int i)
      Set first coordinate value.
    • setj

      public void setj(int j)
      Set second coordinate value.
    • setk

      public void setk(int k)
      Set third coordinate value.
    • set

      public void set(int s)
      Set all coordinates to value
    • geti

      public int geti()
      Return first coordinate value.
    • getj

      public int getj()
      Return second coordinate value.
    • getk

      public int getk()
      Return third coordinate value.
    • times

      public Z3 times(int s)
      Scalar multiplication.
      Parameters:
      s - scalar to multiply this vector
      Returns:
      new Z3 object scaled by s
    • plus

      public Z3 plus(Z3 r)
      Vector addition.
      Parameters:
      r - vector displacement
      Returns:
      new Z3 object equal to this displaced by r
    • minus

      public Z3 minus(Z3 r)
      Vector subtraction.
      Parameters:
      r - vector displacement
      Returns:
      new Z3 object equal to this displaced bj r
    • times

      public Z3 times(Z3 r)
      Vector multiplication using three-dimensional cross product.
      Parameters:
      r - second (right) operand in cross-product (this is first operand)
      Returns:
      result of vector cross product in three space
    • norm1

      public int norm1()
      Compute the l1 norm of the vector in Z3.
      Returns:
      l1 norm = |i| + |j| + |k|
    • normInf

      public int normInf()
      Compute the l-infinity norm of the vector in Z3.
      Returns:
      l-infinity norm = max(|i|,|j|,|k|)
    • equals

      public boolean equals(Object obj)
      Element by element equivalence comparison (i.e., this==r)
      Overrides:
      equals in class Object
      Parameters:
      r - right-hand argument to ==
      Returns:
      true if (this-r) equals the zero element
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • greaterThan

      public boolean greaterThan(Z3 r)
      Element by element greater than comparison (i.e., this>r)
      Parameters:
      r - right-hand argument to >
      Returns:
      true if (this-r) is in the positive cone in Z3
    • lessThan

      public boolean lessThan(Z3 r)
      Element by element less than comparison (i.e., this<r)
      Parameters:
      r - right-hand argument to <
      Returns:
      true if (this-r) is in the negative cone in Z3
    • print

      public void print(PrintWriter os)
      Print out centents on an output stream.
      Parameters:
      os - output stream receive content dump
    • println

      public void println(PrintWriter os)
      Print out centents on an output stream, terminate with new line character.
      Parameters:
      os - output stream receive content dump