|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.maths.vectors.MathVector JSci.maths.vectors.AbstractIntegerVector JSci.maths.vectors.Integer3Vector
public final class Integer3Vector
An optimised implementation of a 3D integer vector.
Field Summary | |
---|---|
protected int |
x
|
protected int |
y
|
protected int |
z
|
Fields inherited from class JSci.maths.vectors.MathVector |
---|
N |
Constructor Summary | |
---|---|
Integer3Vector()
Constructs an empty 3-vector. |
|
Integer3Vector(int[] array)
Constructs a 3-vector. |
|
Integer3Vector(int x,
int y,
int z)
Constructs a 3-vector. |
Method Summary | |
---|---|
AbelianGroup.Member |
add(AbelianGroup.Member vec)
Returns the addition of this vector and another. |
AbstractIntegerVector |
add(AbstractIntegerVector vec)
Returns the addition of this vector and another. |
boolean |
equals(java.lang.Object obj,
double tol)
Compares two integer vectors for equality. |
int |
getComponent(int n)
Returns a component of this vector. |
double |
infNorm()
Returns the l-norm. |
Integer3Vector |
multiply(Integer3Vector vec)
Returns the vector product of this vector and another (so(3) algebra). |
AbelianGroup.Member |
negate()
Returns the negative of this vector. |
double |
norm()
Returns the l2-norm (magnitude). |
double |
norm(int n)
Returns the ln-norm. |
AbstractIntegerVector |
scalarMultiply(int k)
Returns the multiplication of this vector by a scalar. |
Module.Member |
scalarMultiply(Ring.Member x)
Returns the multiplication of this vector by a scalar. |
int |
scalarProduct(AbstractIntegerVector vec)
Returns the scalar product of this vector and another. |
void |
setComponent(int n,
int value)
Sets the value of a component of this vector. |
AbelianGroup.Member |
subtract(AbelianGroup.Member vec)
Returns the subtraction of this vector by another. |
AbstractIntegerVector |
subtract(AbstractIntegerVector vec)
Returns the subtraction of this vector by another. |
AbstractComplexVector |
toComplexVector()
Converts this 3-vector to a complex 3-vector. |
AbstractDoubleVector |
toDoubleVector()
Converts this 3-vector to a double 3-vector. |
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector. |
Methods inherited from class JSci.maths.vectors.AbstractIntegerVector |
---|
equals, getSet, hashCode |
Methods inherited from class JSci.maths.vectors.MathVector |
---|
dimension, getInvalidComponentMsg |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int x
protected int y
protected int z
Constructor Detail |
---|
public Integer3Vector()
public Integer3Vector(int x, int y, int z)
x
- x coordinate.y
- y coordinate.z
- z coordinate.public Integer3Vector(int[] array)
Method Detail |
---|
public boolean equals(java.lang.Object obj, double tol)
obj
- a integer 3-vectorpublic java.lang.String toString()
toString
in class AbstractIntegerVector
public AbstractDoubleVector toDoubleVector()
toDoubleVector
in class AbstractIntegerVector
public AbstractComplexVector toComplexVector()
public int getComponent(int n)
getComponent
in class AbstractIntegerVector
n
- index of the vector component
VectorDimensionException
- If attempting to access an invalid component.public void setComponent(int n, int value)
setComponent
in class AbstractIntegerVector
n
- index of the vector componentvalue
- a number
VectorDimensionException
- If attempting to access an invalid component.public double norm(int n)
norm
in class AbstractIntegerVector
public double norm()
norm
in class AbstractIntegerVector
public double infNorm()
infNorm
in class AbstractIntegerVector
public AbelianGroup.Member negate()
public AbelianGroup.Member add(AbelianGroup.Member vec)
vec
- a group memberpublic AbstractIntegerVector add(AbstractIntegerVector vec)
add
in class AbstractIntegerVector
vec
- a integer 3-vectorpublic AbelianGroup.Member subtract(AbelianGroup.Member vec)
vec
- a group memberpublic AbstractIntegerVector subtract(AbstractIntegerVector vec)
subtract
in class AbstractIntegerVector
vec
- a integer 3-vectorpublic Module.Member scalarMultiply(Ring.Member x)
x
- a ring memberpublic AbstractIntegerVector scalarMultiply(int k)
scalarMultiply
in class AbstractIntegerVector
k
- a integer
public int scalarProduct(AbstractIntegerVector vec)
scalarProduct
in class AbstractIntegerVector
vec
- a integer 3-vectorpublic Integer3Vector multiply(Integer3Vector vec)
vec
- a integer 3-vector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |