Changeset 1700 for branches/alma/src/STFitter.cpp
- Timestamp:
- 02/16/10 16:21:26 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/STFitter.cpp
r1616 r1700 38 38 #include <scimath/Functionals/CompoundFunction.h> 39 39 #include <scimath/Functionals/Gaussian1D.h> 40 #include "Lorentzian1D.h" 40 41 #include <scimath/Functionals/Polynomial.h> 41 42 #include <scimath/Mathematics/AutoDiff.h> … … 147 148 funcs_.resize(1); 148 149 funcs_[0] = new Polynomial<Float>(ncomp); 150 } else if (expr == "lorentz") { 151 if (ncomp < 1) throw (AipsError("Need at least one lorentzian to fit.")); 152 funcs_.resize(ncomp); 153 for (Int k=0; k<ncomp; ++k) { 154 funcs_[k] = new Lorentzian1D<Float>(); 155 } 149 156 } else { 150 157 //cerr << " compiled functions not yet implemented" << endl; … … 230 237 (funcs_[0]->parameters())[i] = tmppar[i]; 231 238 } 239 } else if (dynamic_cast<Lorentzian1D<Float>* >(funcs_[0]) != 0) { 240 uInt count = 0; 241 for (uInt j=0; j < funcs_.nelements(); ++j) { 242 for (uInt i=0; i < funcs_[j]->nparameters(); ++i) { 243 (funcs_[j]->parameters())[i] = tmppar[count]; 244 parameters_[count] = tmppar[count]; 245 ++count; 246 } 247 } 232 248 } 233 249 // reset … … 263 279 funcs_[0]->mask(i) = !fixed[i]; 264 280 } 281 } else if (dynamic_cast<Lorentzian1D<Float>* >(funcs_[0]) != 0) { 282 uInt count = 0; 283 for (uInt j=0; j < funcs_.nelements(); ++j) { 284 for (uInt i=0; i < funcs_[j]->nparameters(); ++i) { 285 funcs_[j]->mask(i) = !fixed[count]; 286 fixedpar_[count] = fixed[count]; 287 ++count; 288 } 289 } 265 290 } 266 291 return true;
Note: See TracChangeset
for help on using the changeset viewer.