ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/linregr.h
Revision: 2.2
Committed: Fri Oct 2 15:56:12 1992 UTC (31 years, 7 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.1: +0 -2 lines
Log Message:
Removed problematic math function declarations

File Contents

# Content
1 /* Copyright (c) 1991 Regents of the University of California */
2
3 /* SCCSid "$SunId$ LBL" */
4
5 /*
6 * Header file for linear regression calculation.
7 */
8
9 typedef struct {
10 double xs, ys, xxs, yys, xys;
11 int n;
12 } LRSUM;
13
14 typedef struct {
15 double slope, intercept, correlation;
16 } LRLIN;
17
18 #define lrpoint(x,y,l) ((l)->xs+=(x),(l)->ys+=(y),(l)->xxs+=(x)*(x), \
19 (l)->yys+=(y)*(y),(l)->xys+=(x)*(y),++(l)->n)
20
21 #define lrxavg(l) ((l)->xs/(l)->n)
22 #define lryavg(l) ((l)->ys/(l)->n)
23 #define lrxvar(l) (((l)->xxs-(l)->xs*(l)->xs/(l)->n)/(l)->n)
24 #define lryvar(l) (((l)->yys-(l)->ys*(l)->ys/(l)->n)/(l)->n)
25 #define lrxdev(l) sqrt(((l)->xxs-(l)->xs*(l)->xs/(l)->n)/((l)->n-1))
26 #define lrydev(l) sqrt(((l)->yys-(l)->ys*(l)->ys/(l)->n)/((l)->n-1))