Search in sources :

Example 26 with DoubleMatrix2D

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);
}
Also used : DoubleMatrix2D(cern.colt.matrix.tdouble.DoubleMatrix2D)

Example 27 with DoubleMatrix2D

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);
}
Also used : DoubleMatrix2D(cern.colt.matrix.tdouble.DoubleMatrix2D)

Example 28 with DoubleMatrix2D

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;
        }
    });
}
Also used : IntIntDoubleFunction(cern.colt.function.tdouble.IntIntDoubleFunction) DoubleMatrix2D(cern.colt.matrix.tdouble.DoubleMatrix2D)

Example 29 with DoubleMatrix2D

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);
}
Also used : DoubleMatrix2D(cern.colt.matrix.tdouble.DoubleMatrix2D)

Example 30 with DoubleMatrix2D

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;
}
Also used : DoubleMatrix2D(cern.colt.matrix.tdouble.DoubleMatrix2D)

Aggregations

DoubleMatrix2D (cern.colt.matrix.tdouble.DoubleMatrix2D)30 IntIntDoubleFunction (cern.colt.function.tdouble.IntIntDoubleFunction)8 DenseDoubleAlgebra (cern.colt.matrix.tdouble.algo.DenseDoubleAlgebra)5 DoubleArrayList (cern.colt.list.tdouble.DoubleArrayList)3 IntArrayList (cern.colt.list.tint.IntArrayList)3 DoubleMatrix1D (cern.colt.matrix.tdouble.DoubleMatrix1D)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 CyNode (org.cytoscape.model.CyNode)3 DenseDoubleEigenvalueDecomposition (cern.colt.matrix.tdouble.algo.decomposition.DenseDoubleEigenvalueDecomposition)2 NodeCluster (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.NodeCluster)2 DenseDoubleSingularValueDecomposition (cern.colt.matrix.tdouble.algo.decomposition.DenseDoubleSingularValueDecomposition)1 SparseDoubleMatrix2D (cern.colt.matrix.tdouble.impl.SparseDoubleMatrix2D)1 Edges (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.costmatrixcreation.dataTypes.Edges)1 IteratorThread (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.iterativeclustering.IteratorThread)1 List (java.util.List)1 ExecutorService (java.util.concurrent.ExecutorService)1 Semaphore (java.util.concurrent.Semaphore)1 structures._Node (structures._Node)1