All Packages Class Hierarchy This Package Previous Next Index
Class JSci.maths.DoubleMatrix
java.lang.Object
|
+----JSci.maths.Matrix
|
+----JSci.maths.DoubleMatrix
- public class DoubleMatrix
- extends Matrix
The DoubleMatrix class provides an object for encapsulating double matrix algebra.
-
ARRAY_2D
- Storage format identifier.
-
matrix
- Array containing the elements of the matrix.
-
storageFormat
-
-
DoubleMatrix()
- Constructs a matrix.
-
DoubleMatrix(double[][])
- Constructs a matrix by wrapping an array.
-
DoubleMatrix(DoubleVector[])
- Constructs a matrix from an array of vectors (columns).
-
DoubleMatrix(int, int)
- Constructs an empty matrix.
-
add(AbelianGroupMember)
- Returns the addition of this matrix and another.
-
add(DoubleMatrix)
- Returns the addition of this matrix and another.
-
columns()
- Returns the number of columns.
-
equals(Object)
- Compares two double matrices for equality.
-
finalize()
- Finalize.
-
frobeniusNorm()
- Returns the Frobenius norm.
-
getElement(int, int)
- Returns an element of the matrix.
-
hashCode()
- Returns a hashcode for this matrix.
-
infNorm()
- Returns the l(infinity)-norm.
-
mapElements(Mapping)
- Applies a function on all the matrix elements.
-
multiply(DoubleMatrix)
- Returns the multiplication of this matrix and another.
-
multiply(DoubleVector)
- Returns the multiplication of a vector by this matrix.
-
multiply(RingMember)
- Returns the multiplication of this matrix and another.
-
negate()
- Returns the negative of this matrix.
-
rows()
- Returns the number of rows.
-
scalarMultiply(double)
- Returns the multiplication of this matrix by a scalar.
-
scalarMultiply(RingMember)
- Returns the multiplication of this matrix by a scalar.
-
setElement(int, int, double)
- Sets the value of an element of the matrix.
-
subtract(AbelianGroupMember)
- Returns the subtraction of this matrix by another.
-
subtract(DoubleMatrix)
- Returns the subtraction of this matrix by another.
-
toComplexMatrix()
- Converts this matrix to a complex matrix.
-
toIntegerMatrix()
- Converts this matrix to an integer matrix.
-
toString()
- Returns a string representing this matrix.
-
transpose()
- Returns the transpose of this matrix.
ARRAY_2D
protected static final int ARRAY_2D
- Storage format identifier.
storageFormat
protected static final int storageFormat
matrix
protected double matrix[][]
- Array containing the elements of the matrix.
DoubleMatrix
protected DoubleMatrix()
- Constructs a matrix.
DoubleMatrix
public DoubleMatrix(int row,
int col)
- Constructs an empty matrix.
- Parameters:
- row - the number of rows
- col - the number of columns
DoubleMatrix
public DoubleMatrix(double array[][])
- Constructs a matrix by wrapping an array.
- Parameters:
- array - an assigned value
DoubleMatrix
public DoubleMatrix(DoubleVector array[])
- Constructs a matrix from an array of vectors (columns).
- Parameters:
- array - an assigned value
finalize
protected void finalize() throws Throwable
- Finalize.
- Throws: Throwable
- Any that occur.
- Overrides:
- finalize in class Object
equals
public boolean equals(Object m)
- Compares two double matrices for equality.
- Parameters:
- m - a double matrix
- Overrides:
- equals in class Object
toString
public String toString()
- Returns a string representing this matrix.
- Overrides:
- toString in class Object
hashCode
public int hashCode()
- Returns a hashcode for this matrix.
- Overrides:
- hashCode in class Object
toIntegerMatrix
public IntegerMatrix toIntegerMatrix()
- Converts this matrix to an integer matrix.
- Returns:
- an integer matrix
toComplexMatrix
public ComplexMatrix toComplexMatrix()
- Converts this matrix to a complex matrix.
- Returns:
- a complex matrix
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.
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.
infNorm
public double infNorm()
- Returns the l(infinity)-norm.
frobeniusNorm
public double frobeniusNorm()
- Returns the Frobenius norm.
rows
public int rows()
- Returns the number of rows.
- Overrides:
- rows in class Matrix
columns
public int columns()
- Returns the number of columns.
- Overrides:
- columns in class Matrix
negate
public AbelianGroupMember negate()
- Returns the negative of this matrix.
- Overrides:
- negate in class Matrix
add
public AbelianGroupMember add(AbelianGroupMember m)
- Returns the addition of this matrix and another.
- Overrides:
- add in class Matrix
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.
subtract
public AbelianGroupMember subtract(AbelianGroupMember m)
- Returns the subtraction of this matrix by another.
- Overrides:
- subtract in class Matrix
subtract
public DoubleMatrix subtract(DoubleMatrix m)
- Returns the subtraction of this matrix by another.
- Parameters:
- m - a double matrix
- Throws: MatrixDimensionException
- If the matrices are different sizes.
scalarMultiply
public AlgebraMember scalarMultiply(RingMember x)
- Returns the multiplication of this matrix by a scalar.
- Overrides:
- scalarMultiply in class Matrix
scalarMultiply
public DoubleMatrix scalarMultiply(double x)
- Returns the multiplication of this matrix by a scalar.
- Parameters:
- x - a double
- Returns:
- a double matrix
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.
multiply
public RingMember multiply(RingMember m)
- Returns the multiplication of this matrix and another.
- Overrides:
- multiply in class Matrix
multiply
public DoubleMatrix multiply(DoubleMatrix m)
- Returns the multiplication of this matrix and another.
- Parameters:
- m - a double matrix
- Returns:
- a DoubleMatrix or a DoubleSquareMatrix as appropriate
- Throws: MatrixDimensionException
- If the matrices are incompatible.
transpose
public Matrix transpose()
- Returns the transpose of this matrix.
- Returns:
- a double matrix
- Overrides:
- transpose in class Matrix
mapElements
public DoubleMatrix mapElements(Mapping f)
- Applies a function on all the matrix elements.
- Parameters:
- f - a user-defined function
- Returns:
- a double matrix
All Packages Class Hierarchy This Package Previous Next Index