00001 #ifndef LSUTIL_H 00002 #define LSUTIL_H 00003 00004 /* 00005 lsutil.h 00006 00007 Least squares best fit utility functions 00008 */ 00009 00010 /* ident tag */ 00011 #ifndef __GNUC__ 00012 #ifndef __attribute__ 00013 #define __attribute__(x) 00014 #endif 00015 #endif 00016 00017 static char __attribute__((unused)) lsutil_h[] = "$Id: lsutil.h,v 1.3 2000/10/27 20:34:42 terrylr Exp $"; 00018 00019 /* 00020 given arrays of points x, y, and number of points n, 00021 computes the least squares best fit line y = a x + b, 00022 putting the coefficients in the passed pointer args. 00023 00024 Returns 0 if OK, -1 if only one point, or a = inf 00025 */ 00026 extern int lsCoeff(double *x, double *y, int n, double *a, double *b); 00027 00028 /* 00029 given arrays of points x, y, number of points n, and the 00030 point d where y must be 0, computes the least squares best 00031 fit line y = a (x - d), putting the coefficient in the passed 00032 pointer arg a. 00033 00034 Returns 0 if OK, -1 if only one point, or a = inf 00035 */ 00036 extern int lsCoeffOD(double *x, double *y, int n, double d, double *a); 00037 00038 #endif /* LSUTIL_H */
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001