Example usage for org.apache.commons.math3.linear RealVectorChangingVisitor visit

List of usage examples for org.apache.commons.math3.linear RealVectorChangingVisitor visit

Introduction

In this page you can find the example usage for org.apache.commons.math3.linear RealVectorChangingVisitor visit.

Prototype

double visit(int index, double value);

Source Link

Document

Visit one entry of the vector.

Usage

From source file:com.cloudera.oryx.common.math.SparseRealVector.java

private double doWalk(Iterator<Entry> it, RealVectorChangingVisitor visitor) {
    int dim = getDimension();
    visitor.start(dim, 0, dim - 1);/*  ww  w .  j av  a 2 s  . c om*/
    while (it.hasNext()) {
        Entry e = it.next();
        e.setValue(visitor.visit(e.getIndex(), e.getValue()));
    }
    return visitor.end();
}