Package xal.tools.math.r3
Class Z3
java.lang.Object
xal.tools.math.r3.Z3
- All Implemented Interfaces:
Serializable
Represents an element of Z^3, the three-dimensional cartesian product of
integers.
- Author:
- Christopher Allen
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Performs a deep copy operation.boolean
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)int
hashCode()
boolean
Element by element less than comparison (i.e., this<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.Vector addition.void
print
(PrintWriter os) Print out centents on an output stream.void
println
(PrintWriter os) Print out centents on an output stream, terminate with new line character.void
set
(int s) Set all coordinates to valuevoid
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.Vector multiplication using three-dimensional cross product.
-
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 valuej
- first coordinate valuek
- first coordinate value
-
Z3
Creates a new instance of Z3 initialized to argument.- Parameters:
vecPt
- deep copies this value
-
-
Method Details
-
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
Scalar multiplication.- Parameters:
s
- scalar to multiply this vector- Returns:
- new Z3 object scaled by s
-
plus
Vector addition.- Parameters:
r
- vector displacement- Returns:
- new Z3 object equal to this displaced by r
-
minus
Vector subtraction.- Parameters:
r
- vector displacement- Returns:
- new Z3 object equal to this displaced bj r
-
times
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
Element by element equivalence comparison (i.e., this==r) -
hashCode
public int hashCode() -
greaterThan
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
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
Print out centents on an output stream.- Parameters:
os
- output stream receive content dump
-
println
Print out centents on an output stream, terminate with new line character.- Parameters:
os
- output stream receive content dump
-