All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.IntegerMatrix

java.lang.Object
   |
   +----JSci.maths.Matrix
           |
           +----JSci.maths.IntegerMatrix

public class IntegerMatrix
extends Matrix
The IntegerMatrix class provides an object for encapsulating matrices containing integers.


Variable Index

 o ARRAY_2D
Storage format identifier.
 o matrix
Array containing the elements of the matrix.
 o storageFormat

Constructor Index

 o IntegerMatrix()
Constructs a matrix.
 o IntegerMatrix(int, int)
Constructs an empty matrix.
 o IntegerMatrix(int[][])
Constructs a matrix by wrapping an array.
 o IntegerMatrix(IntegerVector[])
Constructs a matrix from an array of vectors (columns).

Method Index

 o add(AbelianGroupMember)
Returns the addition of this matrix and another.
 o add(IntegerMatrix)
Returns the addition of this matrix and another.
 o columns()
Returns the number of columns.
 o equals(Object)
Compares two integer matrices for equality.
 o finalize()
Finalize.
 o frobeniusNorm()
Returns the Frobenius norm.
 o getElement(int, int)
Returns an element of the matrix.
 o hashCode()
Returns a hashcode for this matrix.
 o infNorm()
Returns the l(infinity)-norm.
 o multiply(IntegerMatrix)
Returns the multiplication of this matrix and another.
 o multiply(IntegerVector)
Returns the multiplication of a vector by this matrix.
 o multiply(RingMember)
Returns the multiplication of this matrix and another.
 o negate()
Returns the negative of this matrix.
 o rows()
Returns the number of rows.
 o scalarMultiply(int)
Returns the multiplication of this matrix by a scalar.
 o scalarMultiply(RingMember)
Returns the multiplication of this matrix by a scalar.
 o setElement(int, int, int)
Sets the value of an element of the matrix.
 o subtract(AbelianGroupMember)
Returns the subtraction of this matrix by another.
 o subtract(IntegerMatrix)
Returns the subtraction of this matrix by another.
 o toComplexMatrix()
Converts this matrix to a complex matrix.
 o toDoubleMatrix()
Converts this matrix to a double matrix.
 o toString()
Returns a string representing this matrix.
 o transpose()
Returns the transpose of this matrix.

Variables

 o ARRAY_2D
 protected static final int ARRAY_2D
Storage format identifier.

 o storageFormat
 protected static final int storageFormat
 o matrix
 protected int matrix[][]
Array containing the elements of the matrix.

Constructors

 o IntegerMatrix
 protected IntegerMatrix()
Constructs a matrix.

 o IntegerMatrix
 public IntegerMatrix(int row,
                      int col)
Constructs an empty matrix.

Parameters:
row - the number of rows
col - the number of columns
 o IntegerMatrix
 public IntegerMatrix(int array[][])
Constructs a matrix by wrapping an array.

Parameters:
array - an assigned value
 o IntegerMatrix
 public IntegerMatrix(IntegerVector array[])
Constructs a matrix from an array of vectors (columns).

Parameters:
array - an assigned value

Methods

 o finalize
 protected void finalize() throws Throwable
Finalize.

Throws: Throwable
Any that occur.
Overrides:
finalize in class Object
 o equals
 public boolean equals(Object m)
Compares two integer matrices for equality.

Parameters:
m - an integer matrix
Overrides:
equals in class Object
 o toString
 public String toString()
Returns a string representing this matrix.

Overrides:
toString in class Object
 o hashCode
 public int hashCode()
Returns a hashcode for this matrix.

Overrides:
hashCode in class Object
 o toDoubleMatrix
 public DoubleMatrix toDoubleMatrix()
Converts this matrix to a double matrix.

Returns:
a double matrix
 o toComplexMatrix
 public ComplexMatrix toComplexMatrix()
Converts this matrix to a complex matrix.

Returns:
a complex matrix
 o getElement
 public int getElement(int i,
                       int j)
Returns an element of the matrix.

Parameters:
i - row index of the element
j - column index of the element
Throws: MatrixDimensionException
If attempting to access an invalid element.
 o setElement
 public void setElement(int i,
                        int j,
                        int x)
Sets the value of an element of the matrix.

Parameters:
i - row index of the element
j - column index of the element
x - an integer
Throws: MatrixDimensionException
If attempting to access an invalid element.
 o infNorm
 public int infNorm()
Returns the l(infinity)-norm.

 o frobeniusNorm
 public double frobeniusNorm()
Returns the Frobenius norm.

 o rows
 public int rows()
Returns the number of rows.

Overrides:
rows in class Matrix
 o columns
 public int columns()
Returns the number of columns.

Overrides:
columns in class Matrix
 o negate
 public AbelianGroupMember negate()
Returns the negative of this matrix.

Overrides:
negate in class Matrix
 o add
 public AbelianGroupMember add(AbelianGroupMember m)
Returns the addition of this matrix and another.

Overrides:
add in class Matrix
 o add
 public IntegerMatrix add(IntegerMatrix m)
Returns the addition of this matrix and another.

Parameters:
m - an integer matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
 o subtract
 public AbelianGroupMember subtract(AbelianGroupMember m)
Returns the subtraction of this matrix by another.

Overrides:
subtract in class Matrix
 o subtract
 public IntegerMatrix subtract(IntegerMatrix m)
Returns the subtraction of this matrix by another.

Parameters:
m - an integer matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
 o scalarMultiply
 public AlgebraMember scalarMultiply(RingMember x)
Returns the multiplication of this matrix by a scalar.

Overrides:
scalarMultiply in class Matrix
 o scalarMultiply
 public IntegerMatrix scalarMultiply(int x)
Returns the multiplication of this matrix by a scalar.

Parameters:
x - an integer
Returns:
an integer matrix
 o multiply
 public IntegerVector multiply(IntegerVector v)
Returns the multiplication of a vector by this matrix.

Parameters:
v - an integer vector
Throws: DimensionException
If the matrix and vector are incompatible.
 o multiply
 public RingMember multiply(RingMember m)
Returns the multiplication of this matrix and another.

Overrides:
multiply in class Matrix
 o multiply
 public IntegerMatrix multiply(IntegerMatrix m)
Returns the multiplication of this matrix and another.

Parameters:
m - an integer matrix
Returns:
an IntegerMatrix or a IntegerSquareMatrix as appropriate
Throws: MatrixDimensionException
If the matrices are incompatible.
 o transpose
 public Matrix transpose()
Returns the transpose of this matrix.

Returns:
an integer matrix
Overrides:
transpose in class Matrix

All Packages  Class Hierarchy  This Package  Previous  Next  Index