|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJSci.maths.MathVector
JSci.maths.DoubleVector
JSci.maths.Double3Vector
public class Double3Vector
The Double3Vector class encapsulates double 3-vectors.
Field Summary |
---|
Fields inherited from class JSci.maths.DoubleVector |
---|
ARRAY_1D, vector |
Fields inherited from class JSci.maths.MathVector |
---|
CLASS_SPECIFIC, N, storageFormat |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class JSci.maths.DoubleVector |
---|
add, add, negate, normalize, scalarDivide, 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 Double3Vector()
public Double3Vector(double[] array)
array
- an assigned valuepublic Double3Vector(double x, double y, double z)
x
- x coordinatey
- y coordinatez
- z coordinateMethod Detail |
---|
public 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 component
VectorDimensionException
- 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 number
VectorDimensionException
- 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 double
public DoubleVector scalarDivide(double x)
scalarDivide
in class DoubleVector
x
- a double
java.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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |