use of cern.colt.matrix.tdouble.DoubleMatrix2D in project clusterMaker2 by RBVI.
the class ColtOps method correlation.
public Matrix correlation() {
DoubleMatrix2D data = DoubleFactory2D.dense.make(getData().toArray());
DoubleMatrix2D matrix2D = DoubleStatistic.covariance(data);
matrix2D = DoubleStatistic.correlation(matrix2D);
return matrix.copyDataFromMatrix(matrix2D);
}
use of cern.colt.matrix.tdouble.DoubleMatrix2D in project clusterMaker2 by RBVI.
the class ColtOps method covariance.
public Matrix covariance() {
// We want a dense matrix for this
DoubleMatrix2D data = DoubleFactory2D.dense.make(getData().toArray());
DoubleMatrix2D matrix2D = DoubleStatistic.covariance(data);
return matrix.copyDataFromMatrix(matrix2D);
}
use of cern.colt.matrix.tdouble.DoubleMatrix2D in project clusterMaker2 by RBVI.
the class ColtOps method subtractScalar.
/**
* subtract a value from all cells in the matrix
*
* @param value to subtract from each cell
*/
public void subtractScalar(double value) {
DoubleMatrix2D data = getData();
data.forEachNonZero(new IntIntDoubleFunction() {
public double apply(int row, int column, double v) {
return v - value;
}
});
}
use of cern.colt.matrix.tdouble.DoubleMatrix2D in project clusterMaker2 by RBVI.
the class SimpleOps method correlation.
public Matrix correlation() {
DoubleMatrix2D matrix2D = DoubleStatistic.covariance(getColtMatrix());
matrix2D = DoubleStatistic.correlation(matrix2D);
return matrix.copyDataFromMatrix(matrix2D);
}
use of cern.colt.matrix.tdouble.DoubleMatrix2D in project clusterMaker2 by RBVI.
the class SimpleOps method getColtMatrix.
public DoubleMatrix2D getColtMatrix() {
DoubleMatrix2D mat = DoubleFactory2D.dense.make(matrix.nRows(), matrix.nColumns());
mat.assign(matrix.toArray());
return mat;
}
Aggregations