Changeset 1779 for branches/mergetest/src/STFitter.cpp
- Timestamp:
- 07/29/10 19:13:46 (14 years ago)
- Location:
- branches/mergetest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mergetest
- Property svn:mergeinfo changed
-
branches/mergetest/src/STFitter.cpp
r1391 r1779 32 32 #include <casa/Arrays/ArrayMath.h> 33 33 #include <casa/Arrays/ArrayLogical.h> 34 #include <casa/Logging/LogIO.h> 34 35 #include <scimath/Fitting.h> 35 36 #include <scimath/Fitting/LinearFit.h> … … 37 38 #include <scimath/Functionals/CompoundFunction.h> 38 39 #include <scimath/Functionals/Gaussian1D.h> 40 #include "Lorentzian1D.h" 39 41 #include <scimath/Functionals/Polynomial.h> 40 42 #include <scimath/Mathematics/AutoDiff.h> … … 146 148 funcs_.resize(1); 147 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 } 148 156 } else { 149 cerr << " compiled functions not yet implemented" << endl; 157 //cerr << " compiled functions not yet implemented" << endl; 158 LogIO os( LogOrigin( "Fitter", "setExpression()", WHERE ) ) ; 159 os << LogIO::WARN << " compiled functions not yet implemented" << LogIO::POST; 150 160 //funcs_.resize(1); 151 161 //funcs_[0] = new CompiledFunction<Float>(); … … 227 237 (funcs_[0]->parameters())[i] = tmppar[i]; 228 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 } 229 248 } 230 249 // reset … … 260 279 funcs_[0]->mask(i) = !fixed[i]; 261 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 } 262 290 } 263 291 return true;
Note:
See TracChangeset
for help on using the changeset viewer.