Package com.compomics.util.math.matrix
Class DoubleMatrix
java.lang.Object
com.compomics.util.math.matrix.DoubleMatrix
Implementation of a matrix for double objects. Warning: all indexes start
from 0.
- Author:
- Marc Vaudel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidappendColumns(DoubleMatrix columns) voidappendLines(DoubleMatrix lines) voidcolumnPermutation(int column1, int column2) booleanequals(DoubleMatrix anotherMatrix) getColumn(int columnIndex) doublestatic DoubleMatrixgetIdentityMatrix(int n) getLine(int lineIndex) getLines()intintdoubleReturns a score based on the non-diagonal values.getSubMatrix(int lineStart, int lineStop, int columnStart, int columnStop) doublegetTrace()getValueAt(int lineIndex, int columnIndex) Returns the value of the matrix at given indexes.booleanisSquare()voidlinePermutation(int line1, int line2) voidvoidvoidsetValueAt(int lineIndex, int columnIndex, Double value) static DoubleMatrixtranspose(DoubleMatrix matrix)
-
Constructor Details
-
DoubleMatrix
public DoubleMatrix() -
DoubleMatrix
public DoubleMatrix(int nColumns) -
DoubleMatrix
-
-
Method Details
-
addColumn
-
addLine
-
setLine
-
setColumn
-
getNColumns
public int getNColumns() -
getNLines
public int getNLines() -
isSquare
public boolean isSquare() -
getColumn
-
getColumns
-
getLines
-
getLine
-
getValueAt
Returns the value of the matrix at given indexes. 0 is the first index.- Parameters:
lineIndex- the line indexcolumnIndex- the column index- Returns:
- the value of the matrix at given indexes, 0 is the first index
-
setValueAt
-
transpose
-
equals
-
getIdentityMatrix
-
getTrace
public double getTrace() -
getSubMatrix
-
appendColumns
-
appendLines
-
getDeterminant
public double getDeterminant() -
getNonDiagonalScore
public double getNonDiagonalScore()Returns a score based on the non-diagonal values. Score is 0 for identity, 1 for the (1) matrix.- Returns:
- a score based on the non-diagonal values
-
linePermutation
public void linePermutation(int line1, int line2) -
columnPermutation
public void columnPermutation(int column1, int column2)
-