Search in sources :

Example 1 with DoubleFunction

use of cern.colt.function.tdouble.DoubleFunction in project clusterMaker2 by RBVI.

the class ColtOps method divideScalarColumn.

/**
 * divide all cells in a column by a value.  This is used
 * primarily for normalization when the current sum
 * of the column is already known.
 * Note: does not update matrix min/max values.
 *
 * @param column the column we're dividing
 * @param value to divide each cell in the column by
 */
public void divideScalarColumn(int column, double value) {
    DoubleMatrix1D col = getData().viewColumn(column);
    col.assign(new DoubleFunction() {

        public double apply(double v) {
            return v / value;
        }
    });
}
Also used : IntIntDoubleFunction(cern.colt.function.tdouble.IntIntDoubleFunction) DoubleFunction(cern.colt.function.tdouble.DoubleFunction) DoubleMatrix1D(cern.colt.matrix.tdouble.DoubleMatrix1D)

Aggregations

DoubleFunction (cern.colt.function.tdouble.DoubleFunction)1 IntIntDoubleFunction (cern.colt.function.tdouble.IntIntDoubleFunction)1 DoubleMatrix1D (cern.colt.matrix.tdouble.DoubleMatrix1D)1