contrib/oxl/osl/osl_OrthogRegress.h
Go to the documentation of this file.
00001 // This is oxl/osl/osl_OrthogRegress.h
00002 #ifndef osl_OrthogRegress_h_
00003 #define osl_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 <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) { } // FIXME
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_