📄 vartab.h
字号:
/*---------------------------------------------------------------------- File : vartab.h Contents: variation table management Author : Christian Borgelt History : 12.09.2000 file created----------------------------------------------------------------------*/#ifndef __VARTAB__#define __VARTAB__#include <float.h>/*---------------------------------------------------------------------- Preprocessor Definitions----------------------------------------------------------------------*/#ifdef VT_EVAL/* --- evaluation measures --- */#define VEM_NONE 0 /* no measure */#define VEM_SSE 1 /* sum of squared errors */#define VEM_MSE 2 /* mean squared error */#define VEM_RMSE 3 /* square root of mean squared error */#define VEM_VAR 4 /* variance (unbiased estimator) */#define VEM_SDEV 5 /* standard deviation (from variance) */#define VEM_UNKNOWN 6 /* unknown evaluation measure *//* --- evaluation flags --- */#define VEF_WGTD 0x8000 /* weight with frac. of known values */#endif/*---------------------------------------------------------------------- Type Definitions----------------------------------------------------------------------*/typedef struct { /* --- variation data --- */ double frq; /* number of cases */ double sum; /* sum of values */ double ssv; /* sum of squared values */ double mean; /* mean value */ double sse; /* sum of squared errors */} VARDATA; /* (variation data) */typedef struct { /* --- variation table --- */ int size; /* size of table (number of colums) */ int cnt; /* current number of columns */ int *dsts; /* destinations of combined columns */ double known; /* number of cases with known values */ double frq; /* total frquency (number of cases) */ double sum; /* sum of values */ double ssv; /* sum of squared values */ double mean; /* mean value */ double sse; /* sum of squared errors */ VARDATA data[1]; /* variation data per column */} VARTAB; /* (variation table) *//*---------------------------------------------------------------------- Functions----------------------------------------------------------------------*/extern VARTAB* vt_create (int size);extern void vt_delete (VARTAB *vtab);extern int vt_init (VARTAB *vtab, int cnt);extern void vt_copy (VARTAB *dst, const VARTAB *src);extern void vt_add (VARTAB *vtab, int x, double y, double frq);extern void vt_calc (VARTAB *vtab);extern void vt_move (VARTAB *vtab, int xsrc, int xdst, double y, double frq);extern void vt_comb (VARTAB *vtab, int xsrc, int xdst);extern void vt_uncomb (VARTAB *vtab, int xsrc);extern int vt_dest (VARTAB *vtab, int x);extern void vt_alldst (VARTAB *vtab, int *dsts);extern int vt_colcnt (VARTAB *vtab);extern double vt_colfrq (VARTAB *vtab, int x);extern double vt_colsum (VARTAB *vtab, int x);extern double vt_colssv (VARTAB *vtab, int x);extern double vt_colmean (VARTAB *vtab, int x);extern double vt_colsse (VARTAB *vtab, int x);extern double vt_frq (VARTAB *vtab);extern double vt_sum (VARTAB *vtab);extern double vt_ssv (VARTAB *vtab);extern double vt_mean (VARTAB *vtab);extern double vt_sse (VARTAB *vtab);extern double vt_known (VARTAB *vtab);#ifdef VT_EVALextern double vt_eval (VARTAB *vtab, int measure, double *params);extern const char* vt_mname (int measure);#endif#ifndef NDEBUGextern void vt_show (VARTAB *vtab);#endif/*---------------------------------------------------------------------- Preprocessor Definitions----------------------------------------------------------------------*/#define vt_colcnt(t) ((t)->cnt)#define vt_colfrq(t,x) ((t)->data[(x)+1].frq)#define vt_colsum(t,x) ((t)->data[(x)+1].sum)#define vt_colssv(t,x) ((t)->data[(x)+1].ssv)#define vt_colmean(t,x) ((t)->data[(x)+1].mean)#define vt_colsse(t,x) ((t)->data[(x)+1].sse)#define vt_frq(t) ((t)->frq)#define vt_sum(t) ((t)->sum)#define vt_ssv(t) ((t)->ssv)#define vt_mean(t) ((t)->mean)#define vt_sse(t) ((t)->sse)#define vt_known(t) ((t)->known)#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -