ccstruct/quadlsq.h

Go to the documentation of this file.
00001 
00020 #ifndef           QUADLSQ_H
00021 #define           QUADLSQ_H
00022 
00023 #include          "points.h"
00024 
00029 class QLSQ
00030 {
00031   public:
00032     QLSQ() {  //constructor
00033       clear();  //set to zeros
00034     }
00035     void clear();  //initialize
00036 
00037     void add(           //add element
00038              double x,  //coords to add
00039              double y);
00040     void remove(           //delete element
00041                 double x,  //coords to delete
00042                 double y);
00043     INT32 count() {  //no of elements
00044       return n;
00045     }
00046 
00047     void fit(              //fit the given
00048              int degree);  //return actual
00049     double get_a() {  //get x squard
00050       return a;
00051     }
00052     double get_b() {  //get x squard
00053       return b;
00054     }
00055     double get_c() {  //get x squard
00056       return c;
00057     }
00058 
00059   private:
00060     INT32 n;                     //no of elements
00061     double a, b, c;              //result
00062     double sigx;                 //sum of x
00063     double sigy;                 //sum of y
00064     double sigxx;                //sum x squared
00065     double sigxy;                //sum of xy
00066     double sigyy;                //sum y squared
00067     long double sigxxx;          //sum x cubed
00068     long double sigxxy;          //sum xsquared y
00069     long double sigxxxx;         //sum x fourth
00070 };
00071 #endif

Generated on Wed Feb 28 19:49:08 2007 for Tesseract by  doxygen 1.5.1