    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.

##

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

##

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

##

add(AbelianGroupMember)
  Returns the addition of this vector and another.
add(IntegerVector)
  Returns the addition of this vector and another.
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.
negate()
  Returns the negative of this vector.
norm()
  Returns the l2-norm (magnitude).
norm(int)
  Returns the ln-norm.
scalarMultiply(int)
  Returns the multiplication of this vector by a scalar.
scalarMultiply(RingMember)
  Returns the multiplication of this vector by a scalar.
scalarProduct(IntegerVector)
  Returns the scalar product of this vector and another.
setComponent(int, int)
  Sets the value of a component of this vector.
subtract(AbelianGroupMember)
  Returns the subtraction of this vector by another.
subtract(IntegerVector)
  Returns the subtraction of this vector by another.
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.

##

ARRAY_1D

     protected static final int ARRAY_1D

  Storage format identifier.

storageFormat

     protected static final int storageFormat

vector

     protected int vector[]

  Array containing the components of the 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

##

equals

     public boolean equals(Object a)

  Compares two integer vectors for equality.

  Parameters:
    a - an integer vector
  Overrides:
    equals 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 MathVector

norm

     public double norm(int n)

  Returns the ln-norm.

norm

     public double norm()

  Returns the l2-norm (magnitude).

  Overrides:
    norm in class MathVector

infNorm

     public double infNorm()

  Returns the l(infinity)-norm.

negate

     public AbelianGroupMember negate()

  Returns the negative of this vector.

  Overrides:
    negate in class MathVector

add

     public AbelianGroupMember add(AbelianGroupMember v)

  Returns the addition of this vector and another.

  Overrides:
    add in class MathVector

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.

subtract

     public AbelianGroupMember subtract(AbelianGroupMember v)

  Returns the subtraction of this vector by another.

  Overrides:
    subtract in class MathVector

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.

scalarMultiply

     public ModuleMember scalarMultiply(RingMember x)

  Returns the multiplication of this vector by a scalar.

  Overrides:
    scalarMultiply in class MathVector

scalarMultiply

     public IntegerVector scalarMultiply(int x)

  Returns the multiplication of this vector by a scalar.

  Parameters:
    x - an integer

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