gov.sns.tools.math.r3
Class Z3

java.lang.Object
  |
  +--gov.sns.tools.math.r3.Z3
All Implemented Interfaces:
java.io.Serializable

public class Z3
extends java.lang.Object
implements java.io.Serializable

Represents an element of Z^3, the three-dimensional cartesian product of integers.

See Also:
Serialized Form

Field Summary
 int i
          first coordinate
 int j
          second coordinate
 int k
          third coordinate
 
Constructor Summary
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
 Z3 copy()
          Performs a deep copk operation.
 boolean equals(Z3 r)
          Element by element equivalence comparison (i.e., this==r)
 int geti()
          Return first coordinate value.
 int getj()
          Return second coordinate value.
 int getk()
          Return third coordinate value.
 boolean greaterThan(Z3 r)
          Element by element greater than comparison (i.e., this>r)
 boolean lessThan(Z3 r)
          Element by element less than comparison (i.e., this
 Z3 minus(Z3 r)
          Vector subtraction.
 int norm1()
          Compute the l1 norm of the vector in Z3.
 int normInf()
          Compute the l-infinity norm of the vector in Z3.
 Z3 plus(Z3 r)
          Vector addition.
 void print(java.io.PrintWriter os)
          Print out centents on an output stream.
 void println(java.io.PrintWriter os)
          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.
 Z3 times(int s)
          Scalar multiplication.
 Z3 times(Z3 r)
          Vector multiplication using three-dimensional cross product.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i

public int i
first coordinate


j

public int j
second coordinate


k

public int k
third coordinate

Constructor Detail

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 Detail

copy

public Z3 copy()
Performs a deep copk 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(Z3 r)
Element by element equivalence comparison (i.e., this==r)

Parameters:
r - right-hand argument to ==
Returns:
true if (this-r) equals the zero element

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
Parameters:
r - right-hand argument to <
Returns:
true if (this-r) is in the negative cone in Z3

print

public void print(java.io.PrintWriter os)
Print out centents on an output stream.

Parameters:
os - output stream receive content dump

println

public void println(java.io.PrintWriter os)
Print out centents on an output stream, terminate with new line character.

Parameters:
os - output stream receive content dump