All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.IntegerVector

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

public class IntegerVector
extends MathVector
The IntegerVector class encapsulates vectors containing integers.


Variable Index

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

Constructor Index

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

Method Index

 o add(AbelianGroupMember)
Returns the addition of this vector and another.
 o add(IntegerVector)
Returns the addition of this vector and another.
 o dimension()
Returns the vector's dimension.
 o equals(Object)
Compares two integer 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 negate()
Returns the negative of this vector.
 o norm()
Returns the l2-norm (magnitude).
 o norm(int)
Returns the ln-norm.
 o scalarMultiply(int)
Returns the multiplication of this vector by a scalar.
 o scalarMultiply(RingMember)
Returns the multiplication of this vector by a scalar.
 o scalarProduct(IntegerVector)
Returns the scalar product of this vector and another.
 o setComponent(int, int)
Sets the value of a component of this vector.
 o subtract(AbelianGroupMember)
Returns the subtraction of this vector by another.
 o subtract(IntegerVector)
Returns the subtraction of this vector by another.
 o toComplexVector()
Converts this vector to a complex vector.
 o toDoubleVector()
Converts this vector to a double 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 int vector[]
Array containing the components of the vector.

Constructors

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

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

Parameters:
array - an assigned value

Methods

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

Parameters:
a - an integer 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 toDoubleVector
 public DoubleVector toDoubleVector()
Converts this vector to a double vector.

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

Returns:
a complex vector
 o 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.
 o 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.
 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 IntegerVector add(IntegerVector v)
Returns the addition of this vector and another.

Parameters:
v - an integer 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 IntegerVector subtract(IntegerVector v)
Returns the subtraction of this vector by another.

Parameters:
v - an integer 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 IntegerVector scalarMultiply(int x)
Returns the multiplication of this vector by a scalar.

Parameters:
x - an integer
 o scalarProduct
 public int scalarProduct(IntegerVector v)
Returns the scalar product of this vector and another.

Parameters:
v - an integer vector
Throws: VectorDimensionException
If the vectors are different sizes.

All Packages  Class Hierarchy  This Package  Previous  Next  Index