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_LSQAIPS_H
00029 #define SCIMATH_LSQAIPS_H
00030
00031
00032 #include <casacore/casa/aips.h>
00033 #include <casacore/casa/Arrays/Array.h>
00034 #include <casacore/casa/Arrays/Vector.h>
00035 #include <casacore/casa/Arrays/VectorSTLIterator.h>
00036 #include <casacore/scimath/Fitting/LSQFit.h>
00037
00038 namespace casacore {
00039
00040
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
00079
00080
00081
00082
00083 class LSQaips : public LSQFit {
00084 public:
00085
00086
00087
00088
00089
00090
00091
00092 LSQaips(uInt nUnknowns, uInt nConstraints=0)
00093 : LSQFit(nUnknowns, nConstraints) {;}
00094
00095
00096 LSQaips(uInt nUnknowns, const LSQReal &, uInt nConstraints=0)
00097 : LSQFit(nUnknowns, LSQReal(), nConstraints) {;}
00098 LSQaips(uInt nUnknowns, const LSQComplex &, uInt nConstraints=0)
00099 : LSQFit(nUnknowns, LSQComplex(), nConstraints) {;}
00100
00101
00102
00103 LSQaips() : LSQFit() {;}
00104
00105 LSQaips(const LSQaips &other) : LSQFit(other) {;}
00106
00107 LSQaips &operator=(const LSQaips &other) {
00108 if (this != &other) LSQFit::operator=(other);
00109 return *this; }
00110
00111
00112 ~LSQaips() {;}
00113
00114
00115
00116
00117
00118
00119
00120 template <class U>
00121 void solve(U *sol) { LSQFit::solve(sol); }
00122 template <class U>
00123 void solve(std::complex<U> *sol) { LSQFit::solve(sol); }
00124 template <class U>
00125 void solve(U &sol) { LSQFit::solve(sol); }
00126 template <class U>
00127 void solve(Vector<U> &sol) {
00128 sol.resize(nUnknowns()/LSQTraits<U>::size);
00129 LSQFit::solve(sol.data()); }
00130
00131
00132
00133
00134 template <class U>
00135 Bool solveLoop(uInt &nRank,
00136 U *sol, Bool doSVD=False) {
00137 return LSQFit::solveLoop(nRank, sol, doSVD); }
00138 template <class U>
00139 Bool solveLoop(uInt &nRank,
00140 std::complex<U> *sol, Bool doSVD=False) {
00141 return LSQFit::solveLoop(nRank, sol, doSVD); }
00142 template <class U>
00143 Bool solveLoop(uInt &nRank,
00144 U &sol, Bool doSVD=False) {
00145 return LSQFit::solveLoop(nRank, sol, doSVD); }
00146 template <class U>
00147 Bool solveLoop(uInt &nRank,
00148 Vector<U> &sol, Bool doSVD=False);
00149 template <class U>
00150 Bool solveLoop(Double &fit, uInt &nRank,
00151 U *sol, Bool doSVD=False) {
00152 return LSQFit::solveLoop(fit, nRank, sol, doSVD); }
00153 template <class U>
00154 Bool solveLoop(Double &fit, uInt &nRank,
00155 std::complex<U> *sol, Bool doSVD=False) {
00156 return LSQFit::solveLoop(fit, nRank, sol, doSVD); }
00157 template <class U>
00158 Bool solveLoop(Double &fit, uInt &nRank,
00159 U &sol, Bool doSVD=False) {
00160 return LSQFit::solveLoop(fit, nRank, sol, doSVD); }
00161 template <class U>
00162 Bool solveLoop(Double &fit, uInt &nRank,
00163 Vector<U> &sol, Bool doSVD=False);
00164
00165
00166
00167
00168 template <class U>
00169 Bool getCovariance(U *covar) {
00170 return LSQFit::getCovariance(covar); }
00171 template <class U>
00172 Bool getCovariance(std::complex<U> *covar) {
00173 return LSQFit::getCovariance(covar); }
00174 template <class U>
00175 Bool getCovariance(Array<U> &covar);
00176
00177
00178
00179 template <class U>
00180 Bool getErrors(U *errors) {
00181 return LSQFit::getErrors(errors); }
00182 template <class U>
00183 Bool getErrors(std::complex<U> *errors) {
00184 return LSQFit::getErrors(errors); }
00185 template <class U>
00186 Bool getErrors(U &errors) {
00187 return LSQFit::getErrors(errors); }
00188 template <class U>
00189 Bool getErrors(Vector<U> &errors) {
00190 errors.resize(nUnknowns()/LSQTraits<U>::size);
00191 return LSQFit::getErrors(errors.data()); }
00192
00193
00194 private:
00195
00196
00197
00198 };
00199
00200
00201 }
00202
00203 #ifndef CASACORE_NO_AUTO_TEMPLATES
00204 #include <casacore/scimath/Fitting/LSQaips.tcc>
00205 #endif //# CASACORE_NO_AUTO_TEMPLATES
00206 #endif