public class Double3Vector extends DoubleVector
ARRAY_1D, vector
CLASS_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
![]() |
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, subtract
dimension, getInvalidComponentMsg
public 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 DoubleVector
a
- a double 3-vectorpublic java.lang.String toString()
toString
in class DoubleVector
public int hashCode()
hashCode
in class DoubleVector
public IntegerVector toIntegerVector()
toIntegerVector
in class DoubleVector
public ComplexVector toComplexVector()
toComplexVector
in class DoubleVector
public double getComponent(int n)
getComponent
in class DoubleVector
n
- index of the vector componentVectorDimensionException
- If attempting to access an invalid component.public void setComponent(int n, double x)
setComponent
in class DoubleVector
n
- index of the vector componentx
- a numberVectorDimensionException
- If attempting to access an invalid component.public double norm(int n)
norm
in class DoubleVector
public double norm()
norm
in interface BanachSpace.Member
norm
in class DoubleVector
public double infNorm()
infNorm
in class DoubleVector
public 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 DoubleVector
x
- a doublepublic DoubleVector scalarDivide(double x)
scalarDivide
in class DoubleVector
x
- 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 DoubleVector
f
- a user-defined function