Class JSci.maths.IntegerVector
All Packages Class Hierarchy This Package Previous Next Index
Class JSci.maths.IntegerVector
java.lang.Object
|
+----JSci.maths.Tensor
|
+----JSci.maths.Vector
|
+----JSci.maths.IntegerVector
- public final class IntegerVector
- extends Vector
The IntegerVector class provides an object for encapsulating vectors containing integers.
-
IntegerVector(int)
- Constructs an empty vector.
-
IntegerVector(int, int, int)
- Constructs a 3D vector.
-
IntegerVector(int[])
- Constructs a vector by wrapping an array.
-
clone()
- Creates a clone of this vector.
-
dimension()
- Returns the vector's dimension.
-
equals(Object)
- Compares two integer 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, int)
- Sets the value of a component of this vector.
-
toComplexVector()
- Converts this vector to a complex vector.
-
toDoubleVector()
- Converts this vector to a double vector.
-
toString()
- Returns a comma delimited string representing the value of this vector.
IntegerVector
public IntegerVector(int dim)
- Constructs an empty vector.
- Parameters:
- dim - the dimension of the vector.
IntegerVector
public IntegerVector(int array[])
- Constructs a vector by wrapping an array.
- Parameters:
- array - an assigned value
IntegerVector
public IntegerVector(int x,
int y,
int z)
- Constructs a 3D vector.
- Parameters:
- x - x ordinate
- y - y ordinate
- z - z ordinate
equals
public boolean equals(Object a)
- Compares two integer vectors for equality.
- Parameters:
- a - an integer 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
toDoubleVector
public DoubleVector toDoubleVector()
- Converts this vector to a double vector.
- Returns:
- a double vector
toComplexVector
public ComplexVector toComplexVector()
- Converts this vector to a complex vector.
- Returns:
- a complex vector
getComponent
public int 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,
int x)
- Sets the value of a component of this vector.
- Parameters:
- n - index of the vector component
- x - an integer
- 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