Go to the documentation of this file.00001
00002 #ifndef osl_OrthogRegress_h_
00003 #define osl_OrthogRegress_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <vcl_cmath.h>
00014 #include <osl/osl_hacks.h>
00015 #include <osl/osl_ortho_regress.h>
00016
00017 class osl_OrthogRegress : public osl_ortho_regress
00018 {
00019 public:
00020 typedef osl_ortho_regress base;
00021 osl_OrthogRegress() { }
00022 osl_OrthogRegress(double, double, double) { }
00023 void IncrByXY(double x, double y) { base::add_point(x, y); }
00024 void DecrByXY(double x, double y) { base::remove_point(x, y); }
00025 void Fit() { base::fit(a_, b_, c_); double r = vcl_sqrt(a_*a_ + b_*b_); a_/=r; b_/=r; c_/=r; }
00026 double GetA() const { return a_; }
00027 double GetB() const { return b_; }
00028 double GetC() const { return c_; }
00029 double GetCost() const { return base::cost(a_, b_, c_); }
00030 double GetEstCost() const { return est_; }
00031 void SetEstCost(double v) { est_ = v; }
00032 void Reset() { base::reset(); }
00033
00034 private:
00035 double a_, b_, c_;
00036 double est_;
00037 };
00038
00039 #endif // osl_OrthogRegress_h_