00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef LINEARLSQ_HEADER
00013 #define LINEARLSQ_HEADER
00014
00015 #include <vector>
00016
00017
00018 #include <clipper/clipper.h>
00019
00020 namespace scala {
00021
00022 class LinearLSQ {
00023 public:
00024 LinearLSQ(){}
00025 LinearLSQ(const int Nparam);
00026
00027 void clear(const int Nparam);
00028
00029
00030
00031
00032
00033
00034
00035 void add(const double& y,
00036 const std::vector<double> x, const double& w);
00037
00038
00039 std::vector<double> solve();
00040
00041 int Nobs() const {return nobs;}
00042
00043 private:
00044 int npar;
00045 clipper::Matrix<double> AA;
00046 std::vector<double> ATy;
00047 int nobs;
00048 };
00049
00050 }
00051
00052 #endif