|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectJSci.maths.Matrix
JSci.maths.DoubleMatrix
The DoubleMatrix class provides an object for encapsulating double matrix algebras. Hendrik: -added multiplyInto() method and -made matrix[][] public -changed DoubleVector.getComponent(n) to DoubleVector.vector[n] -added setValueFrom(DoubleVector[]);
| Field Summary | |
protected static int |
ARRAY_2D
Storage format identifier. |
double[][] |
matrix
Array containing the elements of the matrix. |
| Fields inherited from class JSci.maths.Matrix |
CLASS_SPECIFIC, numCols, numRows, storageFormat |
| Constructor Summary | |
|
DoubleMatrix(double[][] array)
Constructs a matrix by wrapping an array. |
|
DoubleMatrix(DoubleVector[] array)
Constructs a matrix from an array of vectors (columns). |
|
DoubleMatrix(int rows,
int cols)
Constructs an empty matrix. |
protected |
DoubleMatrix(int rows,
int cols,
int storeID)
Constructs a matrix. |
| Method Summary | |
JSci.maths.groups.AbelianGroup.Member |
add(JSci.maths.groups.AbelianGroup.Member m)
Returns the addition of this matrix and another. |
DoubleMatrix |
add(DoubleMatrix m)
Returns the addition of this matrix and another. |
DoubleMatrix |
directSum(DoubleMatrix m)
Returns the direct sum of this matrix and another. |
boolean |
equals(java.lang.Object m)
Compares two double matrices for equality. |
protected void |
finalize()
Finalize. |
double |
frobeniusNorm()
Returns the Frobenius (l2) norm. |
double |
getElement(int i,
int j)
Returns an element of the matrix. |
int |
hashCode()
Returns a hashcode for this matrix. |
double |
infNorm()
Returns the l -norm. |
DoubleMatrix |
mapElements(JSci.maths.Mapping f)
Applies a function on all the matrix elements. |
DoubleMatrix |
multiply(DoubleMatrix m)
Returns the multiplication of this matrix and another. |
DoubleVector |
multiply(DoubleVector v)
Returns the multiplication of a vector by this matrix. |
JSci.maths.fields.Ring.Member |
multiply(JSci.maths.fields.Ring.Member m)
Returns the multiplication of this matrix and another. |
void |
multiplyInto(DoubleMatrix m,
DoubleMatrix target)
|
void |
multiplyInto(DoubleVector v,
DoubleVector target)
|
JSci.maths.groups.AbelianGroup.Member |
negate()
Returns the negative of this matrix. |
private DoubleMatrix |
rawAdd(DoubleMatrix m)
|
private DoubleMatrix |
rawMultiply(DoubleMatrix m)
|
private void |
rawMultiplyInto(DoubleMatrix m,
DoubleMatrix target)
|
private double |
rawScalarProduct(DoubleMatrix m)
|
private DoubleMatrix |
rawSubtract(DoubleMatrix m)
|
DoubleMatrix |
scalarDivide(double x)
Returns the division of this matrix by a scalar. |
JSci.maths.algebras.VectorSpace.Member |
scalarDivide(JSci.maths.fields.Field.Member x)
Returns the division of this matrix by a scalar. |
DoubleMatrix |
scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar. |
JSci.maths.algebras.Module.Member |
scalarMultiply(JSci.maths.fields.Ring.Member x)
Returns the multiplication of this matrix by a scalar. |
double |
scalarProduct(DoubleMatrix m)
Returns the scalar product of this matrix and another. |
void |
setElement(int i,
int j,
double x)
Sets the value of an element of the matrix. |
void |
setValueFrom(DoubleVector[] array)
|
JSci.maths.groups.AbelianGroup.Member |
subtract(JSci.maths.groups.AbelianGroup.Member m)
Returns the subtraction of this matrix by another. |
DoubleMatrix |
subtract(DoubleMatrix m)
Returns the subtraction of this matrix by another. |
DoubleMatrix |
tensorProduct(DoubleMatrix m)
Returns the tensor product of this matrix and another. |
JSci.maths.ComplexMatrix |
toComplexMatrix()
Converts this matrix to a complex matrix. |
JSci.maths.IntegerMatrix |
toIntegerMatrix()
Converts this matrix to an integer matrix. |
java.lang.String |
toString()
Returns a string representing this matrix. |
JSci.maths.Matrix |
transpose()
Returns the transpose of this matrix. |
| Methods inherited from class JSci.maths.Matrix |
columns, getInvalidElementMsg, rows |
| Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final int ARRAY_2D
public double[][] matrix
| Constructor Detail |
protected DoubleMatrix(int rows,
int cols,
int storeID)
public DoubleMatrix(int rows,
int cols)
rows - the number of rowscols - the number of columnspublic DoubleMatrix(double[][] array)
array - an assigned valuepublic DoubleMatrix(DoubleVector[] array)
array - an assigned value| Method Detail |
public void setValueFrom(DoubleVector[] array)
protected void finalize()
throws java.lang.Throwable
java.lang.Throwable - Any that occur.public boolean equals(java.lang.Object m)
m - a double matrixpublic java.lang.String toString()
public int hashCode()
public JSci.maths.IntegerMatrix toIntegerMatrix()
public JSci.maths.ComplexMatrix toComplexMatrix()
public double getElement(int i,
int j)
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)
i - row index of the elementj - column index of the elementx - a number
MatrixDimensionException - If attempting to access an invalid element.public double infNorm()
-norm.
public double frobeniusNorm()
public JSci.maths.groups.AbelianGroup.Member negate()
public JSci.maths.groups.AbelianGroup.Member add(JSci.maths.groups.AbelianGroup.Member m)
public DoubleMatrix add(DoubleMatrix m)
m - a double matrix
MatrixDimensionException - If the matrices are different sizes.private DoubleMatrix rawAdd(DoubleMatrix m)
public JSci.maths.groups.AbelianGroup.Member subtract(JSci.maths.groups.AbelianGroup.Member m)
public DoubleMatrix subtract(DoubleMatrix m)
m - a double matrix
MatrixDimensionException - If the matrices are different sizes.private DoubleMatrix rawSubtract(DoubleMatrix m)
public JSci.maths.algebras.Module.Member scalarMultiply(JSci.maths.fields.Ring.Member x)
public DoubleMatrix scalarMultiply(double x)
x - a double.
public JSci.maths.algebras.VectorSpace.Member scalarDivide(JSci.maths.fields.Field.Member x)
public DoubleMatrix scalarDivide(double x)
x - a double.
public double scalarProduct(DoubleMatrix m)
m - a double matrix.
MatrixDimensionException - If the matrices are different sizes.private double rawScalarProduct(DoubleMatrix m)
public DoubleVector multiply(DoubleVector v)
v - a double vector.
DimensionException - If the matrix and vector are incompatible.
public void multiplyInto(DoubleVector v,
DoubleVector target)
public JSci.maths.fields.Ring.Member multiply(JSci.maths.fields.Ring.Member m)
public DoubleMatrix multiply(DoubleMatrix m)
m - a double matrix
MatrixDimensionException - If the matrices are incompatible.private DoubleMatrix rawMultiply(DoubleMatrix m)
public void multiplyInto(DoubleMatrix m,
DoubleMatrix target)
private void rawMultiplyInto(DoubleMatrix m,
DoubleMatrix target)
public DoubleMatrix directSum(DoubleMatrix m)
public DoubleMatrix tensorProduct(DoubleMatrix m)
public JSci.maths.Matrix transpose()
public DoubleMatrix mapElements(JSci.maths.Mapping f)
f - a user-defined function
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||