|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.maths.matrices.Matrix JSci.maths.matrices.AbstractDoubleMatrix JSci.maths.matrices.DoubleMatrix
public class DoubleMatrix
The DoubleMatrix class provides an object for encapsulating double matrices.
Field Summary | |
---|---|
protected double[][] |
matrix
Array containing the elements of the matrix. |
Fields inherited from class JSci.maths.matrices.Matrix |
---|
numCols, numRows |
Constructor Summary | |
---|---|
DoubleMatrix(AbstractDoubleVector[] array)
Constructs a matrix from an array of vectors (columns). |
|
DoubleMatrix(double[][] array)
Constructs a matrix by wrapping an array. |
|
DoubleMatrix(int rows,
int cols)
Constructs an empty matrix. |
Method Summary | |
---|---|
AbstractDoubleMatrix |
add(AbstractDoubleMatrix m)
Returns the addition of this matrix and another. |
AbstractDoubleMatrix |
directSum(AbstractDoubleMatrix m)
Returns the direct sum of this matrix and another. |
boolean |
equals(AbstractDoubleMatrix m,
double tol)
Compares two ${nativeTyp} matrices for equality. |
double |
frobeniusNorm()
Returns the Frobenius or Hilbert-Schmidt (l2) norm. |
double |
getElement(int i,
int j)
Returns an element of the matrix. |
double |
infNorm()
Returns the l-norm. |
AbstractDoubleMatrix |
mapElements(Mapping f)
Applies a function on all the matrix elements. |
AbstractDoubleMatrix |
multiply(AbstractDoubleMatrix m)
Returns the multiplication of this matrix and another. |
AbstractDoubleVector |
multiply(AbstractDoubleVector v)
Returns the multiplication of a vector by this matrix. |
AbstractDoubleMatrix |
multiply(DoubleMatrix m)
|
AbelianGroup.Member |
negate()
Returns the negative of this matrix. |
AbstractDoubleMatrix |
scalarDivide(double x)
Returns the division of this matrix by a scalar. |
AbstractDoubleMatrix |
scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar. |
double |
scalarProduct(AbstractDoubleMatrix m)
Returns the scalar product of this matrix and another. |
double |
scalarProduct(DoubleMatrix m)
|
void |
setElement(int i,
int j,
double x)
Sets the value of an element of the matrix. |
AbstractDoubleMatrix |
subtract(AbstractDoubleMatrix m)
Returns the subtraction of this matrix by another. |
AbstractDoubleMatrix |
tensor(AbstractDoubleMatrix m)
Returns the tensor product of this matrix and another. |
AbstractComplexMatrix |
toComplexMatrix()
Converts this matrix to a complex matrix. |
AbstractIntegerMatrix |
toIntegerMatrix()
Converts this matrix to an integer matrix. |
java.lang.String |
toString()
Returns a string representing this matrix. |
Matrix |
transpose()
Returns the transpose of this matrix. |
Methods inherited from class JSci.maths.matrices.AbstractDoubleMatrix |
---|
add, equals, equals, getSet, hashCode, multiply, scalarDivide, scalarMultiply, subtract |
Methods inherited from class JSci.maths.matrices.Matrix |
---|
columns, getInvalidElementMsg, rows |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final double[][] matrix
Constructor Detail |
---|
public DoubleMatrix(double[][] array)
array
- an assigned valuepublic DoubleMatrix(int rows, int cols)
public DoubleMatrix(AbstractDoubleVector[] array)
array
- an assigned valueMethod Detail |
---|
public boolean equals(AbstractDoubleMatrix m, double tol)
equals
in class AbstractDoubleMatrix
m
- a double matrixpublic java.lang.String toString()
toString
in class AbstractDoubleMatrix
public AbstractIntegerMatrix toIntegerMatrix()
toIntegerMatrix
in class AbstractDoubleMatrix
public AbstractComplexMatrix toComplexMatrix()
toComplexMatrix
in class AbstractDoubleMatrix
public double getElement(int i, int j)
getElement
in class AbstractDoubleMatrix
i
- row index of the elementj
- column index of the element
MatrixDimensionException
- If attempting to access an invalid element.public void setElement(int i, int j, double x)
setElement
in class AbstractDoubleMatrix
i
- row index of the elementj
- column index of the elementx
- a number
MatrixDimensionException
- If attempting to access an invalid element.public double infNorm()
infNorm
in class AbstractDoubleMatrix
public double frobeniusNorm()
frobeniusNorm
in class AbstractDoubleMatrix
public AbelianGroup.Member negate()
negate
in interface AbelianGroup.Member
negate
in class AbstractDoubleMatrix
public AbstractDoubleMatrix add(AbstractDoubleMatrix m)
add
in class AbstractDoubleMatrix
m
- a double matrix
MatrixDimensionException
- If the matrices are different sizes.public AbstractDoubleMatrix subtract(AbstractDoubleMatrix m)
subtract
in class AbstractDoubleMatrix
m
- a double matrix
MatrixDimensionException
- If the matrices are different sizes.public AbstractDoubleMatrix scalarMultiply(double x)
scalarMultiply
in class AbstractDoubleMatrix
x
- a double.
public AbstractDoubleMatrix scalarDivide(double x)
scalarDivide
in class AbstractDoubleMatrix
x
- a double.
public double scalarProduct(AbstractDoubleMatrix m)
scalarProduct
in class AbstractDoubleMatrix
m
- a double matrix.
MatrixDimensionException
- If the matrices are different sizes.public double scalarProduct(DoubleMatrix m)
public AbstractDoubleVector multiply(AbstractDoubleVector v)
multiply
in class AbstractDoubleMatrix
v
- a double vector.
DimensionException
- If the matrix and vector are incompatible.public AbstractDoubleMatrix multiply(AbstractDoubleMatrix m)
multiply
in class AbstractDoubleMatrix
m
- a double matrix
MatrixDimensionException
- If the matrices are incompatible.public AbstractDoubleMatrix multiply(DoubleMatrix m)
public AbstractDoubleMatrix directSum(AbstractDoubleMatrix m)
directSum
in class AbstractDoubleMatrix
public AbstractDoubleMatrix tensor(AbstractDoubleMatrix m)
tensor
in class AbstractDoubleMatrix
public Matrix transpose()
transpose
in class AbstractDoubleMatrix
public AbstractDoubleMatrix mapElements(Mapping f)
mapElements
in class AbstractDoubleMatrix
f
- a user-defined function
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |