Ignore:
Timestamp:
05/05/05 11:52:56 (20 years ago)
Author:
mar637
Message:

Fix for asap0017

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Release-1-fixes/src/SDFitter.cc

    r517 r610  
    6161    delete funcs_[i]; funcs_[i] = 0;
    6262  }
     63  funcs_.resize(0,True);
    6364  parameters_.resize();
    6465  error_.resize();
     
    278279  NonLinearFitLM<Float> fitter;
    279280  CompoundFunction<Float> func;
    280   const uInt n = funcs_.nelements();
     281
     282  uInt n = funcs_.nelements();
    281283  for (uInt i=0; i<n; ++i) {
    282284    func.addFunction(*funcs_[i]);
    283285  }
     286
    284287  fitter.setFunction(func);
    285288  fitter.setMaxIter(50+n*10);
    286289  // Convergence criterium
    287290  fitter.setCriteria(0.001);
    288  
     291
    289292  // Fit
    290293  Vector<Float> sigma(x_.nelements());
     
    296299  parameters_.tovector(ps);
    297300  setParameters(ps);
     301
    298302  error_.resize();
    299303  error_ = fitter.errors();
    300  
     304
    301305  chisquared_ = fitter.getChi2();
    302306 
     
    304308  residual_ =  y_;
    305309  fitter.residual(residual_,x_);
    306  
     310
    307311  // use fitter.residual(model=True) to get the model
    308312  thefit_.resize(x_.nelements());
Note: See TracChangeset for help on using the changeset viewer.