|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.chemistry.quantum.math.matrix.Matrix
public class Matrix
A general NxM real matrix.
| Field Summary | |
|---|---|
protected int |
columnCount
Holds value of property columnCount. |
protected double[][] |
matrix
Holds value of property matrix. |
protected int |
rowCount
Holds value of property rowCount. |
| Constructor Summary | |
|---|---|
Matrix(double[][] a)
Creates a new instance of Matrix, based on already allocated 2D array |
|
Matrix(int n)
Creates a new instance of square (NxN) Matrix |
|
Matrix(int n,
int m)
Creates a new instance of NxM Matrix |
|
| Method Summary | |
|---|---|
Matrix |
add(Matrix b)
Simple matrix addition of two square matrices: this + b |
java.lang.Object |
clone()
clone this vector ;) Cloning is getting interesting! |
int |
getColumnCount()
Getter for property columnCount. |
double[][] |
getMatrix()
Getter for property matrix. |
double |
getMatrixAt(int i,
int j)
Getter for property matrix. |
int |
getRowCount()
Getter for property rowCount. |
void |
makeIdentity()
make the current matrix an identity matrix, all diagonals as 1.0 and non-diagonals zero only sensible if a square matrix |
Matrix |
mul(Matrix b)
Simple matrix multiplication of two matrices: this * b |
double |
rootMeanSquare()
rootMeanSquare() - method to compute the root mean square of elements of a diagonal. |
void |
setColumnCount(int columnCount)
Setter for property columnCount. |
void |
setMatrix(double[][] matrix)
Setter for property matrix. |
void |
setMatrixAt(int i,
int j,
double value)
Getter for property matrix. |
void |
setRowCount(int rowCount)
Setter for property rowCount. |
Matrix |
similarityTransform(Matrix x)
Similarity Transform : XAX' :: x * this * x' |
Matrix |
similarityTransformT(Matrix x)
Similarity Transform : X'AX :: x' * this * x |
double |
sumOffDiagonal()
Absolute sum of off-diagonal elements. |
Matrix |
symmetricOrthogonalization()
Symmetric orthogonalization of the real symmetric matrix X (this). |
java.lang.String |
toString()
overridden toString() |
double |
trace()
Tr(this) = sum(diagonal(this)); Only valid if this a square matrix. |
Matrix |
transpose()
Transpose a real matrix A (A') |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double[][] matrix
protected int rowCount
protected int columnCount
| Constructor Detail |
|---|
public Matrix(int n,
int m)
n - the first dimensionm - the second dimensionpublic Matrix(int n)
n - the dimensionpublic Matrix(double[][] a)
a - the 2D array| Method Detail |
|---|
public Matrix add(Matrix b)
b - the matrix to which to add
public Matrix mul(Matrix b)
b - the matrix to which to multiply
public Matrix transpose()
public double trace()
public Matrix similarityTransform(Matrix x)
XAX' :: x * this * x'
x - the pre multiplier
public Matrix similarityTransformT(Matrix x)
X'AX :: x' * this * x
x - the post multiplier
public Matrix symmetricOrthogonalization()
U'(1/sqrt(lambda))U, where lambda,
U are the eigenvalues/vectors
public void makeIdentity()
public double rootMeanSquare()
sqrt(sum(Aii)).
public double sumOffDiagonal()
public double[][] getMatrix()
public double getMatrixAt(int i,
int j)
i - index ij - index j
public void setMatrix(double[][] matrix)
matrix - New value of property matrix.
public void setMatrixAt(int i,
int j,
double value)
i - index ij - index jvalue - the new valuepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.lang.Objectpublic int getRowCount()
public void setRowCount(int rowCount)
rowCount - New value of property rowCount.public int getColumnCount()
public void setColumnCount(int columnCount)
columnCount - New value of property columnCount.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||