|
|||||||||
| 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
JSci.maths.vectors.DoubleVector
public class DoubleVector
An array-based implementation of a double vector.
| Field Summary | |
|---|---|
protected double[] |
vector
Array containing the components of the vector. |
| Fields inherited from class JSci.maths.vectors.MathVector |
|---|
N |
| Constructor Summary | |
|---|---|
DoubleVector(double[] array)
Constructs a vector by wrapping an array. |
|
DoubleVector(int dim)
Constructs an empty vector. |
|
| Method Summary | |
|---|---|
AbelianGroup.Member |
add(AbelianGroup.Member v)
Returns the addition of this vector and another. |
AbstractDoubleVector |
add(AbstractDoubleVector v)
Returns the addition of this vector and another. |
DoubleVector |
add(DoubleVector v)
|
boolean |
equals(java.lang.Object a,
double tol)
Compares two double vectors for equality. |
double |
getComponent(int n)
Returns a component of this vector. |
double |
infNorm()
Returns the l -norm. |
AbstractDoubleVector |
mapComponents(Mapping f)
Applies a function on all the vector components. |
AbelianGroup.Member |
negate()
Returns the negative of this vector. |
double |
norm()
Returns the l2-norm (magnitude). |
double |
norm(int n)
Returns the ln-norm. |
AbstractDoubleVector |
scalarDivide(double x)
Returns the division of this vector by a scalar. |
VectorSpace.Member |
scalarDivide(Field.Member x)
Returns the division of this vector by a scalar. |
AbstractDoubleVector |
scalarMultiply(double x)
Returns the multiplication of this vector by a scalar. |
Module.Member |
scalarMultiply(Ring.Member x)
Returns the multiplication of this vector by a scalar. |
double |
scalarProduct(AbstractDoubleVector v)
Returns the scalar product of this vector and another. |
double |
scalarProduct(DoubleVector v)
|
void |
setComponent(int n,
double x)
Sets the value of a component of this vector. |
AbelianGroup.Member |
subtract(AbelianGroup.Member v)
Returns the subtraction of this vector by another. |
AbstractDoubleVector |
subtract(AbstractDoubleVector v)
Returns the subtraction of this vector by another. |
DoubleVector |
subtract(DoubleVector v)
|
AbstractComplexVector |
toComplexVector()
Converts this vector to a complex vector. |
AbstractIntegerVector |
toIntegerVector()
Converts this vector to an integer vector. |
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector. |
| Methods inherited from class JSci.maths.vectors.AbstractDoubleVector |
|---|
equals, getSet, hashCode, mass, normalize |
| 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 |
| Field Detail |
|---|
protected double[] vector
| Constructor Detail |
|---|
public DoubleVector(int dim)
dim - the dimension of the vector.public DoubleVector(double[] array)
array - an assigned value.| Method Detail |
|---|
public boolean equals(java.lang.Object a,
double tol)
equals in class AbstractDoubleVectora - a double vector.public java.lang.String toString()
toString in class AbstractDoubleVectorpublic AbstractIntegerVector toIntegerVector()
public AbstractComplexVector toComplexVector()
public double getComponent(int n)
getComponent in class AbstractDoubleVectorn - index of the vector component.
VectorDimensionException - If attempting to access an invalid component.
public void setComponent(int n,
double x)
setComponent in class AbstractDoubleVectorn - index of the vector component.x - a number.
VectorDimensionException - If attempting to access an invalid component.public double norm(int n)
norm in class AbstractDoubleVectorpublic double norm()
norm in interface BanachSpace.Membernorm in class AbstractDoubleVectorpublic double infNorm()
-norm.
infNorm in class AbstractDoubleVectorpublic AbelianGroup.Member negate()
public AbelianGroup.Member add(AbelianGroup.Member v)
v - a group memberpublic AbstractDoubleVector add(AbstractDoubleVector v)
add in class AbstractDoubleVectorv - a double vector.
VectorDimensionException - If the vectors are different sizes.public DoubleVector add(DoubleVector v)
public AbelianGroup.Member subtract(AbelianGroup.Member v)
v - a group memberpublic AbstractDoubleVector subtract(AbstractDoubleVector v)
subtract in class AbstractDoubleVectorv - a double vector.
VectorDimensionException - If the vectors are different sizes.public DoubleVector subtract(DoubleVector v)
public Module.Member scalarMultiply(Ring.Member x)
x - a ring memberpublic AbstractDoubleVector scalarMultiply(double x)
scalarMultiply in class AbstractDoubleVectorx - a double.public VectorSpace.Member scalarDivide(Field.Member x)
x - a field memberpublic AbstractDoubleVector scalarDivide(double x)
scalarDivide in class AbstractDoubleVectorx - a double.
java.lang.ArithmeticException - If divide by zero.public double scalarProduct(AbstractDoubleVector v)
scalarProduct in class AbstractDoubleVectorv - a double vector.
VectorDimensionException - If the vectors are different sizes.public double scalarProduct(DoubleVector v)
public AbstractDoubleVector mapComponents(Mapping f)
mapComponents in class AbstractDoubleVectorf - a user-defined function.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||