Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.hartmath.util
Class DoubleDiagonalMatrix  view DoubleDiagonalMatrix download DoubleDiagonalMatrix.java

java.lang.Object
  extended bycom.hartmath.util.Matrix
      extended bycom.hartmath.util.DoubleMatrix
          extended bycom.hartmath.util.DoubleSquareMatrix
              extended bycom.hartmath.util.DoubleTridiagonalMatrix
                  extended bycom.hartmath.util.DoubleDiagonalMatrix

public final class DoubleDiagonalMatrix
extends DoubleTridiagonalMatrix

The DoubleDiagonalMatrix class encapsulates diagonal matrices containing doubles.

Version:
2.0

Field Summary
 
Fields inherited from class com.hartmath.util.DoubleMatrix
matrix
 
Constructor Summary
protected DoubleDiagonalMatrix()
          Constructs a matrix.
  DoubleDiagonalMatrix(double[] array)
          Constructs a matrix by wrapping an array containing the diagonal elements.
  DoubleDiagonalMatrix(double[][] array)
          Constructs a matrix from an array.
  DoubleDiagonalMatrix(int size)
          Constructs an empty matrix.
 
Method Summary
 DoubleDiagonalMatrix add(DoubleDiagonalMatrix m)
          Returns the addition of this matrix and another.
 DoubleMatrix add(DoubleMatrix m)
          Returns the addition of this matrix and another.
 DoubleSquareMatrix add(DoubleSquareMatrix m)
          Returns the addition of this matrix and another.
 DoubleTridiagonalMatrix add(DoubleTridiagonalMatrix m)
          Returns the addition of this matrix and another.
 Matrix add(Matrix m)
          Returns the addition of this matrix and another.
 DoubleSquareMatrix[] choleskyDecompose()
          Returns the Cholesky decomposition of this matrix.
 int columns()
          Returns the number of columns.
 double det()
          Returns the determinant.
 boolean equals(java.lang.Object m)
          Compares two double diagonal matrices for equality.
 double frobeniusNorm()
          Returns the Frobenius norm.
 double getElement(int i, int j)
          Returns an element of the matrix.
static DoubleDiagonalMatrix identity(int size)
          Creates an identity matrix.
 double infNorm()
          Returns the l(infinity)-norm.
 DoubleSquareMatrix inverse()
          Returns the inverse of this matrix.
 boolean isSymmetric()
          Returns true if this matrix is symmetric.
 boolean isUnitary()
          Returns true if this matrix is unitary.
 DoubleSquareMatrix[] luDecompose()
          Returns the LU decomposition of this matrix.
 DoubleMatrix mapElements(com.hartmath.mapping.HUnaryNumerical f)
          Applies a function on all the matrix elements.
 DoubleDiagonalMatrix multiply(DoubleDiagonalMatrix m)
          Returns the multiplication of this matrix and another.
 DoubleMatrix multiply(DoubleMatrix m)
          Returns the multiplication of this matrix and another.
 DoubleSquareMatrix multiply(DoubleSquareMatrix m)
          Returns the multiplication of this matrix and another.
 DoubleSquareMatrix multiply(DoubleTridiagonalMatrix m)
          Returns the multiplication of this matrix and another.
 DoubleVector multiply(DoubleVector v)
          Returns the multiplication of a vector by this matrix.
 Matrix multiply(Matrix m)
          Returns the multiplication of this matrix and another.
private  DoubleMatrix rawAdd(DoubleMatrix m)
          Description of the Method
private  DoubleSquareMatrix rawAdd(DoubleSquareMatrix m)
          Description of the Method
private  DoubleTridiagonalMatrix rawAdd(DoubleTridiagonalMatrix m)
          Description of the Method
private  DoubleMatrix rawMultiply(DoubleMatrix m)
          Description of the Method
private  DoubleSquareMatrix rawMultiply(DoubleSquareMatrix m)
          Description of the Method
private  DoubleSquareMatrix rawMultiply(DoubleTridiagonalMatrix m)
          Description of the Method
private  DoubleMatrix rawSubtract(DoubleMatrix m)
          Description of the Method
private  DoubleSquareMatrix rawSubtract(DoubleSquareMatrix m)
          Description of the Method
private  DoubleTridiagonalMatrix rawSubtract(DoubleTridiagonalMatrix m)
          Description of the Method
 int rows()
          Returns the number of rows.
 DoubleMatrix scalarMultiply(double x)
          Returns the multiplication of this matrix by a scalar.
 void setElement(int i, int j, double x)
          Sets the value of an element of the matrix.
 DoubleDiagonalMatrix subtract(DoubleDiagonalMatrix m)
          Returns the subtraction of this matrix by another.
 DoubleMatrix subtract(DoubleMatrix m)
          Returns the subtraction of this matrix and another.
 DoubleSquareMatrix subtract(DoubleSquareMatrix m)
          Returns the subtraction of this matrix and another.
 DoubleTridiagonalMatrix subtract(DoubleTridiagonalMatrix m)
          Returns the subtraction of this matrix and another.
 Matrix subtract(Matrix m)
          Returns the subtraction of this matrix by another.
 ComplexMatrix toComplexMatrix()
          Converts this matrix to an integer matrix.
 double trace()
          Returns the trace.
 Matrix transpose()
          Returns the transpose of this matrix.
 
Methods inherited from class com.hartmath.util.DoubleTridiagonalMatrix
toString
 
Methods inherited from class com.hartmath.util.DoubleMatrix
finalize, hashCode, toFunction
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleDiagonalMatrix

public DoubleDiagonalMatrix(int size)
Constructs an empty matrix.


DoubleDiagonalMatrix

public DoubleDiagonalMatrix(double[][] array)
Constructs a matrix from an array.


DoubleDiagonalMatrix

public DoubleDiagonalMatrix(double[] array)
Constructs a matrix by wrapping an array containing the diagonal elements.


DoubleDiagonalMatrix

protected DoubleDiagonalMatrix()
Constructs a matrix.

Method Detail

setElement

public void setElement(int i,
                       int j,
                       double x)
Sets the value of an element of the matrix.

Overrides:
setElement in class DoubleTridiagonalMatrix

getElement

public double getElement(int i,
                         int j)
Returns an element of the matrix.

Overrides:
getElement in class DoubleTridiagonalMatrix

isSymmetric

public boolean isSymmetric()
Returns true if this matrix is symmetric.

Overrides:
isSymmetric in class DoubleTridiagonalMatrix

isUnitary

public boolean isUnitary()
Returns true if this matrix is unitary.

Overrides:
isUnitary in class DoubleSquareMatrix

equals

public boolean equals(java.lang.Object m)
Compares two double diagonal matrices for equality.

Overrides:
equals in class DoubleTridiagonalMatrix

toComplexMatrix

public ComplexMatrix toComplexMatrix()
Converts this matrix to an integer matrix. Converts this matrix to a complex matrix.

Overrides:
toComplexMatrix in class DoubleTridiagonalMatrix

det

public double det()
Returns the determinant.

Overrides:
det in class DoubleSquareMatrix

trace

public double trace()
Returns the trace.

Overrides:
trace in class DoubleTridiagonalMatrix

infNorm

public double infNorm()
Returns the l(infinity)-norm.

Overrides:
infNorm in class DoubleTridiagonalMatrix

frobeniusNorm

public double frobeniusNorm()
Returns the Frobenius norm.

Overrides:
frobeniusNorm in class DoubleTridiagonalMatrix

rows

public int rows()
Returns the number of rows.

Overrides:
rows in class DoubleTridiagonalMatrix

columns

public int columns()
Returns the number of columns.

Overrides:
columns in class DoubleTridiagonalMatrix

add

public Matrix add(Matrix m)
Returns the addition of this matrix and another.

Overrides:
add in class DoubleTridiagonalMatrix

add

public DoubleMatrix add(DoubleMatrix m)
Returns the addition of this matrix and another.

Overrides:
add in class DoubleTridiagonalMatrix

add

public DoubleSquareMatrix add(DoubleSquareMatrix m)
Returns the addition of this matrix and another.

Overrides:
add in class DoubleTridiagonalMatrix

add

public DoubleTridiagonalMatrix add(DoubleTridiagonalMatrix m)
Returns the addition of this matrix and another.

Overrides:
add in class DoubleTridiagonalMatrix

add

public DoubleDiagonalMatrix add(DoubleDiagonalMatrix m)
Returns the addition of this matrix and another.


subtract

public Matrix subtract(Matrix m)
Returns the subtraction of this matrix by another.

Overrides:
subtract in class DoubleTridiagonalMatrix

subtract

public DoubleMatrix subtract(DoubleMatrix m)
Returns the subtraction of this matrix and another.

Overrides:
subtract in class DoubleTridiagonalMatrix

subtract

public DoubleSquareMatrix subtract(DoubleSquareMatrix m)
Returns the subtraction of this matrix and another.

Overrides:
subtract in class DoubleTridiagonalMatrix

subtract

public DoubleTridiagonalMatrix subtract(DoubleTridiagonalMatrix m)
Returns the subtraction of this matrix and another.

Overrides:
subtract in class DoubleTridiagonalMatrix

subtract

public DoubleDiagonalMatrix subtract(DoubleDiagonalMatrix m)
Returns the subtraction of this matrix by another.


scalarMultiply

public DoubleMatrix scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar.

Overrides:
scalarMultiply in class DoubleTridiagonalMatrix

multiply

public DoubleVector multiply(DoubleVector v)
Returns the multiplication of a vector by this matrix.

Overrides:
multiply in class DoubleTridiagonalMatrix

multiply

public Matrix multiply(Matrix m)
Returns the multiplication of this matrix and another.

Overrides:
multiply in class DoubleTridiagonalMatrix

multiply

public DoubleMatrix multiply(DoubleMatrix m)
Returns the multiplication of this matrix and another.

Overrides:
multiply in class DoubleTridiagonalMatrix

multiply

public DoubleSquareMatrix multiply(DoubleSquareMatrix m)
Returns the multiplication of this matrix and another.

Overrides:
multiply in class DoubleTridiagonalMatrix

multiply

public DoubleSquareMatrix multiply(DoubleTridiagonalMatrix m)
Returns the multiplication of this matrix and another.

Overrides:
multiply in class DoubleTridiagonalMatrix

multiply

public DoubleDiagonalMatrix multiply(DoubleDiagonalMatrix m)
Returns the multiplication of this matrix and another.


inverse

public DoubleSquareMatrix inverse()
Returns the inverse of this matrix.

Overrides:
inverse in class DoubleSquareMatrix

transpose

public Matrix transpose()
Returns the transpose of this matrix.

Overrides:
transpose in class DoubleTridiagonalMatrix

luDecompose

public DoubleSquareMatrix[] luDecompose()
Returns the LU decomposition of this matrix.

Overrides:
luDecompose in class DoubleTridiagonalMatrix

choleskyDecompose

public DoubleSquareMatrix[] choleskyDecompose()
Returns the Cholesky decomposition of this matrix. Matrix must be symmetric and positive definite.

Overrides:
choleskyDecompose in class DoubleTridiagonalMatrix

mapElements

public DoubleMatrix mapElements(com.hartmath.mapping.HUnaryNumerical f)
Applies a function on all the matrix elements.

Overrides:
mapElements in class DoubleTridiagonalMatrix

rawAdd

private DoubleMatrix rawAdd(DoubleMatrix m)
Description of the Method


rawAdd

private DoubleSquareMatrix rawAdd(DoubleSquareMatrix m)
Description of the Method


rawAdd

private DoubleTridiagonalMatrix rawAdd(DoubleTridiagonalMatrix m)
Description of the Method


rawSubtract

private DoubleMatrix rawSubtract(DoubleMatrix m)
Description of the Method


rawSubtract

private DoubleSquareMatrix rawSubtract(DoubleSquareMatrix m)
Description of the Method


rawSubtract

private DoubleTridiagonalMatrix rawSubtract(DoubleTridiagonalMatrix m)
Description of the Method


rawMultiply

private DoubleMatrix rawMultiply(DoubleMatrix m)
Description of the Method


rawMultiply

private DoubleSquareMatrix rawMultiply(DoubleSquareMatrix m)
Description of the Method


rawMultiply

private DoubleSquareMatrix rawMultiply(DoubleTridiagonalMatrix m)
Description of the Method


identity

public static DoubleDiagonalMatrix identity(int size)
Creates an identity matrix.