All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.IntegerTridiagonalMatrix

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

public class IntegerTridiagonalMatrix
extends IntegerSquareMatrix
The IntegerTridiagonalMatrix class provides an object for encapsulating tridiagonal matrices containing integers. Uses compressed diagonal storage.


Variable Index

 o storageFormat
 o TRIDIAGONAL
Storage format identifier.

Constructor Index

 o IntegerTridiagonalMatrix()
Constructs a matrix.
 o IntegerTridiagonalMatrix(int)
Constructs an empty matrix.
 o IntegerTridiagonalMatrix(int[][])
Constructs a matrix from an array.

Method Index

 o add(IntegerMatrix)
Returns the addition of this matrix and another.
 o add(IntegerSquareMatrix)
Returns the addition of this matrix and another.
 o add(IntegerTridiagonalMatrix)
Returns the addition of this matrix and another.
 o choleskyDecompose()
Returns the Cholesky decomposition of this matrix.
 o columns()
Returns the number of columns.
 o equals(Object)
Compares two integer tridiagonal matrices for equality.
 o frobeniusNorm()
Returns the Frobenius norm.
 o getElement(int, int)
Returns an element of the matrix.
 o infNorm()
Returns the l(infinity)-norm.
 o isSymmetric()
Returns true if this matrix is symmetric.
 o luDecompose()
Returns the LU decomposition of this matrix.
 o multiply(IntegerMatrix)
Returns the multiplication of this matrix and another.
 o multiply(IntegerSquareMatrix)
Returns the multiplication of this matrix and another.
 o multiply(IntegerTridiagonalMatrix)
Returns the multiplication of this matrix and another.
 o multiply(IntegerVector)
Returns the multiplication of a vector by this matrix.
 o rows()
Returns the number of rows.
 o scalarMultiply(int)
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(IntegerMatrix)
Returns the subtraction of this matrix and another.
 o subtract(IntegerSquareMatrix)
Returns the subtraction of this matrix by another.
 o subtract(IntegerTridiagonalMatrix)
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 trace()
Returns the trace.
 o transpose()
Returns the transpose of this matrix.

Variables

 o TRIDIAGONAL
 protected static final int TRIDIAGONAL
Storage format identifier.

 o storageFormat
 protected static final int storageFormat

Constructors

 o IntegerTridiagonalMatrix
 protected IntegerTridiagonalMatrix()
Constructs a matrix.

 o IntegerTridiagonalMatrix
 public IntegerTridiagonalMatrix(int size)
Constructs an empty matrix.

Parameters:
size - the number of rows/columns
 o IntegerTridiagonalMatrix
 public IntegerTridiagonalMatrix(int array[][])
Constructs a matrix from an array. Any non-tridiagonal elements in the array are ignored.

Parameters:
array - an assigned value
Throws: MatrixDimensionException
If the array is not square.

Methods

 o equals
 public boolean equals(Object m)
Compares two integer tridiagonal matrices for equality.

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

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

Returns:
a double tridiagonal matrix
Overrides:
toDoubleMatrix in class IntegerMatrix
 o toComplexMatrix
 public ComplexMatrix toComplexMatrix()
Converts this matrix to a complex matrix.

Returns:
a complex tridiagonal matrix
Overrides:
toComplexMatrix in class IntegerMatrix
 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.
Overrides:
getElement in class IntegerMatrix
 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 - a number
Throws: MatrixDimensionException
If attempting to access an invalid element.
Overrides:
setElement in class IntegerMatrix
 o isSymmetric
 public boolean isSymmetric()
Returns true if this matrix is symmetric.

Overrides:
isSymmetric in class IntegerSquareMatrix
 o trace
 public int trace()
Returns the trace.

Overrides:
trace in class IntegerSquareMatrix
 o infNorm
 public int infNorm()
Returns the l(infinity)-norm.

Overrides:
infNorm in class IntegerMatrix
 o frobeniusNorm
 public double frobeniusNorm()
Returns the Frobenius norm.

Overrides:
frobeniusNorm in class IntegerMatrix
 o rows
 public int rows()
Returns the number of rows.

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

Overrides:
columns in class IntegerMatrix
 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.
Overrides:
add in class IntegerSquareMatrix
 o add
 public IntegerSquareMatrix add(IntegerSquareMatrix m)
Returns the addition of this matrix and another.

Parameters:
m - an integer square matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
add in class IntegerSquareMatrix
 o add
 public IntegerTridiagonalMatrix add(IntegerTridiagonalMatrix m)
Returns the addition of this matrix and another.

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

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

Parameters:
m - an integer square matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
subtract in class IntegerSquareMatrix
 o subtract
 public IntegerTridiagonalMatrix subtract(IntegerTridiagonalMatrix m)
Returns the subtraction of this matrix by another.

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

Parameters:
x - an integer
Returns:
an integer tridiagonal matrix
Overrides:
scalarMultiply in class IntegerSquareMatrix
 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.
Overrides:
multiply in class IntegerSquareMatrix
 o multiply
 public IntegerMatrix multiply(IntegerMatrix m)
Returns the multiplication of this matrix and another.

Parameters:
m - an integer matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
multiply in class IntegerSquareMatrix
 o multiply
 public IntegerSquareMatrix multiply(IntegerSquareMatrix m)
Returns the multiplication of this matrix and another.

Parameters:
m - an integer square matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
multiply in class IntegerSquareMatrix
 o multiply
 public IntegerSquareMatrix multiply(IntegerTridiagonalMatrix m)
Returns the multiplication of this matrix and another.

Parameters:
m - an integer tridiagonal matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
 o transpose
 public Matrix transpose()
Returns the transpose of this matrix.

Returns:
an integer tridiagonal matrix
Overrides:
transpose in class IntegerSquareMatrix
 o luDecompose
 public DoubleSquareMatrix[] luDecompose()
Returns the LU decomposition of this matrix.

Returns:
an array with [0] containing the L-matrix and [1] containing the U-matrix.
Overrides:
luDecompose in class IntegerSquareMatrix
 o choleskyDecompose
 public DoubleSquareMatrix[] choleskyDecompose()
Returns the Cholesky decomposition of this matrix. Matrix must be symmetric and positive definite.

Returns:
an array with [0] containing the L-matrix and [1] containing the U-matrix.

All Packages  Class Hierarchy  This Package  Previous  Next  Index