FittingProxy.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef SCIMATH_FITTINGPROXY_H
00029 #define SCIMATH_FITTINGPROXY_H
00030
00031
00032
00033 #include <casacore/casa/aips.h>
00034 #include <casacore/casa/Containers/Record.h>
00035
00036
00037 namespace casacore {
00038 class String;
00039 template<class T> class GenericL2Fit;
00040 template<class T> class Vector;
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 class FittingProxy {
00079
00080 public:
00081
00082 FittingProxy();
00083 virtual ~FittingProxy();
00084
00085 Int getid();
00086 Record getstate(Int id);
00087 Bool init(Int id, Int n, Int tp, Double colfac, Double lmfac);
00088 Bool done(Int id);
00089 Bool reset(Int id);
00090 Bool set(Int id, Int nin, Int tpin, Double colfac, Double lmfac);
00091 Record functional(Int id, const Record& fnc,
00092 const Vector<Double>& xval,
00093 const Vector<Double>& yval,
00094 const Vector<Double>& wt,
00095 Int mxit, const Record& constraint);
00096 Record linear(Int id, const Record& fnc,
00097 const Vector<Double>& xval,
00098 const Vector<Double>& yval,
00099 const Vector<Double>& wt,
00100 const Record& constraint);
00101 Record cxfunctional(Int id, const Record& fnc,
00102 const Vector<DComplex>& xval,
00103 const Vector<DComplex>& yval,
00104 const Vector<DComplex>& wt,
00105 Int mxit, const Record& constraint);
00106 Record cxlinear(Int id, const Record& fnc,
00107 const Vector<DComplex>& xval,
00108 const Vector<DComplex>& yval,
00109 const Vector<DComplex>& wt,
00110 const Record& constraint);
00111
00112 private:
00113
00114 class FitType {
00115 public:
00116
00117
00118 FitType();
00119
00120 ~FitType();
00121
00122
00123
00124 void setFitter (GenericL2Fit<Double> *ptr);
00125 void setFitterCX (GenericL2Fit<DComplex> *ptr);
00126
00127
00128
00129 GenericL2Fit<Double> *const &getFitter() const;
00130 GenericL2Fit<DComplex> *const &getFitterCX() const;
00131
00132
00133 void setStatus(Int n, Int typ, Double colfac, Double lmfac);
00134
00135 Int getNceq() const { return nceq_p;} ;
00136
00137 Int getN() const { return n_p;} ;
00138
00139 Int getNreal() const { return nreal_p;} ;
00140
00141 Int getType() const { return typ_p;} ;
00142
00143 Double getColfac() const { return colfac_p;} ;
00144
00145 Double getLMfac() const { return lmfac_p;} ;
00146
00147 void setSolved(Bool solved);
00148
00149 Bool getSolved() const { return soldone_p;} ;
00150 private:
00151
00152 FitType(const FitType &other);
00153
00154 FitType &operator=(const FitType &other);
00155
00156
00157
00158 casacore::GenericL2Fit<Double> *fitter_p;
00159 casacore::GenericL2Fit<DComplex> *fitterCX_p;
00160
00161
00162 Int n_p;
00163
00164 Int nceq_p;
00165
00166 Int nreal_p;
00167
00168 Int typ_p;
00169
00170 Double colfac_p;
00171
00172 Double lmfac_p;
00173
00174 Bool soldone_p;
00175
00176 uInt nr_p;
00177 };
00178
00179
00180
00181 uInt nFitter_p;
00182
00183 FitType **list_p;
00184 };
00185
00186 }
00187
00188 #endif