home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / autopsp.zip / REGRESS / LRSET.H < prev    next >
C/C++ Source or Header  |  1994-01-20  |  1KB  |  33 lines

  1. // LRSet
  2. // This object will find the linear regression parameters for a set of
  3. // data.  This data may be added a node at a time or it may be taken from
  4. // a file.  The data must be in correlated and thus in the form (Xi, Yi)
  5.  
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9.  
  10. #include "llist.h"
  11.  
  12.  
  13. class DataPoint                   // Type of data being dealt with
  14. {
  15.   public:
  16.   double x;                       // First point (not necissarily coord)
  17.   double y;                       // Second point.
  18. };
  19.  
  20. class LRSet : public LList        // Linear Regression Set devired from LList.
  21. {                                 //   List hold data points to work with.
  22.   public:
  23.  
  24.   LRSet(void);                    // Initializer.
  25.   void AddList(LList *ReadList);  // Add to this list from another.
  26.   void AddFile(char *filename);   // Add to this list from a file.
  27.   void AddNode(double x, double y);  // Add a node to the list.
  28.  
  29.   void CalcLR(void);              // Calculate the linear regression
  30.  
  31.   double B1;                      // Output area for B1
  32.   double B0;                      // Output area for B0
  33. };