00001 #ifndef STAT2_H
00002 #define STAT2_H
00003
00004
00005
00013
00014
00015
00016
00017 #include <stdio.h>
00018 #include <stdlib.h>
00019 #include <math.h>
00020
00021
00022
00023 #ifdef __cplusplus
00024 namespace RazorBack {
00025 #endif
00026
00031 typedef struct
00032 {
00033 double Sx, Sx2, Min, Max;
00034 unsigned long N;
00035 }
00036 Statrec_ ;
00037
00042 typedef struct
00043 {
00044 double Sx, Sy, Sx2, Sy2, Sxy, Minx, Maxx, Miny, Maxy;
00045 unsigned long N;
00046 }
00047 Stat2rec_ ;
00048
00049
00050
00055 typedef enum {STAT_NOOP=0, STAT_AVG, STAT_SD, STAT_MIN, STAT_MAX} Statops_;
00056
00061 typedef enum {STAT2_NOOP=0, STAT2_AVGX, STAT2_SDX, STAT2_MINX, STAT2_MAXX,
00062 STAT2_AVGY, STAT2_SDY, STAT2_MINY, STAT2_MAXY, STAT2_CORR} Stat2ops_;
00063
00064
00065
00066 #ifdef __cplusplus
00067 extern "C" {
00068 #endif
00069
00070
00071
00076 void init_stat(Statrec_ *St);
00077
00082 void add_stat(double X, Statrec_ *St);
00083
00088 double eval_stat(const Statrec_ *St, Statops_ Op);
00089
00090
00091
00096 void init_stat2(Stat2rec_ *St);
00097
00102 void add_stat2(double X, double Y, Stat2rec_ *St);
00103
00109 double eval_stat2(const Stat2rec_ *St, Stat2ops_ Op);
00110
00111 #ifdef __cplusplus
00112 } }
00113 #endif
00114
00115
00116 #endif