All Packages Class Hierarchy This Package Previous Next Index
Class JSci.maths.DoubleDiagonalMatrix
java.lang.Object
|
+----JSci.maths.Matrix
|
+----JSci.maths.DoubleMatrix
|
+----JSci.maths.DoubleSquareMatrix
|
+----JSci.maths.DoubleTridiagonalMatrix
|
+----JSci.maths.DoubleDiagonalMatrix
- public final class DoubleDiagonalMatrix
- extends DoubleTridiagonalMatrix
The DoubleDiagonalMatrix class encapsulates diagonal matrices containing doubles.
Uses compressed diagonal storage.
-
DIAGONAL
- Storage format identifier.
-
storageFormat
-
-
DoubleDiagonalMatrix()
- Constructs a matrix.
-
DoubleDiagonalMatrix(double[])
- Constructs a matrix by wrapping an array containing the diagonal elements.
-
DoubleDiagonalMatrix(double[][])
- Constructs a matrix from an array.
-
DoubleDiagonalMatrix(int)
- Constructs an empty matrix.
-
add(DoubleDiagonalMatrix)
- Returns the addition of this matrix and another.
-
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.
-
det()
- Returns the determinant.
-
equals(Object)
- Compares two double 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.
-
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(DoubleDiagonalMatrix)
- Returns the multiplication of this matrix and another.
-
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(DoubleDiagonalMatrix)
- Returns the subtraction of this matrix by another.
-
subtract(DoubleMatrix)
- Returns the subtraction of this matrix and another.
-
subtract(DoubleSquareMatrix)
- Returns the subtraction of this matrix and 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.
-
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
DoubleDiagonalMatrix
protected DoubleDiagonalMatrix()
- Constructs a matrix.
DoubleDiagonalMatrix
public DoubleDiagonalMatrix(int size)
- Constructs an empty matrix.
- Parameters:
- size - the number of rows/columns
DoubleDiagonalMatrix
public DoubleDiagonalMatrix(double array[][])
- Constructs a matrix from an array.
- Parameters:
- array - an assigned value
- Throws: MatrixDimensionException
- If the array is not square.
DoubleDiagonalMatrix
public DoubleDiagonalMatrix(double array[])
- Constructs a matrix by wrapping an array containing the diagonal elements.
- Parameters:
- array - an assigned value
identity
public static DoubleDiagonalMatrix identity(int size)
- Creates an identity matrix.
- Parameters:
- size - the number of rows/columns
equals
public boolean equals(Object m)
- Compares two double diagonal matrices for equality.
- Parameters:
- m - a double diagonal matrix
- Overrides:
- equals in class DoubleTridiagonalMatrix
toIntegerMatrix
public IntegerMatrix toIntegerMatrix()
- Converts this matrix to an integer matrix.
- Returns:
- an integer diagonal matrix
- Overrides:
- toIntegerMatrix in class DoubleTridiagonalMatrix
toComplexMatrix
public ComplexMatrix toComplexMatrix()
- Converts this matrix to a complex matrix.
- Returns:
- a complex diagonal matrix
- Overrides:
- toComplexMatrix in class DoubleTridiagonalMatrix
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 DoubleTridiagonalMatrix
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 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
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 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 DoubleTridiagonalMatrix
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 DoubleTridiagonalMatrix
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.
- Overrides:
- add in class DoubleTridiagonalMatrix
add
public DoubleDiagonalMatrix add(DoubleDiagonalMatrix m)
- Returns the addition of this matrix and another.
- Parameters:
- m - a double diagonal 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 DoubleTridiagonalMatrix
subtract
public DoubleSquareMatrix subtract(DoubleSquareMatrix m)
- Returns the subtraction of this matrix and another.
- Parameters:
- m - a double square matrix
- Throws: MatrixDimensionException
- If the matrices are different sizes.
- Overrides:
- subtract in class DoubleTridiagonalMatrix
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.
- Overrides:
- subtract in class DoubleTridiagonalMatrix
subtract
public DoubleDiagonalMatrix subtract(DoubleDiagonalMatrix m)
- Returns the subtraction of this matrix by another.
- Parameters:
- m - a double diagonal 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 diagonal matrix
- Overrides:
- scalarMultiply in class DoubleTridiagonalMatrix
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 DoubleTridiagonalMatrix
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 DoubleTridiagonalMatrix
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 DoubleTridiagonalMatrix
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.
- Overrides:
- multiply in class DoubleTridiagonalMatrix
multiply
public DoubleDiagonalMatrix multiply(DoubleDiagonalMatrix m)
- Returns the multiplication of this matrix and another.
- Parameters:
- m - a double diagonal matrix
- Throws: MatrixDimensionException
- If the matrices are different sizes.
inverse
public DoubleSquareMatrix inverse()
- Returns the inverse of this matrix.
- Returns:
- a double diagonal matrix
- Overrides:
- inverse in class DoubleSquareMatrix
transpose
public Matrix transpose()
- Returns the transpose of this matrix.
- Returns:
- a double diagonal matrix
- Overrides:
- transpose in class DoubleTridiagonalMatrix
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 DoubleTridiagonalMatrix
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 DoubleTridiagonalMatrix
mapElements
public DoubleMatrix mapElements(Mapping f)
- Applies a function on all the matrix elements.
- Parameters:
- f - a user-defined function
- Returns:
- a double diagonal matrix
- Overrides:
- mapElements in class DoubleTridiagonalMatrix
All Packages Class Hierarchy This Package Previous Next Index