public FitDataIterator(ITuple tuple) {
    this.tuple = tuple;

    tuple.start();
    tuple.next();

    valCol = tuple.findColumn("value");
    errCol = tuple.findColumn("error");
    errMinusCol = tuple.findColumn("minusError");

    nVars = tuple.columns() - 3;
    vars = new double[nVars];
  }
 public double[] vars() {
   for (int i = 0; i < nVars; i++) vars[i] = tuple.getDouble(3 + i);
   return vars;
 }
 public double minusError() {
   if (errMinusCol != -1) return tuple.getDouble(errMinusCol);
   return error();
 }
 public double error() {
   if (errCol != -1) return tuple.getDouble(errCol);
   return Double.NaN;
 }
 public double value() {
   if (valCol != -1) return tuple.getDouble(valCol);
   return Double.NaN;
 }
 public void start() {
   tuple.start();
 }
 public boolean next() {
   return tuple.next();
 }
 public int entries() {
   return tuple.rows();
 }