- Timestamp:
- 10/04/16 18:20:50 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/components/SpectralComponents/SpectralElement.h
r3029 r3106 34 34 #include <casa/Arrays/Vector.h> 35 35 #include <casa/Containers/RecordInterface.h> 36 37 using namespace casacore; 36 38 37 39 namespace casa { //# NAMESPACE CASA - BEGIN … … 105 107 106 108 // Evaluate the value of the element at x 107 virtual Double operator()(constDouble x) const;108 109 Bool operator==(const SpectralElement& other) const;109 virtual casacore::Double operator()(const casacore::Double x) const; 110 111 casacore::Bool operator==(const SpectralElement& other) const; 110 112 111 113 // Get parameter n … … 113 115 // <li> AipsError if illegal n 114 116 // </thrown> 115 virtual Double operator[](const uInt n) const;116 117 // Get all the types available as String and codes, and number available118 static const String* allTypes(Int &nall,117 virtual casacore::Double operator[](const uInt n) const; 118 119 // Get all the types available as casacore::String and codes, and number available 120 static const casacore::String* allTypes(Int &nall, 119 121 const SpectralElement::Types *&typ); 120 122 // Get a string from the type 121 static const String &fromType(SpectralElement::Types tp);122 // Get a type from a (non-case sensitive; minimum match) String123 static Bool toType(SpectralElement::Types &tp,124 const String &typName);123 static const casacore::String &fromType(SpectralElement::Types tp); 124 // Get a type from a (non-case sensitive; minimum match) casacore::String 125 static casacore::Bool toType(SpectralElement::Types &tp, 126 const casacore::String &typName); 125 127 126 128 // Get type of this element … … 128 130 129 131 // Get all parameters 130 void get( Vector<Double>& params) const;131 132 Vector<Double> get() const;132 void get(casacore::Vector<casacore::Double>& params) const; 133 134 casacore::Vector<casacore::Double> get() const; 133 135 134 136 // Get error estimates of parameters 135 void getError( Vector<Double> &err) const;136 Vector<Double> getError() const;137 void getError(casacore::Vector<casacore::Double> &err) const; 138 casacore::Vector<casacore::Double> getError() const; 137 139 138 140 // Get the order (i.e. the number of parameters) … … 140 142 141 143 // Set the error fields 142 virtual void setError(const Vector<Double> &err);144 virtual void setError(const casacore::Vector<casacore::Double> &err); 143 145 144 146 // Set fixed parameters (True) or unset them (False) … … 148 150 149 151 // Fix/unfix all in one go 150 virtual void fix(const Vector<Bool>& fix);152 virtual void fix(const casacore::Vector<casacore::Bool>& fix); 151 153 152 154 // Get the fix state[s] 153 const Vector<Bool> &fixed() const;155 const casacore::Vector<casacore::Bool> &fixed() const; 154 156 155 157 // Save to a record. 156 virtual Bool toRecord(RecordInterface& out) const;158 virtual casacore::Bool toRecord(RecordInterface& out) const; 157 159 158 160 // set parameters 159 virtual void set(const Vector<Double>& params);161 virtual void set(const casacore::Vector<casacore::Double>& params); 160 162 161 163 protected: … … 163 165 SpectralElement() {} 164 166 165 SpectralElement(Types type, const Vector<Double>& parms=Vector<Double>(0));167 SpectralElement(Types type, const casacore::Vector<casacore::Double>& parms=casacore::Vector<casacore::Double>(0)); 166 168 167 169 SpectralElement(const SpectralElement& other); … … 169 171 SpectralElement &operator=(const SpectralElement& other); 170 172 171 void _set(const Vector<Double>& params);173 void _set(const casacore::Vector<casacore::Double>& params); 172 174 173 175 void _setType(const Types type); 174 176 175 void _setFunction(const SHARED_PTR<Function< Double,Double> >& f);176 177 virtual SHARED_PTR<Function< Double,Double> > _getFunction() const {177 void _setFunction(const SHARED_PTR<Function<casacore::Double, casacore::Double> >& f); 178 179 virtual SHARED_PTR<Function<casacore::Double, casacore::Double> > _getFunction() const { 178 180 return _function; 179 181 } … … 186 188 // The parameters of the function. I.e. the polynomial coefficients; 187 189 // amplitude, center and sigma of a Gaussian. 188 Vector<Double> _params;190 casacore::Vector<casacore::Double> _params; 189 191 // The errors of the parameters 190 Vector<Double> _errors;192 casacore::Vector<casacore::Double> _errors; 191 193 // The indication if the parameter has to be fixed (True) or solved (False). 192 194 // Solved is the default. 193 Vector<Bool> _fixed;194 195 SHARED_PTR<Function< Double,Double> > _function;195 casacore::Vector<casacore::Bool> _fixed; 196 197 SHARED_PTR<Function<casacore::Double, casacore::Double> > _function; 196 198 197 199 }; … … 199 201 ostream &operator<<(ostream& os, const SpectralElement& elem); 200 202 201 Bool near(const SpectralElement& s1, const SpectralElement& s2, constDouble tol);202 203 Bool nearAbs(const SpectralElement& s1, const SpectralElement& s2, constDouble tol);203 casacore::Bool near(const SpectralElement& s1, const SpectralElement& s2, const casacore::Double tol); 204 205 casacore::Bool nearAbs(const SpectralElement& s1, const SpectralElement& s2, const casacore::Double tol); 204 206 205 207
Note: See TracChangeset
for help on using the changeset viewer.