public class Integer3Vector extends IntegerVector
ARRAY_1D, vectorCLASS_SPECIFIC, N, storageFormat| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
add, add, negate, scalarMultiply, scalarProduct, subtract, subtractdimension, getInvalidComponentMsgpublic Integer3Vector()
public Integer3Vector(int[] array)
array - an assigned valuepublic Integer3Vector(int x,
int y,
int z)
x - x coordinatey - y coordinatez - z coordinatepublic 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 componentVectorDimensionException - If attempting to access an invalid component.public void setComponent(int n,
int x)
setComponent in class IntegerVectorn - index of the vector componentx - an integerVectorDimensionException - 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 integerpublic int scalarProduct(Integer3Vector v)
v - an integer 3-vectorpublic Integer3Vector multiply(Integer3Vector v)
v - an integer 3-vector