--- ray/src/common/linregr.h 1991/11/12 16:55:45 2.1 +++ ray/src/common/linregr.h 2003/06/06 16:38:47 2.5 @@ -1,11 +1,15 @@ -/* Copyright (c) 1991 Regents of the University of California */ - -/* SCCSid "$SunId$ LBL" */ - +/* RCSid $Id: linregr.h,v 2.5 2003/06/06 16:38:47 schorsch Exp $ */ /* * Header file for linear regression calculation. */ +#ifndef _RAD_LINEGR_H_ +#define _RAD_LINEGR_H_ +#ifdef __cplusplus +extern "C" { +#endif +#include "copyright.h" + typedef struct { double xs, ys, xxs, yys, xys; int n; @@ -15,8 +19,6 @@ typedef struct { double slope, intercept, correlation; } LRLIN; -extern double sqrt(); - #define lrpoint(x,y,l) ((l)->xs+=(x),(l)->ys+=(y),(l)->xxs+=(x)*(x), \ (l)->yys+=(y)*(y),(l)->xys+=(x)*(y),++(l)->n) @@ -26,3 +28,15 @@ extern double sqrt(); #define lryvar(l) (((l)->yys-(l)->ys*(l)->ys/(l)->n)/(l)->n) #define lrxdev(l) sqrt(((l)->xxs-(l)->xs*(l)->xs/(l)->n)/((l)->n-1)) #define lrydev(l) sqrt(((l)->yys-(l)->ys*(l)->ys/(l)->n)/((l)->n-1)) + + +extern void lrclear(LRSUM *l); +extern int flrpoint(double x, double y, LRSUM *l); +extern int lrfit(LRLIN *r, LRSUM *l); + + +#ifdef __cplusplus +} +#endif +#endif /* _RAD_LINEGR_H_ */ +