Class JSci.maths.DoubleVector
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.DoubleVector

java.lang.Object
   |
   +----JSci.maths.Tensor
           |
           +----JSci.maths.Vector
                   |
                   +----JSci.maths.DoubleVector

public final class DoubleVector
extends Vector
The DoubleVector class provides an object for encapsulating vectors containing doubles.

Constructor Index

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

Method Index

 o clone()
Creates a clone of this vector.
 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 norm()
Returns the l2-norm (magnitude).
 o norm(int)
Returns the ln-norm.
 o setComponent(int, double)
Sets the value of a component of this vector.
 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.

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
 o DoubleVector
  public DoubleVector(double x,
                      double y,
                      double z)
Constructs a 3D vector.
Parameters:
x - x coordinate
y - y coordinate
z - z coordinate

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 clone
  public Object clone()
Creates a clone of this vector.
Returns:
a copy of this vector.
Overrides:
clone 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 Vector
 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 Vector
 o infNorm
  public double infNorm()
Returns the l(infinity)-norm.

All Packages  Class Hierarchy  This Package  Previous  Next  Index