Package org.openscience.cdk.math
Class Matrix
java.lang.Object
org.openscience.cdk.math.Matrix
This class contains a matrix.
- Author:
- Stephan Michels <stephan@vern.chem.tu-berlin.de>
- Source code:
- main
- Belongs to CDK module:
- qm
- Created on:
- 2001-06-07
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds two matrices.double
diagonalize
(int maxNumRot) Diagonalize this matrix with the Jacobi algorithm.Copies a matrix.static Vector
elimination
(Matrix matrix, Vector vector) Solves a linear equation system with Gauss elimination.int
Returns the number of columns.int
getRows()
Returns the number of rows.getVectorFromColumn
(int index) Creates a Vector with the content of a column from this Matrix.Creates a Vector with the content of the diagonal elements from this Matrix.getVectorFromRow
(int index) Creates a Vector with the content of a row from this Matrix.mul
(double a) Multiplies a scalar with this Matrix.Multiplies this Matrix with another one.Multiplies a Vector with this Matrix.Normalizes the vectors of this matrix.Orthonormalize the vectors of this matrix by Gram-Schmidt.Similar transformation Ut * M * USubtracts from two matrices.toString()
Return a matrix as a String.Transposes a matrix.
-
Field Details
-
matrix
public final double[][] matrixthe content of this matrix -
rows
public final int rowsthe number of rows of this matrix -
columns
public int columnsthe number of columns of this matrix
-
-
Constructor Details
-
Matrix
public Matrix(int rows, int columns) Creates a new Matrix. -
Matrix
public Matrix(double[][] array) Creates a Matrix with content of an array.
-
-
Method Details
-
getRows
public int getRows()Returns the number of rows. -
getColumns
public int getColumns()Returns the number of columns. -
getVectorFromRow
Creates a Vector with the content of a row from this Matrix. -
getVectorFromColumn
Creates a Vector with the content of a column from this Matrix. -
getVectorFromDiagonal
Creates a Vector with the content of the diagonal elements from this Matrix. -
add
Adds two matrices. -
sub
Subtracts from two matrices. -
mul
Multiplies this Matrix with another one. -
mul
Multiplies a Vector with this Matrix. -
mul
Multiplies a scalar with this Matrix. -
duplicate
Copies a matrix. -
transpose
Transposes a matrix. -
similar
Similar transformation Ut * M * U -
contraction
public double contraction() -
toString
Return a matrix as a String. -
diagonalize
Diagonalize this matrix with the Jacobi algorithm.- Parameters:
maxNumRot
- Count of max. rotations- Returns:
- Matrix m, with m^t * this * m = diagonal
- Keywords:
- Jacobi algorithm, diagonalization
-
elimination
Solves a linear equation system with Gauss elimination.- Keywords:
- Gauss elimination
-
orthonormalize
Orthonormalize the vectors of this matrix by Gram-Schmidt.- Keywords:
- orthonormalization, Gram-Schmidt algorithm
-
normalize
Normalizes the vectors of this matrix.
-