public class Double3Vector extends DoubleVector
ARRAY_1D, vectorCLASS_SPECIFIC, N, storageFormat| Constructor and Description |
|---|
Double3Vector()
Constructs an empty 3-vector.
|
Double3Vector(double[] array)
Constructs a vector by wrapping an array.
|
Double3Vector(double x,
double y,
double z)
Constructs a 3-vector.
|
| Modifier and Type | Method and Description |
|---|---|
Double3Vector |
add(Double3Vector v)
Returns the addition of this vector and another.
|
boolean |
equals(java.lang.Object a)
Compares two double vectors for equality.
|
double |
getComponent(int n)
Returns a component of this vector.
|
int |
hashCode()
Returns a hashcode for this vector.
|
double |
infNorm()
Returns the l
-norm. |
DoubleVector |
mapComponents(Mapping f)
Applies a function on all the vector components.
|
Double3Vector |
multiply(Double3Vector v)
Returns the vector product of this vector and another (so(3) algebra).
|
double |
norm()
Returns the l2-norm (magnitude).
|
double |
norm(int n)
Returns the ln-norm.
|
DoubleVector |
scalarDivide(double x)
Returns the division of this vector by a scalar.
|
DoubleVector |
scalarMultiply(double x)
Returns the multiplication of this vector by a scalar.
|
double |
scalarProduct(Double3Vector v)
Returns the scalar product of this vector and another.
|
void |
setComponent(int n,
double x)
Sets the value of a component of this vector.
|
Double3Vector |
subtract(Double3Vector v)
Returns the subtraction of this vector by another.
|
ComplexVector |
toComplexVector()
Converts this 3-vector to a complex 3-vector.
|
IntegerVector |
toIntegerVector()
Converts this 3-vector to an integer 3-vector.
|
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector.
|
add, add, negate, normalize, scalarDivide, scalarMultiply, scalarProduct, subtract, subtractdimension, getInvalidComponentMsgpublic Double3Vector()
public Double3Vector(double[] array)
array - an assigned valuepublic Double3Vector(double x,
double y,
double z)
x - x coordinatey - y coordinatez - z coordinatepublic boolean equals(java.lang.Object a)
equals in class DoubleVectora - a double 3-vectorpublic java.lang.String toString()
toString in class DoubleVectorpublic int hashCode()
hashCode in class DoubleVectorpublic IntegerVector toIntegerVector()
toIntegerVector in class DoubleVectorpublic ComplexVector toComplexVector()
toComplexVector in class DoubleVectorpublic double getComponent(int n)
getComponent in class DoubleVectorn - index of the vector componentVectorDimensionException - If attempting to access an invalid component.public void setComponent(int n,
double x)
setComponent in class DoubleVectorn - index of the vector componentx - a numberVectorDimensionException - If attempting to access an invalid component.public double norm(int n)
norm in class DoubleVectorpublic double norm()
norm in interface BanachSpace.Membernorm in class DoubleVectorpublic double infNorm()
-norm.infNorm in class DoubleVectorpublic Double3Vector add(Double3Vector v)
v - a double 3-vectorpublic Double3Vector subtract(Double3Vector v)
v - a double 3-vectorpublic DoubleVector scalarMultiply(double x)
scalarMultiply in class DoubleVectorx - a doublepublic DoubleVector scalarDivide(double x)
scalarDivide in class DoubleVectorx - a doublejava.lang.ArithmeticException - If divide by zero.public double scalarProduct(Double3Vector v)
v - a double 3-vectorpublic Double3Vector multiply(Double3Vector v)
v - a double 3-vectorpublic DoubleVector mapComponents(Mapping f)
mapComponents in class DoubleVectorf - a user-defined function