public double dComputeResid() throws Exception {
   // Evaluates residual matrix for parms[].
   // Returns sum-of-squares.
   /** TODO deal with CKSolnList flag, employed in .getModelValues() */
   function =
       new Function(
           ConfigurationInput.experiments.experimentalValues,
           optimization.testNewParameters(optimization.buildFullParamVector(parms), true));
   function =
       new Function(
           ConfigurationInput.experiments.experimentalValues,
           optimization.testNewParameters(optimization.buildFullParamVector(parms), true));
   resid = function.getResid();
   return function.getSRES();
 }
  public NBMTHost(Optimization o) throws Exception {
    this.optimization = o;
    this.parms = optimization.retrieveFittedParameters();

    NPARMS = parms.length;
    NPTS = ConfigurationInput.experiments.total_no_experiments;
    NRESP = ConfigurationInput.experiments.experimentalValues.length;

    // resid = new double[NPTS][NRESP];
    resid = new double[NPTS * NRESP];
    jac = new double[NPTS * NRESP][NPARMS];

    for (int i = 0; i < NPARMS; i++) logger.info("Start parm[" + i + "] = " + parms[i]);

    myLM = new LM_NBMT(this, NPARMS, NPTS, NRESP); // run the minimizer

    for (int i = 0; i < NPARMS; i++) logger.info("End parm[" + i + "]   = " + parms[i]);
  }