    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class JSci.maths.DoubleTridiagonalMatrix

    java.lang.Object
       |
       +----JSci.maths.Matrix
               |
               +----JSci.maths.DoubleMatrix
                       |
                       +----JSci.maths.DoubleSquareMatrix
                               |
                               +----JSci.maths.DoubleTridiagonalMatrix

public class DoubleTridiagonalMatrix
extends DoubleSquareMatrix

The DoubleTridiagonalMatrix class provides an object for encapsulating tridiagonal matrices containing doubles. Uses compressed diagonal storage.

##

storageFormat
TRIDIAGONAL
  Storage format identifier.

##

DoubleTridiagonalMatrix()
  Constructs a matrix.
DoubleTridiagonalMatrix(double[][])
  Constructs a matrix from an array.
DoubleTridiagonalMatrix(int)
  Constructs an empty matrix.

##

add(DoubleMatrix)
  Returns the addition of this matrix and another.
add(DoubleSquareMatrix)
  Returns the addition of this matrix and another.
add(DoubleTridiagonalMatrix)
  Returns the addition of this matrix and another.
choleskyDecompose()
  Returns the Cholesky decomposition of this matrix.
columns()
  Returns the number of columns.
equals(Object)
  Compares two double tridiagonal matrices for equality.
frobeniusNorm()
  Returns the Frobenius norm.
getElement(int, int)
  Returns an element of the matrix.
infNorm()
  Returns the l(infinity)-norm.
isSymmetric()
  Returns true if this matrix is symmetric.
luDecompose()
  Returns the LU decomposition of this matrix.
mapElements(Mapping)
  Applies a function on all the matrix elements.
multiply(DoubleMatrix)
  Returns the multiplication of this matrix and another.
multiply(DoubleSquareMatrix)
  Returns the multiplication of this matrix and another.
multiply(DoubleTridiagonalMatrix)
  Returns the multiplication of this matrix and another.
multiply(DoubleVector)
  Returns the multiplication of a vector by this matrix.
rows()
  Returns the number of rows.
scalarMultiply(double)
  Returns the multiplication of this matrix by a scalar.
setElement(int, int, double)
  Sets the value of an element of the matrix.
subtract(DoubleMatrix)
  Returns the subtraction of this matrix and another.
subtract(DoubleSquareMatrix)
  Returns the subtraction of this matrix by another.
subtract(DoubleTridiagonalMatrix)
  Returns the subtraction of this matrix and another.
toComplexMatrix()
  Converts this matrix to a complex matrix.
toIntegerMatrix()
  Converts this matrix to an integer matrix.
toString()
  Returns a string representing this matrix.
trace()
  Returns the trace.
transpose()
  Returns the transpose of this matrix.

##

TRIDIAGONAL

     protected static final int TRIDIAGONAL

  Storage format identifier.

storageFormat

     protected static final int storageFormat

##

DoubleTridiagonalMatrix

     protected DoubleTridiagonalMatrix()

  Constructs a matrix.

DoubleTridiagonalMatrix

     public DoubleTridiagonalMatrix(int size)

  Constructs an empty matrix.

  Parameters:
    size - the number of rows/columns

DoubleTridiagonalMatrix

     public DoubleTridiagonalMatrix(double 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.

##

equals

     public boolean equals(Object m)

  Compares two double tridiagonal matrices for equality.

  Parameters:
    m - a double tridiagonal matrix
  Overrides:
    equals in class DoubleMatrix

toString

     public String toString()

  Returns a string representing this matrix.

  Overrides:
    toString in class DoubleMatrix

toIntegerMatrix

     public IntegerMatrix toIntegerMatrix()

  Converts this matrix to an integer matrix.

  Returns:
    an integer tridiagonal matrix
  Overrides:
    toIntegerMatrix in class DoubleMatrix

toComplexMatrix

     public ComplexMatrix toComplexMatrix()

  Converts this matrix to a complex matrix.

  Returns:
    a complex tridiagonal matrix
  Overrides:
    toComplexMatrix in class DoubleMatrix

getElement

     public double 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 DoubleMatrix

setElement

     public void setElement(int i,
                            int j,
                            double 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 DoubleMatrix

isSymmetric

     public boolean isSymmetric()

  Returns true if this matrix is symmetric.

  Overrides:
    isSymmetric in class DoubleSquareMatrix

trace

     public double trace()

  Returns the trace.

  Overrides:
    trace in class DoubleSquareMatrix

infNorm

     public double infNorm()

  Returns the l(infinity)-norm.

  Overrides:
    infNorm in class DoubleMatrix

frobeniusNorm

     public double frobeniusNorm()

  Returns the Frobenius norm.

  Overrides:
    frobeniusNorm in class DoubleMatrix

rows

     public int rows()

  Returns the number of rows.

  Overrides:
    rows in class DoubleMatrix

columns

     public int columns()

  Returns the number of columns.

  Overrides:
    columns in class DoubleMatrix

add

     public DoubleMatrix add(DoubleMatrix m)

  Returns the addition of this matrix and another.

  Parameters:
    m - a double matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.
  Overrides:
    add in class DoubleSquareMatrix

add

     public DoubleSquareMatrix add(DoubleSquareMatrix m)

  Returns the addition of this matrix and another.

  Parameters:
    m - a double square matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.
  Overrides:
    add in class DoubleSquareMatrix

add

     public DoubleTridiagonalMatrix add(DoubleTridiagonalMatrix m)

  Returns the addition of this matrix and another.

  Parameters:
    m - a double tridiagonal matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.

subtract

     public DoubleMatrix subtract(DoubleMatrix m)

  Returns the subtraction of this matrix and another.

  Parameters:
    m - a double matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.
  Overrides:
    subtract in class DoubleSquareMatrix

subtract

     public DoubleSquareMatrix subtract(DoubleSquareMatrix m)

  Returns the subtraction of this matrix by another.

  Parameters:
    m - a double square matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.
  Overrides:
    subtract in class DoubleSquareMatrix

subtract

     public DoubleTridiagonalMatrix subtract(DoubleTridiagonalMatrix m)

  Returns the subtraction of this matrix and another.

  Parameters:
    m - a double tridiagonal matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.

scalarMultiply

     public DoubleMatrix scalarMultiply(double x)

  Returns the multiplication of this matrix by a scalar.

  Parameters:
    x - a double
  Returns:
    a double tridiagonal matrix
  Overrides:
    scalarMultiply in class DoubleSquareMatrix

multiply

     public DoubleVector multiply(DoubleVector v)

  Returns the multiplication of a vector by this matrix.

  Parameters:
    v - a double vector
  Throws: DimensionException
    If the matrix and vector are incompatible.
  Overrides:
    multiply in class DoubleSquareMatrix

multiply

     public DoubleMatrix multiply(DoubleMatrix m)

  Returns the multiplication of this matrix and another.

  Parameters:
    m - a double matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.
  Overrides:
    multiply in class DoubleSquareMatrix

multiply

     public DoubleSquareMatrix multiply(DoubleSquareMatrix m)

  Returns the multiplication of this matrix and another.

  Parameters:
    m - a double square matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.
  Overrides:
    multiply in class DoubleSquareMatrix

multiply

     public DoubleSquareMatrix multiply(DoubleTridiagonalMatrix m)

  Returns the multiplication of this matrix and another.

  Parameters:
    m - a double tridiagonal matrix
  Throws: MatrixDimensionException
    If the matrices are different sizes.

transpose

     public Matrix transpose()

  Returns the transpose of this matrix.

  Returns:
    a double tridiagonal matrix
  Overrides:
    transpose in class DoubleSquareMatrix

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 DoubleSquareMatrix

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 DoubleSquareMatrix

mapElements

     public DoubleMatrix mapElements(Mapping f)

  Applies a function on all the matrix elements.

  Parameters:
    f - a user-defined function
  Returns:
    a double tridiagonal matrix
  Overrides:
    mapElements in class DoubleSquareMatrix

    All Packages  Class Hierarchy  This Package  Previous  Next  Index