public class Integer3Vector extends IntegerVector
ARRAY_1D, vector
CLASS_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
![]() |
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, subtract
dimension, getInvalidComponentMsg
public 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 IntegerVector
a
- an integer 3-vectorpublic java.lang.String toString()
toString
in class IntegerVector
public int hashCode()
hashCode
in class IntegerVector
public DoubleVector toDoubleVector()
toDoubleVector
in class IntegerVector
public ComplexVector toComplexVector()
toComplexVector
in class IntegerVector
public int getComponent(int n)
getComponent
in class IntegerVector
n
- index of the vector componentVectorDimensionException
- If attempting to access an invalid component.public void setComponent(int n, int x)
setComponent
in class IntegerVector
n
- index of the vector componentx
- an integerVectorDimensionException
- If attempting to access an invalid component.public double norm(int n)
norm
in class IntegerVector
public double norm()
norm
in class IntegerVector
public double infNorm()
infNorm
in class IntegerVector
public 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 IntegerVector
x
- an integerpublic int scalarProduct(Integer3Vector v)
v
- an integer 3-vectorpublic Integer3Vector multiply(Integer3Vector v)
v
- an integer 3-vector