|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectJSci.maths.vectors.MathVector
JSci.maths.vectors.AbstractDoubleVector
The AbstractDoubleVector class encapsulates vectors containing doubles.
| Field Summary |
| Fields inherited from class JSci.maths.vectors.MathVector |
N |
| Constructor Summary | |
protected |
AbstractDoubleVector(int dim)
|
| Method Summary | |
abstract AbstractDoubleVector |
add(AbstractDoubleVector v)
Returns the addition of this vector and another. |
boolean |
equals(java.lang.Object obj)
Compares two double vectors for equality. |
abstract double |
getComponent(int n)
Returns a component of this vector. |
int |
hashCode()
Returns a hashcode for this vector. |
double |
infNorm()
Returns the l -norm. |
abstract AbstractDoubleVector |
mapComponents(Mapping f)
Applies a function on all the vector components. |
double |
mass()
Returns the mass (l1-norm). |
double |
norm()
Returns the l2-norm (magnitude). |
double |
norm(int n)
Returns the ln-norm. |
AbstractDoubleVector |
normalize()
Returns a normalised vector (a vector with norm equal to one). |
abstract AbstractDoubleVector |
scalarDivide(double x)
Returns the division of this vector by a scalar. |
abstract AbstractDoubleVector |
scalarMultiply(double x)
Returns the multiplication of this vector by a scalar. |
abstract double |
scalarProduct(AbstractDoubleVector v)
Returns the scalar product of this vector and another. |
abstract void |
setComponent(int n,
double x)
Sets the value of a component of this vector. |
abstract AbstractDoubleVector |
subtract(AbstractDoubleVector v)
Returns the subtraction of this vector by another. |
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector. |
| Methods inherited from class JSci.maths.vectors.MathVector |
dimension, getInvalidComponentMsg |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface JSci.maths.algebras.VectorSpace.Member |
scalarDivide |
| Methods inherited from interface JSci.maths.algebras.Module.Member |
scalarMultiply |
| Methods inherited from interface JSci.maths.groups.AbelianGroup.Member |
add, negate, subtract |
| Constructor Detail |
protected AbstractDoubleVector(int dim)
| Method Detail |
public boolean equals(java.lang.Object obj)
obj - a double vectorpublic java.lang.String toString()
public int hashCode()
public abstract double getComponent(int n)
n - index of the vector component.
VectorDimensionException - If attempting to access an invalid component.
public abstract void setComponent(int n,
double x)
n - index of the vector component.x - a number.
VectorDimensionException - If attempting to access an invalid component.public double norm(int n)
public double norm()
norm in interface BanachSpace.Membernorm in class MathVectorpublic double infNorm()
-norm.
public double mass()
public abstract AbstractDoubleVector add(AbstractDoubleVector v)
v - a double vector.
VectorDimensionException - If the vectors are different sizes.public abstract AbstractDoubleVector subtract(AbstractDoubleVector v)
v - a double vector.
VectorDimensionException - If the vectors are different sizes.public abstract AbstractDoubleVector scalarMultiply(double x)
x - a double.public abstract AbstractDoubleVector scalarDivide(double x)
x - a double.
java.lang.ArithmeticException - If divide by zero.public AbstractDoubleVector normalize()
public abstract double scalarProduct(AbstractDoubleVector v)
v - a double vector.
VectorDimensionException - If the vectors are different sizes.public abstract AbstractDoubleVector mapComponents(Mapping f)
f - a user-defined function.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||