contrib/gel/vdgl/vdgl_OrthogRegress.h
Go to the documentation of this file.
00001 // This is gel/vdgl/vdgl_OrthogRegress.h
00002 #ifndef vdgl_OrthogRegress_h_
00003 #define vdgl_OrthogRegress_h_
00004 //:
00005 // \file
00006 // \author fsm
00007 //
00008 // \verbatim
00009 //  Modifications
00010 //   10 Sep. 2004 Peter Vanroose  Inlined all 1-line methods in class decl
00011 // \endverbatim
00012 
00013 #include <vcl_cmath.h>
00014 #include <vdgl/vdgl_ortho_regress.h>
00015 
00016 class vdgl_OrthogRegress : public vdgl_ortho_regress
00017 {
00018   double a_, b_, c_;
00019   double est_;
00020  public:
00021   typedef vdgl_ortho_regress base;
00022   vdgl_OrthogRegress() { }
00023   vdgl_OrthogRegress(double, double, double) { } // FIXME
00024   void IncrByXY(double x, double y) { base::add_point(x, y); }
00025   void DecrByXY(double x, double y) { base::remove_point(x, y); }
00026   void Fit() { base::fit(a_, b_, c_); double r = vcl_sqrt(a_*a_ + b_*b_); a_/=r; b_/=r; c_/=r; }
00027   double GetA() const { return a_; }
00028   double GetB() const { return b_; }
00029   double GetC() const { return c_; }
00030   double GetCost() const { return base::cost(a_, b_, c_); }
00031   double GetEstCost() const { return est_; }
00032   void SetEstCost(double v) { est_ = v; }
00033   void Reset() { base::reset(); }
00034 };
00035 
00036 #endif // vdgl_OrthogRegress_h_