    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class JSci.maths.DoubleSquareMatrix

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

public class DoubleSquareMatrix
extends DoubleMatrix

The DoubleSquareMatrix class provides an object for encapsulating square matrices containing doubles.

##

DoubleSquareMatrix()
  Constructs a matrix.
DoubleSquareMatrix(double[][])
  Constructs a matrix by wrapping an array.
DoubleSquareMatrix(DoubleVector[])
  Constructs a matrix from an array of vectors (columns).
DoubleSquareMatrix(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.
choleskyDecompose()
  Returns the Cholesky decomposition of this matrix.
det()
  Returns the determinant.
inverse()
  Returns the inverse of this matrix.
isSymmetric()
  Returns true if this matrix is symmetric.
isUnitary()
  Returns true if this matrix is unitary.
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(DoubleVector)
  Returns the multiplication of a vector by this matrix.
scalarMultiply(double)
  Returns the multiplication of this matrix by a scalar.
subtract(DoubleMatrix)
  Returns the subtraction of this matrix and another.
subtract(DoubleSquareMatrix)
  Returns the subtraction of this matrix by another.
trace()
  Returns the trace.
transpose()
  Returns the transpose of this matrix.

##

DoubleSquareMatrix

     protected DoubleSquareMatrix()

  Constructs a matrix.

DoubleSquareMatrix

     public DoubleSquareMatrix(int size)

  Constructs an empty matrix.

  Parameters:
    size - the number of rows/columns

DoubleSquareMatrix

     public DoubleSquareMatrix(double array[][])

  Constructs a matrix by wrapping an array.

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

DoubleSquareMatrix

     public DoubleSquareMatrix(DoubleVector array[])

  Constructs a matrix from an array of vectors (columns).

  Parameters:
    array - an assigned value

##

isSymmetric

     public boolean isSymmetric()

  Returns true if this matrix is symmetric.

isUnitary

     public boolean isUnitary()

  Returns true if this matrix is unitary.

det

     public double det()

  Returns the determinant.

trace

     public double trace()

  Returns the trace.

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 DoubleMatrix

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.

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 DoubleMatrix

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.

scalarMultiply

     public DoubleMatrix scalarMultiply(double x)

  Returns the multiplication of this matrix by a scalar.

  Parameters:
    x - a double
  Returns:
    a double square matrix
  Overrides:
    scalarMultiply in class DoubleMatrix

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 DoubleMatrix

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

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 incompatible.

transpose

     public Matrix transpose()

  Returns the transpose of this matrix.

  Returns:
    a double square matrix
  Overrides:
    transpose in class DoubleMatrix

inverse

     public DoubleSquareMatrix inverse()

  Returns the inverse of this matrix.

  Returns:
    a double square matrix

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.

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.

mapElements

     public DoubleMatrix mapElements(Mapping f)

  Applies a function on all the matrix elements.

  Parameters:
    f - a user-defined function
  Returns:
    a double square matrix
  Overrides:
    mapElements in class DoubleMatrix

    All Packages  Class Hierarchy  This Package  Previous  Next  Index