All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.DoubleVector

java.lang.Object
   |
   +----JSci.maths.MathVector
           |
           +----JSci.maths.DoubleVector

public class DoubleVector
extends MathVector
The DoubleVector class encapsulates double vectors.


Variable Index

 o ARRAY_1D
Storage format identifier.
 o storageFormat
 o vector
Array containing the components of the vector.

Constructor Index

 o DoubleVector(double[])
Constructs a vector by wrapping an array.
 o DoubleVector(int)
Constructs an empty vector.

Method Index

 o add(AbelianGroupMember)
Returns the addition of this vector and another.
 o add(DoubleVector)
Returns the addition of this vector and another.
 o dimension()
Returns the vector's dimension.
 o equals(Object)
Compares two double vectors for equality.
 o getComponent(int)
Returns a component of this vector.
 o hashCode()
Returns a hashcode for this vector.
 o infNorm()
Returns the l(infinity)-norm.
 o mapComponents(Mapping)
Applies a function on all the vector components.
 o negate()
Returns the negative of this vector.
 o norm()
Returns the l2-norm (magnitude).
 o norm(int)
Returns the ln-norm.
 o scalarDivide(double)
Returns the division of this vector by a scalar.
 o scalarMultiply(double)
Returns the multiplication of this vector by a scalar.
 o scalarMultiply(RingMember)
Returns the multiplication of this vector by a scalar.
 o scalarProduct(DoubleVector)
Returns the scalar product of this vector and another.
 o setComponent(int, double)
Sets the value of a component of this vector.
 o subtract(AbelianGroupMember)
Returns the subtraction of this vector by another.
 o subtract(DoubleVector)
Returns the subtraction of this vector by another.
 o toComplexVector()
Converts this vector to a complex vector.
 o toIntegerVector()
Converts this vector to an integer vector.
 o toString()
Returns a comma delimited string representing the value of this vector.

Variables

 o ARRAY_1D
 protected static final int ARRAY_1D
Storage format identifier.

 o storageFormat
 protected static final int storageFormat
 o vector
 protected double vector[]
Array containing the components of the vector.

Constructors

 o DoubleVector
 public DoubleVector(int dim)
Constructs an empty vector.

Parameters:
dim - the dimension of the vector.
 o DoubleVector
 public DoubleVector(double array[])
Constructs a vector by wrapping an array.

Parameters:
array - an assigned value

Methods

 o equals
 public boolean equals(Object a)
Compares two double vectors for equality.

Parameters:
a - a double vector
Overrides:
equals in class Object
 o toString
 public String toString()
Returns a comma delimited string representing the value of this vector.

Overrides:
toString in class Object
 o hashCode
 public int hashCode()
Returns a hashcode for this vector.

Overrides:
hashCode in class Object
 o toIntegerVector
 public IntegerVector toIntegerVector()
Converts this vector to an integer vector.

Returns:
an integer vector
 o toComplexVector
 public ComplexVector toComplexVector()
Converts this vector to a complex vector.

Returns:
a complex vector
 o getComponent
 public double getComponent(int n)
Returns a component of this vector.

Parameters:
n - index of the vector component
Throws: VectorDimensionException
If attempting to access an invalid component.
 o setComponent
 public void setComponent(int n,
                          double x)
Sets the value of a component of this vector.

Parameters:
n - index of the vector component
x - a number
Throws: VectorDimensionException
If attempting to access an invalid component.
 o dimension
 public int dimension()
Returns the vector's dimension.

Overrides:
dimension in class MathVector
 o norm
 public double norm(int n)
Returns the ln-norm.

 o norm
 public double norm()
Returns the l2-norm (magnitude).

Overrides:
norm in class MathVector
 o infNorm
 public double infNorm()
Returns the l(infinity)-norm.

 o negate
 public AbelianGroupMember negate()
Returns the negative of this vector.

Overrides:
negate in class MathVector
 o add
 public AbelianGroupMember add(AbelianGroupMember v)
Returns the addition of this vector and another.

Overrides:
add in class MathVector
 o add
 public DoubleVector add(DoubleVector v)
Returns the addition of this vector and another.

Parameters:
v - a double vector
Throws: VectorDimensionException
If the vectors are different sizes.
 o subtract
 public AbelianGroupMember subtract(AbelianGroupMember v)
Returns the subtraction of this vector by another.

Overrides:
subtract in class MathVector
 o subtract
 public DoubleVector subtract(DoubleVector v)
Returns the subtraction of this vector by another.

Parameters:
v - a double vector
Throws: VectorDimensionException
If the vectors are different sizes.
 o scalarMultiply
 public ModuleMember scalarMultiply(RingMember x)
Returns the multiplication of this vector by a scalar.

Overrides:
scalarMultiply in class MathVector
 o scalarMultiply
 public DoubleVector scalarMultiply(double x)
Returns the multiplication of this vector by a scalar.

Parameters:
x - a double
 o scalarDivide
 public DoubleVector scalarDivide(double x)
Returns the division of this vector by a scalar.

Parameters:
x - a double
Throws: ArithmeticException
If divide by zero.
 o scalarProduct
 public double scalarProduct(DoubleVector v)
Returns the scalar product of this vector and another.

Parameters:
v - a double vector
Throws: VectorDimensionException
If the vectors are different sizes.
 o mapComponents
 public DoubleVector mapComponents(Mapping f)
Applies a function on all the vector components.

Parameters:
f - a user-defined function
Returns:
a double vector

All Packages  Class Hierarchy  This Package  Previous  Next  Index