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.
-
DoubleVector(double, double, double)
- Constructs a 3D vector.
-
DoubleVector(double[])
- Constructs a vector by wrapping an array.
-
DoubleVector(int)
- Constructs an empty vector.
-
clone()
- Creates a clone of this vector.
-
dimension()
- Returns the vector's dimension.
-
equals(Object)
- Compares two double vectors for equality.
-
getComponent(int)
- Returns a component of this vector.
-
hashCode()
- Returns a hashcode for this vector.
-
infNorm()
- Returns the l(infinity)-norm.
-
norm()
- Returns the l2-norm (magnitude).
-
norm(int)
- Returns the ln-norm.
-
setComponent(int, double)
- Sets the value of a component of this vector.
-
toComplexVector()
- Converts this vector to a complex vector.
-
toIntegerVector()
- Converts this vector to an integer vector.
-
toString()
- Returns a comma delimited string representing the value of this vector.
DoubleVector
public DoubleVector(int dim)
- Constructs an empty vector.
- Parameters:
- dim - the dimension of the vector.
DoubleVector
public DoubleVector(double array[])
- Constructs a vector by wrapping an array.
- Parameters:
- array - an assigned value
DoubleVector
public DoubleVector(double x,
double y,
double z)
- Constructs a 3D vector.
- Parameters:
- x - x coordinate
- y - y coordinate
- z - z coordinate
equals
public boolean equals(Object a)
- Compares two double vectors for equality.
- Parameters:
- a - a double vector
- Overrides:
- equals in class Object
clone
public Object clone()
- Creates a clone of this vector.
- Returns:
- a copy of this vector.
- Overrides:
- clone in class Object
toString
public String toString()
- Returns a comma delimited string representing the value of this vector.
- Overrides:
- toString in class Object
hashCode
public int hashCode()
- Returns a hashcode for this vector.
- Overrides:
- hashCode in class Object
toIntegerVector
public IntegerVector toIntegerVector()
- Converts this vector to an integer vector.
- Returns:
- an integer vector
toComplexVector
public ComplexVector toComplexVector()
- Converts this vector to a complex vector.
- Returns:
- a complex vector
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.
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.
dimension
public int dimension()
- Returns the vector's dimension.
- Overrides:
- dimension in class Vector
norm
public double norm(int n)
- Returns the ln-norm.
norm
public double norm()
- Returns the l2-norm (magnitude).
- Overrides:
- norm in class Vector
infNorm
public double infNorm()
- Returns the l(infinity)-norm.
All Packages Class Hierarchy This Package Previous Next Index