    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class JSci.maths.IntegerDiagonalMatrix

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

public final class IntegerDiagonalMatrix
extends IntegerTridiagonalMatrix

The IntegerDiagonalMatrix class provides an object for encapsulating diagonal matrices containing integers. Uses compressed diagonal storage.

##

DIAGONAL
  Storage format identifier.
storageFormat

##

IntegerDiagonalMatrix()
  Constructs a matrix.
IntegerDiagonalMatrix(int)
  Constructs an empty matrix.
IntegerDiagonalMatrix(int[])
  Constructs a matrix by wrapping an array containing the diagonal elements.
IntegerDiagonalMatrix(int[][])
  Constructs a matrix from an array.

##

add(IntegerDiagonalMatrix)
  Returns the addition of this matrix and another.
add(IntegerMatrix)
  Returns the addition of this matrix and another.
add(IntegerSquareMatrix)
  Returns the addition of this matrix and another.
add(IntegerTridiagonalMatrix)
  Returns the addition of this matrix and another.
choleskyDecompose()
  Returns the Cholesky decomposition of this matrix.
columns()
  Returns the number of columns.
det()
  Returns the determinant.
equals(Object)
  Compares two integer diagonal matrices for equality.
frobeniusNorm()
  Returns the Frobenius norm.
getElement(int, int)
  Returns an element of the matrix.
identity(int)
  Creates an identity matrix.
infNorm()
  Returns the l(infinity)-norm.
isSymmetric()
  Returns true if this matrix is symmetric.
isUnitary()
  Returns true if this matrix is unitary.
luDecompose()
  Returns the LU decomposition of this matrix.
multiply(IntegerDiagonalMatrix)
  Returns the multiplication of this matrix and another.
multiply(IntegerMatrix)
  Returns the multiplication of this matrix and another.
multiply(IntegerSquareMatrix)
  Returns the multiplication of this matrix and another.
multiply(IntegerTridiagonalMatrix)
  Returns the multiplication of this matrix and another.
multiply(IntegerVector)
  Returns the multiplication of a vector by this matrix.
rows()
  Returns the number of rows.
scalarMultiply(int)
  Returns the multiplication of this matrix by a scalar.
setElement(int, int, int)
  Sets the value of an element of the matrix.
subtract(IntegerDiagonalMatrix)
  Returns the subtraction of this matrix by another.
subtract(IntegerMatrix)
  Returns the subtraction of this matrix and another.
subtract(IntegerSquareMatrix)
  Returns the subtraction of this matrix and another.
subtract(IntegerTridiagonalMatrix)
  Returns the subtraction of this matrix and another.
toComplexMatrix()
  Converts this matrix to a complex matrix.
toDoubleMatrix()
  Converts this matrix to a double matrix.
trace()
  Returns the trace.
transpose()
  Returns the transpose of this matrix.

##

DIAGONAL

     protected static final int DIAGONAL

  Storage format identifier.

storageFormat

     protected static final int storageFormat

##

IntegerDiagonalMatrix

     protected IntegerDiagonalMatrix()

  Constructs a matrix.

IntegerDiagonalMatrix

     public IntegerDiagonalMatrix(int size)

  Constructs an empty matrix.

  Parameters:
    size - the number of rows/columns

IntegerDiagonalMatrix

     public IntegerDiagonalMatrix(int array[][])

  Constructs a matrix from an array.

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

IntegerDiagonalMatrix

     public IntegerDiagonalMatrix(int array[])

  Constructs a matrix by wrapping an array containing the diagonal elements.

  Parameters:
    array - an assigned value

##

identity

     public static IntegerDiagonalMatrix identity(int size)

  Creates an identity matrix.

  Parameters:
    size - the number of rows/columns

equals

     public boolean equals(Object m)

  Compares two integer diagonal matrices for equality.

  Parameters:
    m - a integer diagonal matrix
  Overrides:
    equals in class IntegerTridiagonalMatrix

toDoubleMatrix

     public DoubleMatrix toDoubleMatrix()

  Converts this matrix to a double matrix.

  Returns:
    a double diagonal matrix
  Overrides:
    toDoubleMatrix in class IntegerTridiagonalMatrix

toComplexMatrix

     public ComplexMatrix toComplexMatrix()

  Converts this matrix to a complex matrix.

  Returns:
    a complex diagonal matrix
  Overrides:
    toComplexMatrix in class IntegerTridiagonalMatrix

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 IntegerTridiagonalMatrix

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.
  Overrides:
    setElement in class IntegerTridiagonalMatrix

isSymmetric

     public boolean isSymmetric()

  Returns true if this matrix is symmetric.

  Overrides:
    isSymmetric in class IntegerTridiagonalMatrix

isUnitary

     public boolean isUnitary()

  Returns true if this matrix is unitary.

  Overrides:
    isUnitary in class IntegerSquareMatrix

det

     public int det()

  Returns the determinant.

  Overrides:
    det in class IntegerSquareMatrix

trace

     public int trace()

  Returns the trace.

  Overrides:
    trace in class IntegerTridiagonalMatrix

infNorm

     public int infNorm()

  Returns the l(infinity)-norm.

  Overrides:
    infNorm in class IntegerTridiagonalMatrix

frobeniusNorm

     public double frobeniusNorm()

  Returns the Frobenius norm.

  Overrides:
    frobeniusNorm in class IntegerTridiagonalMatrix

rows

     public int rows()

  Returns the number of rows.

  Overrides:
    rows in class IntegerTridiagonalMatrix

columns

     public int columns()

  Returns the number of columns.

  Overrides:
    columns in class IntegerTridiagonalMatrix

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 IntegerTridiagonalMatrix

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 IntegerTridiagonalMatrix

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.
  Overrides:
    add in class IntegerTridiagonalMatrix

add

     public IntegerDiagonalMatrix add(IntegerDiagonalMatrix m)

  Returns the addition of this matrix and another.

  Parameters:
    m - an integer diagonal matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.

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 IntegerTridiagonalMatrix

subtract

     public IntegerSquareMatrix subtract(IntegerSquareMatrix m)

  Returns the subtraction of this matrix and another.

  Parameters:
    m - an integer square matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.
  Overrides:
    subtract in class IntegerTridiagonalMatrix

subtract

     public IntegerTridiagonalMatrix subtract(IntegerTridiagonalMatrix m)

  Returns the subtraction of this matrix and another.

  Parameters:
    m - an integer tridiagonal matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.
  Overrides:
    subtract in class IntegerTridiagonalMatrix

subtract

     public IntegerDiagonalMatrix subtract(IntegerDiagonalMatrix m)

  Returns the subtraction of this matrix by another.

  Parameters:
    m - an integer diagonal matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.

scalarMultiply

     public IntegerMatrix scalarMultiply(int x)

  Returns the multiplication of this matrix by a scalar.

  Parameters:
    x - an integer
  Returns:
    an integer diagonal matrix
  Overrides:
    scalarMultiply in class IntegerTridiagonalMatrix

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 IntegerTridiagonalMatrix

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 IntegerTridiagonalMatrix

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 IntegerTridiagonalMatrix

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.
  Overrides:
    multiply in class IntegerTridiagonalMatrix

multiply

     public IntegerDiagonalMatrix multiply(IntegerDiagonalMatrix m)

  Returns the multiplication of this matrix and another.

  Parameters:
    m - an integer diagonal matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.

transpose

     public Matrix transpose()

  Returns the transpose of this matrix.

  Returns:
    an integer diagonal matrix
  Overrides:
    transpose in class IntegerTridiagonalMatrix

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 IntegerTridiagonalMatrix

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.
  Overrides:
    choleskyDecompose in class IntegerTridiagonalMatrix

    All Packages  Class Hierarchy  This Package  Previous  Next  Index