Changeset 610 for branches/Release-1-fixes/src
- Timestamp:
- 05/05/05 11:52:56 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Release-1-fixes/src/SDFitter.cc
r517 r610 61 61 delete funcs_[i]; funcs_[i] = 0; 62 62 } 63 funcs_.resize(0,True); 63 64 parameters_.resize(); 64 65 error_.resize(); … … 278 279 NonLinearFitLM<Float> fitter; 279 280 CompoundFunction<Float> func; 280 const uInt n = funcs_.nelements(); 281 282 uInt n = funcs_.nelements(); 281 283 for (uInt i=0; i<n; ++i) { 282 284 func.addFunction(*funcs_[i]); 283 285 } 286 284 287 fitter.setFunction(func); 285 288 fitter.setMaxIter(50+n*10); 286 289 // Convergence criterium 287 290 fitter.setCriteria(0.001); 288 291 289 292 // Fit 290 293 Vector<Float> sigma(x_.nelements()); … … 296 299 parameters_.tovector(ps); 297 300 setParameters(ps); 301 298 302 error_.resize(); 299 303 error_ = fitter.errors(); 300 304 301 305 chisquared_ = fitter.getChi2(); 302 306 … … 304 308 residual_ = y_; 305 309 fitter.residual(residual_,x_); 306 310 307 311 // use fitter.residual(model=True) to get the model 308 312 thefit_.resize(x_.nelements());
Note:
See TracChangeset
for help on using the changeset viewer.