Changeset 1706 for branches/alma
- Timestamp:
- 02/18/10 21:53:16 (15 years ago)
- Location:
- branches/alma/src
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/Lorentzian1D.h
r1700 r1706 33 33 #include "Lorentzian1DParam.h" 34 34 #include <scimath/Functionals/Function1D.h> 35 //#include <scimath/Mathematics/AutoDiff.h>36 //#include <scimath/Mathematics/AutoDiffMath.h>35 #include <scimath/Mathematics/AutoDiff.h> 36 #include <scimath/Mathematics/AutoDiffMath.h> 37 37 38 38 namespace casa { //# NAMESPACE CASA - BEGIN … … 176 176 // <group> 177 177 virtual Function<T> *clone() const { return new Lorentzian1D<T>(*this); }; 178 //virtual Function<typename FunctionTraits<T>::DiffType> *cloneAD() const {179 //return new Lorentzian1D<typename FunctionTraits<T>::DiffType>(*this); };180 //virtual Function<typename FunctionTraits<T>::BaseType> *cloneNonAD() const {181 //return new Lorentzian1D<typename FunctionTraits<T>::BaseType>(*this); };178 virtual Function<typename FunctionTraits<T>::DiffType> *cloneAD() const { 179 return new Lorentzian1D<typename FunctionTraits<T>::DiffType>(*this); }; 180 virtual Function<typename FunctionTraits<T>::BaseType> *cloneNonAD() const { 181 return new Lorentzian1D<typename FunctionTraits<T>::BaseType>(*this); }; 182 182 // </group> 183 183 … … 193 193 194 194 195 //#define Lorentzian1D_PS Lorentzian1D196 // 197 // //<summary> Partial specialization of Lorentzian1D for <src>AutoDiff</src>198 // //</summary>199 // 200 // //<synopsis>201 // //<note role=warning> The name <src>Lorentzian1D_PS</src> is only for cxx2html202 // //documentation problems. Use <src>Lorentzian1D</src> in your code.</note>203 // //</synopsis>204 // 205 //template <class T> class Lorentzian1D_PS<AutoDiff<T> > :206 //public Lorentzian1DParam<AutoDiff<T> >207 //{208 //public:209 ////# Constructors210 //// Constructs one dimensional Lorentzians.211 //// <group>212 //Lorentzian1D_PS() : Lorentzian1DParam<AutoDiff<T> >() {};213 //explicit Lorentzian1D_PS(const AutoDiff<T> &height) :214 //Lorentzian1DParam<AutoDiff<T> >(height) {};215 //Lorentzian1D_PS(const AutoDiff<T> &height, const AutoDiff<T> ¢er) :216 //Lorentzian1DParam<AutoDiff<T> >(height, center) {};217 //Lorentzian1D_PS(const AutoDiff<T> &height, const AutoDiff<T> ¢er,218 //const AutoDiff<T> &width) :219 //Lorentzian1DParam<AutoDiff<T> >(height, center, width) {};220 //// </group>221 // 222 //// Copy constructor (deep copy)223 //// <group>224 //Lorentzian1D_PS(const Lorentzian1D_PS &other) :225 //Lorentzian1DParam<AutoDiff<T> >(other) {};226 //template <class W>227 //Lorentzian1D_PS(const Lorentzian1D_PS<W> &other) :228 //Lorentzian1DParam<AutoDiff<T> >(other) {};229 //// </group>230 // 231 //// Copy assignment (deep copy)232 //Lorentzian1D_PS<AutoDiff<T> > &233 //operator=(const Lorentzian1D_PS<AutoDiff<T> > &other) {234 //Lorentzian1DParam<AutoDiff<T> >::operator=(other); return *this; };235 //236 //// Destructor237 //virtual ~Lorentzian1D_PS() {};238 // 239 ////# Operators240 //// Evaluate the Lorentzian and its derivatives at <src>x</src>.241 //// <group>242 //virtual AutoDiff<T> eval(typename Function<AutoDiff<T> >::FunctionArg x) const;243 //// </group>244 // 245 ////# Member functions246 //// Return a copy of this object from the heap. The caller is responsible247 //// for deleting this pointer.248 //// <group>249 //virtual Function<AutoDiff<T> > *clone() const {250 //return new Lorentzian1D<AutoDiff<T> >(*this); };251 //virtual Function<typename FunctionTraits<AutoDiff<T> >::DiffType>252 //*cloneAD() const {253 //return new Lorentzian1D<typename FunctionTraits<AutoDiff<T> >::DiffType>254 //(*this); };255 //virtual Function<typename FunctionTraits<AutoDiff<T> >::BaseType>256 //*cloneNonAD() const {257 //return new Lorentzian1D<typename FunctionTraits<AutoDiff<T> >::BaseType>258 //(*this); };259 //// </group>260 // 261 ////# Make members of parent classes known.262 //protected:263 //using Lorentzian1DParam<AutoDiff<T> >::param_p;264 //public:265 //using Lorentzian1DParam<AutoDiff<T> >::HEIGHT;266 //using Lorentzian1DParam<AutoDiff<T> >::CENTER;267 //using Lorentzian1DParam<AutoDiff<T> >::WIDTH;268 //using Lorentzian1DParam<AutoDiff<T> >::fwhm2int;269 //};270 // 271 //#undef Lorentzian1D_PS195 #define Lorentzian1D_PS Lorentzian1D 196 197 // <summary> Partial specialization of Lorentzian1D for <src>AutoDiff</src> 198 // </summary> 199 200 // <synopsis> 201 // <note role=warning> The name <src>Lorentzian1D_PS</src> is only for cxx2html 202 // documentation problems. Use <src>Lorentzian1D</src> in your code.</note> 203 // </synopsis> 204 205 template <class T> class Lorentzian1D_PS<AutoDiff<T> > : 206 public Lorentzian1DParam<AutoDiff<T> > 207 { 208 public: 209 //# Constructors 210 // Constructs one dimensional Lorentzians. 211 // <group> 212 Lorentzian1D_PS() : Lorentzian1DParam<AutoDiff<T> >() {}; 213 explicit Lorentzian1D_PS(const AutoDiff<T> &height) : 214 Lorentzian1DParam<AutoDiff<T> >(height) {}; 215 Lorentzian1D_PS(const AutoDiff<T> &height, const AutoDiff<T> ¢er) : 216 Lorentzian1DParam<AutoDiff<T> >(height, center) {}; 217 Lorentzian1D_PS(const AutoDiff<T> &height, const AutoDiff<T> ¢er, 218 const AutoDiff<T> &width) : 219 Lorentzian1DParam<AutoDiff<T> >(height, center, width) {}; 220 // </group> 221 222 // Copy constructor (deep copy) 223 // <group> 224 Lorentzian1D_PS(const Lorentzian1D_PS &other) : 225 Lorentzian1DParam<AutoDiff<T> >(other) {}; 226 template <class W> 227 Lorentzian1D_PS(const Lorentzian1D_PS<W> &other) : 228 Lorentzian1DParam<AutoDiff<T> >(other) {}; 229 // </group> 230 231 // Copy assignment (deep copy) 232 Lorentzian1D_PS<AutoDiff<T> > & 233 operator=(const Lorentzian1D_PS<AutoDiff<T> > &other) { 234 Lorentzian1DParam<AutoDiff<T> >::operator=(other); return *this; }; 235 236 // Destructor 237 virtual ~Lorentzian1D_PS() {}; 238 239 //# Operators 240 // Evaluate the Lorentzian and its derivatives at <src>x</src>. 241 // <group> 242 virtual AutoDiff<T> eval(typename Function<AutoDiff<T> >::FunctionArg x) const; 243 // </group> 244 245 //# Member functions 246 // Return a copy of this object from the heap. The caller is responsible 247 // for deleting this pointer. 248 // <group> 249 virtual Function<AutoDiff<T> > *clone() const { 250 return new Lorentzian1D<AutoDiff<T> >(*this); }; 251 virtual Function<typename FunctionTraits<AutoDiff<T> >::DiffType> 252 *cloneAD() const { 253 return new Lorentzian1D<typename FunctionTraits<AutoDiff<T> >::DiffType> 254 (*this); }; 255 virtual Function<typename FunctionTraits<AutoDiff<T> >::BaseType> 256 *cloneNonAD() const { 257 return new Lorentzian1D<typename FunctionTraits<AutoDiff<T> >::BaseType> 258 (*this); }; 259 // </group> 260 261 //# Make members of parent classes known. 262 protected: 263 using Lorentzian1DParam<AutoDiff<T> >::param_p; 264 public: 265 using Lorentzian1DParam<AutoDiff<T> >::HEIGHT; 266 using Lorentzian1DParam<AutoDiff<T> >::CENTER; 267 using Lorentzian1DParam<AutoDiff<T> >::WIDTH; 268 using Lorentzian1DParam<AutoDiff<T> >::fwhm2int; 269 }; 270 271 #undef Lorentzian1D_PS 272 272 273 273 … … 276 276 #ifndef CASACORE_NO_AUTO_TEMPLATES 277 277 #include "Lorentzian1D.tcc" 278 #include "Lorentzian1D2.tcc" 278 279 #endif //# CASACORE_NO_AUTO_TEMPLATES 279 280 #endif -
branches/alma/src/Lorentzian1DParam.h
r1700 r1706 161 161 //# Member functions 162 162 // Give name of function 163 virtual const String &name() const { static String x(" gaussian1d");163 virtual const String &name() const { static String x("lorentzian1d"); 164 164 return x; }; 165 165 -
branches/alma/src/Scantable.cpp
r1703 r1706 708 708 Vector<Float> spcs = specCol_(i); 709 709 Vector<uChar> flgs = flagsCol_(i); 710 if (spcs.nelements() != nchan()) { 710 uInt nchannel = nchan(); 711 if (spcs.nelements() != nchannel) { 711 712 throw(AipsError("Data has incorrect number of channels")); 712 713 } … … 716 717 } 717 718 if (clipoutside) { 718 for (uInt j = 0; j < nchan (); ++j) {719 for (uInt j = 0; j < nchannel; ++j) { 719 720 Float spc = spcs(j); 720 721 if ((spc >= uthres) || (spc <= dthres)) { … … 723 724 } 724 725 } else { 725 for (uInt j = 0; j < nchan (); ++j) {726 for (uInt j = 0; j < nchannel; ++j) { 726 727 Float spc = spcs(j); 727 728 if ((spc < uthres) && (spc > dthres)) {
Note:
See TracChangeset
for help on using the changeset viewer.