|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectJSci.maths.MathVector
JSci.maths.IntegerVector
JSci.maths.Integer3Vector
public class Integer3Vector
The Integer3Vector class encapsulates integer 3-vectors.
| Field Summary |
|---|
| Fields inherited from class JSci.maths.IntegerVector |
|---|
ARRAY_1D, vector |
| Fields inherited from class JSci.maths.MathVector |
|---|
CLASS_SPECIFIC, N, storageFormat |
| Constructor Summary | |
|---|---|
Integer3Vector()
Constructs an empty 3-vector. |
|
Integer3Vector(int[] array)
Constructs a vector by wrapping an array. |
|
Integer3Vector(int x,
int y,
int z)
Constructs a 3-vector. |
|
| Method Summary | |
|---|---|
Integer3Vector |
add(Integer3Vector v)
Returns the addition of this vector and another. |
boolean |
equals(java.lang.Object a)
Compares two integer vectors for equality. |
int |
getComponent(int n)
Returns a component of this vector. |
int |
hashCode()
Returns a hashcode for this vector. |
double |
infNorm()
Returns the l -norm. |
Integer3Vector |
multiply(Integer3Vector v)
Returns the vector product of this vector and another. |
double |
norm()
Returns the l2-norm (magnitude). |
double |
norm(int n)
Returns the ln-norm. |
IntegerVector |
scalarMultiply(int x)
Returns the multiplication of this vector by a scalar. |
int |
scalarProduct(Integer3Vector v)
Returns the scalar product of this vector and another. |
void |
setComponent(int n,
int x)
Sets the value of a component of this vector. |
Integer3Vector |
subtract(Integer3Vector v)
Returns the subtraction of this vector by another. |
ComplexVector |
toComplexVector()
Converts this 3-vector to a complex 3-vector. |
DoubleVector |
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.IntegerVector |
|---|
add, add, negate, scalarMultiply, scalarProduct, subtract, subtract |
| Methods inherited from class JSci.maths.MathVector |
|---|
dimension, getInvalidComponentMsg |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Integer3Vector()
public Integer3Vector(int[] array)
array - an assigned value
public Integer3Vector(int x,
int y,
int z)
x - x coordinatey - y coordinatez - z coordinate| Method Detail |
|---|
public boolean equals(java.lang.Object a)
equals in class IntegerVectora - an integer 3-vectorpublic java.lang.String toString()
toString in class IntegerVectorpublic int hashCode()
hashCode in class IntegerVectorpublic DoubleVector toDoubleVector()
toDoubleVector in class IntegerVectorpublic ComplexVector toComplexVector()
toComplexVector in class IntegerVectorpublic int getComponent(int n)
getComponent in class IntegerVectorn - index of the vector component
VectorDimensionException - If attempting to access an invalid component.
public void setComponent(int n,
int x)
setComponent in class IntegerVectorn - index of the vector componentx - an integer
VectorDimensionException - If attempting to access an invalid component.public double norm(int n)
norm in class IntegerVectorpublic double norm()
norm in class IntegerVectorpublic double infNorm()
-norm.
infNorm in class IntegerVectorpublic Integer3Vector add(Integer3Vector v)
v - an integer 3-vectorpublic Integer3Vector subtract(Integer3Vector v)
v - an integer 3-vectorpublic IntegerVector scalarMultiply(int x)
scalarMultiply in class IntegerVectorx - an integer
public int scalarProduct(Integer3Vector v)
v - an integer 3-vectorpublic Integer3Vector multiply(Integer3Vector v)
v - an integer 3-vector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||