亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nstats.c

?? 數據挖掘中的關聯規則算法
?? C
字號:
/*----------------------------------------------------------------------  File    : nstats.c  Contents: management of normalization statistics  Author  : Christian Borgelt  History : 12.08.2003 file created            12.08.2004 description and parse function added----------------------------------------------------------------------*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <float.h>#include <math.h>#include <assert.h>#include "nstats.h"/*----------------------------------------------------------------------  Preprocessor Definitions----------------------------------------------------------------------*/#define BLKSIZE   64            /* block size for parsing *//*----------------------------------------------------------------------  Functions----------------------------------------------------------------------*/NSTATS* nst_create (int dim){                               /* --- create numerical statistics */  NSTATS *nst;                  /* created statistics structure */  double *p;                    /* to organize the memory */  assert(dim > 0);              /* check the function argument */  nst = (NSTATS*)malloc(sizeof(NSTATS) +(6*dim -1) *sizeof(double));  if (!nst) return NULL;        /* create a statistics structure */  nst->dim  = dim;              /* and initialize the fields */  nst->reg  = 0;  nst->offs = p = nst->facs +dim;  nst->mins = p += dim;  nst->maxs = p += dim;         /* organize the vectors */  nst->sums = p += dim;  nst->sqrs = p += dim;  while (--dim >= 0) {          /* traverse the vectors */    nst->mins[dim] = DBL_MAX; nst->maxs[dim] = -DBL_MAX;    nst->sums[dim] = nst->sqrs[dim] = nst->offs[dim] = 0;    nst->facs[dim] = 1;         /* initialize the ranges of values */  }                             /* and the aggregation variables */  return nst;                   /* return created structure */}  /* nst_create() *//*--------------------------------------------------------------------*/void nst_delete (NSTATS *nst){ free(nst); }                  /* --- delete numerical statistics *//*--------------------------------------------------------------------*/void nst_reg (NSTATS *nst, const double *vec, double weight){                               /* --- register a data vector */  int    i;                     /* loop variable */  double *min, *max;            /* to traverse the min./max. values */  double *sum, *sqr;            /* to traverse the value sums */  double *off, *fac;            /* to traverse the offsets/scales */  double t;                     /* temporary buffer */  assert(nst && vec);           /* check the function arguments */  sum = nst->sums;              /* get the vectors for the sums */  sqr = nst->sqrs;              /* and the sums of squares */  if (!vec) {                   /* if to terminate registration */    off = nst->offs;            /* get the offsets and */    fac = nst->facs;            /* the scaling factors */    if (nst->reg <= 0)          /* if no patterns are registered */      for (i = nst->dim; --i >= 0; ) { off[i] = 0; fac[i] = 1; }    else {                      /* if patterns have been registered */      for (i = nst->dim; --i >= 0; ) {      /* traverse the vectors */        off[i] = sum[i] /nst->reg;        t      = sqr[i] -off[i] *sum[i];        fac[i] = (t > 0) ? sqrt(nst->reg /t) : 1;      }                         /* estimate the parameters */    }    if (weight < 0) {           /* if to reinitialize registration */      for (i = nst->dim; --i >= 0; )        sum[i] = sqr[i] = 0;    /* reinitialize the vectors */      nst->reg = 0;             /* and the pattern counter */    } }  else {                        /* if to register a data vector */    min = nst->mins;            /* get the minimal */    max = nst->maxs;            /* and the maximal values */    for (i = nst->dim; --i >= 0; ) {      if (vec[i] < min[i]) min[i] = vec[i];      if (vec[i] > max[i]) max[i] = vec[i];      sum[i] += vec[i];         /* update the ranges of values */      sqr[i] += vec[i] *vec[i]; /* and sum the values */    }                           /* and their squares */    nst->reg += weight;         /* count the pattern */  }}  /* nst_reg() *//*--------------------------------------------------------------------*/void nst_range (NSTATS *nst, int idx, double min, double max){                               /* --- set range of values */  int i;                        /* loop variable */  assert(nst && (idx < nst->dim));  /* check the arguments */  if (idx < 0) { i = nst->dim; idx = 0; }  else         { i = idx +1; }  /* get index range to set */  while (--i >= idx) {          /* and traverse it */    nst->mins[i] = min;         /* set the minimal */    nst->maxs[i] = max;         /* and the maximal value */  }                             /* for all dimensions in range */}  /* nst_range() *//*--------------------------------------------------------------------*/void nst_expand (NSTATS *nst, int idx, double factor){                               /* --- expand range of values */  int    i;                     /* loop variable */  double t;                     /* change of minimal/maximal value */  assert(nst                    /* check the function arguments */     && (idx < nst->dim) && (factor >= 0));  if (idx < 0) { i = nst->dim; idx = 0; }  else         { i = idx +1; }  /* get index range to expand */  while (--i >= idx) {          /* and traverse it */    t = (nst->maxs[i] -nst->mins[i]) *(factor -1) *0.5;    nst->mins[i] -= t;          /* adapt the minimal */    nst->maxs[i] += t;          /* and   the maximal value */  }                             /* for all dimensions in range */}  /* nst_expand() *//*--------------------------------------------------------------------*/void nst_scale (NSTATS *nst, int idx, double off, double fac){                               /* --- set (linear) scaling */  int i;                        /* loop variable */  assert(nst && (idx < nst->dim));  /* check the arguments */  if (idx < 0) { i = nst->dim; idx = 0; }  else         { i = idx +1; }  /* get index range to set */  while (--i >= idx) {          /* and traverse it */    nst->offs[i] = off;         /* set the offset */    nst->facs[i] = fac;         /* and the scaling factor */  }                             /* for all dimensions in range */}  /* nst_scale() *//*--------------------------------------------------------------------*/void nst_norm (NSTATS *nst, const double *vec, double *res){                               /* --- normalize a data vector */  int    i;                     /* loop variable */  double *off, *fac;            /* to traverse the scaling parameters */  assert(nst && vec && res);    /* check the function arguments */  off = nst->offs +(i = nst->dim);  fac = nst->facs + i;          /* get the scaling parameters */  res += i; vec += i;           /* and the data vectors */  while (--i >= 0) *--res = *--fac * (*--vec - *--off);}  /* nst_norm() */             /* scale the vector *//*--------------------------------------------------------------------*/void nst_inorm (NSTATS *nst, const double *vec, double *res){                               /* --- inverse normalize a vector */  int    i;                     /* loop variable */  double *off, *fac;            /* to traverse the scaling parameters */  assert(nst && vec && res);    /* check the function arguments */  off = nst->offs +(i = nst->dim);  fac = nst->facs + i;          /* get the scaling parameters */  res += i; vec += i;           /* and the data vectors */  while (--i >= 0) *--res = *--vec / *--fac + *--off;}  /* nst_inorm() */            /* scale the vector *//*--------------------------------------------------------------------*/void nst_center (NSTATS *nst, double *vec){                               /* --- get center of data space */  int    i;                     /* loop variable */  double *min, *max;            /* to traverse the ranges */  assert(nst && vec);           /* check the function arguments */  min = nst->mins;              /* get the range variables, */  max = nst->maxs;              /* traverse the dimensions, */  for (i = nst->dim; --i >= 0;) /* and compute the center vector */    vec[i] = 0.5 *(max[i] +min[i]);}  /* nst_center() *//*--------------------------------------------------------------------*/void nst_spans (NSTATS *nst, double *vec){                               /* --- get spans of dimensions */  int    i;                     /* loop variable */  double *min, *max;            /* to traverse the ranges */  assert(nst && vec);           /* check the function arguments */  min = nst->mins;              max = nst->maxs;              /* get the range variables, */   for (i = nst->dim; --i >= 0;) /* traverse the dimensions, */     vec[i] = max[i] -min[i];    /* and compute the spans */}  /* nst_spans() *//*--------------------------------------------------------------------*/int nst_desc (NSTATS *nst, FILE *file, const char *indent, int maxlen){                               /* --- describe norm. statistics */  int  i;                       /* loop variable */  int  pos, ind;                /* position in output line */  char buf[64];                 /* buffer for output */  for (i = nst->dim; --i >= 0;) /* check for non-identity scaling */    if ((nst->offs[i] != 0) || (nst->facs[i] != 1)) break;  if (i < 0) return 0;          /* if all identity scaling, abort */  fputs(indent,        file);   /* write the indentation and */  fputs("scales   = ", file);   /* start the scaling parameters */  for (ind = 0; indent[ind]; ind++);  pos = ind +9;                 /* compute the starting position */  for (i = 0; i < nst->dim; i++) {    pos += sprintf(buf, "[% g, %g]", nst->offs[i], nst->facs[i]);    if (i > 0) {                /* format the scaling parameters */      if (pos +3 <= maxlen) { fputs(", ", file);      pos += 2;   }      else { fprintf(file, ",\n%s         ", indent); pos  = ind; }    }                           /* print separator and indentation */    fputs(buf, file);           /* print formatted offset and factor */  }  fputs(";\n", file);           /* terminate the list */  return ferror(file) ? -1 : 0; /* return the write status */}  /* nst_desc() *//*--------------------------------------------------------------------*/#ifdef NST_PARSEstatic int _parse (SCAN *scan, int dim, double **buf){                               /* --- parse normalization statistics */  int    k, n = 0;              /* loop variable, counter */  double *p;                    /* to access the statistics elements */  assert(scan);                 /* check the function arguments */  if ((sc_token(scan) != T_ID)  /* check whether 'scales' follows */  ||  (strcmp(sc_value(scan), "scales") != 0))    ERR_STR("scales");          /* if not, abort the function */  GET_TOK();                    /* consume 'scales' */  GET_CHR('=');                 /* consume '=' */  for (k = 0; (dim <= 0) || (k < dim); k++) {    if (k > 0) { GET_CHR(',');} /* if not first, consume ',' */    if (k >= n) {               /* if the statistics vector is full */      if (dim > 0) n  = dim;    /* compute the new vector size */      else         n += (n > BLKSIZE) ? n >> 1 : BLKSIZE;      p = (double*)realloc(*buf, (n+n) *sizeof(double));      if (!p) ERROR(E_NOMEM);   /* enlarge the buffer vector */      *buf = p;                 /* and set the new vector, */    }                           /* then note factor and offset */    p = *buf +k +k;             /* get the element to set */    GET_CHR('[');               /* consume '[' */    if (sc_token(scan) != T_NUM) ERROR(E_NUMEXP);    p[0] = strtod(sc_value(scan), NULL);    GET_TOK();                  /* consume the offset */    GET_CHR(',');               /* consume '[' */    if (sc_token(scan) != T_NUM) ERROR(E_NUMEXP);    p[1] = strtod(sc_value(scan), NULL);    GET_TOK();                  /* consume the factor */    GET_CHR(']');               /* consume '[' */    if ((dim <= 0) && (sc_token(scan) != ',')) {      k++; break; }             /* check for more scaling params. */  }  GET_CHR(';');                 /* consume ';' */  return k;                     /* return 'ok' */}  /* _parse() *//*--------------------------------------------------------------------*/NSTATS* nst_parse (SCAN *scan, int dim){                               /* --- parse normalization statistics */  NSTATS *nst;                  /* created normalization statistics */  double *buf = NULL;           /* buffer for reading */  assert(scan);                 /* check the function arguments */  dim = _parse(scan,dim, &buf); /* parse normalization statistics */  if (dim < 0) { if (buf) free(buf); return NULL; }  nst = nst_create(dim);        /* create a statistics structure */  if (!nst)    { free(buf); return NULL; }  for (buf += dim +dim; --dim >= 0; ) {    nst->facs[dim] = *--buf;    /* copy the buffered values */    nst->offs[dim] = *--buf;    /* into the corresponding vectors */  }  free(buf);                    /* delete the read buffer */  return nst;                   /* return the created structure */}  /* nst_parse() */#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91富婆露脸刺激对白| 中文字幕不卡三区| 91福利精品视频| 99久久伊人精品| 不卡影院免费观看| 成人精品免费看| 成人免费高清在线| www.色精品| 91理论电影在线观看| 色一情一伦一子一伦一区| 色婷婷国产精品综合在线观看| a级高清视频欧美日韩| 99re在线视频这里只有精品| 色综合久久天天| 欧美视频三区在线播放| 欧美日韩精品免费| 日韩免费高清av| 国产午夜精品一区二区三区视频| 欧美国产亚洲另类动漫| 亚洲欧美中日韩| 亚洲一区二区偷拍精品| 免费视频最近日韩| 极品销魂美女一区二区三区| 成人激情综合网站| 欧美亚洲一区二区在线观看| 欧美另类videos死尸| 久久久亚洲欧洲日产国码αv| 国产精品高清亚洲| 日韩在线一二三区| 国产成人一级电影| 欧美吞精做爰啪啪高潮| 精品国产欧美一区二区| 亚洲欧美国产77777| 男人操女人的视频在线观看欧美| 国产精品99久| 在线日韩一区二区| 久久亚洲精品小早川怜子| 亚洲裸体在线观看| 精品一区二区影视| 日本韩国精品在线| 久久精品一区二区三区四区| 亚洲一区二区av在线| 国产原创一区二区| 在线观看成人免费视频| www亚洲一区| 日韩精品成人一区二区三区 | 91官网在线免费观看| 日韩欧美一级精品久久| 亚洲精品伦理在线| 成人性生交大合| 欧美变态tickling挠脚心| 亚洲在线视频网站| 丁香网亚洲国际| 精品久久五月天| 亚洲成国产人片在线观看| www.久久精品| 国产日韩欧美一区二区三区乱码 | 亚洲成人黄色小说| 成人动漫av在线| 久久天堂av综合合色蜜桃网| 天天综合色天天综合| 欧美在线一二三| 亚洲综合一区在线| 99久久99久久精品免费观看| 国产午夜亚洲精品羞羞网站| 麻豆成人久久精品二区三区小说| 欧美日韩一级二级| 亚洲国产综合91精品麻豆 | 亚洲国产综合91精品麻豆| 99精品欧美一区二区三区综合在线| 精品国产精品一区二区夜夜嗨| 日韩电影一二三区| 91精品国产综合久久福利| 午夜视频一区二区| 5858s免费视频成人| 日韩制服丝袜av| 精品国产一区二区三区不卡| 轻轻草成人在线| 精品国产精品一区二区夜夜嗨| 精品一区二区综合| 久久精品欧美一区二区三区不卡 | 99久久99久久免费精品蜜臀| 欧美高清在线一区二区| 粉嫩嫩av羞羞动漫久久久| 久久先锋影音av| 粉嫩在线一区二区三区视频| 国产精品久久久久久户外露出| 99视频一区二区| 亚洲激情图片一区| 666欧美在线视频| 美国毛片一区二区三区| 日韩欧美区一区二| 国产在线精品视频| 亚洲欧洲另类国产综合| 成人激情av网| 亚洲国产va精品久久久不卡综合| 欧美揉bbbbb揉bbbbb| 一区二区三区免费网站| 3atv一区二区三区| 国产成人一区在线| 一区二区三区.www| 日韩久久久久久| 99精品黄色片免费大全| 日日摸夜夜添夜夜添国产精品| 精品国产乱码久久久久久1区2区 | 国产精品一区二区三区四区| 国产精品国产精品国产专区不蜜| 91成人国产精品| 精品午夜一区二区三区在线观看| 国产精品乱人伦| 欧美日韩一区二区三区在线| 激情综合色丁香一区二区| 综合av第一页| 精品久久久影院| 91在线码无精品| 日韩激情在线观看| 国产精品区一区二区三| 欧美色爱综合网| 大胆欧美人体老妇| 美女视频网站黄色亚洲| 欧美激情中文字幕一区二区| 欧美亚洲高清一区二区三区不卡| 久久精品国产色蜜蜜麻豆| 最新国产の精品合集bt伙计| 555www色欧美视频| 99麻豆久久久国产精品免费| 日本中文一区二区三区| 一区二区在线免费| 亚洲国产高清不卡| 欧美zozozo| 777亚洲妇女| 欧美午夜精品一区二区三区| 成人一区二区在线观看| 激情欧美日韩一区二区| 爽好多水快深点欧美视频| 一区二区三区中文在线| 国产精品色哟哟| 国产三区在线成人av| 日韩欧美一区在线| 69成人精品免费视频| 欧美午夜精品一区二区三区| 99久久国产免费看| 99re成人精品视频| 99久久精品99国产精品| 懂色av中文一区二区三区| 国产原创一区二区三区| 久久精品国产一区二区三 | 久久久精品天堂| 日韩欧美在线不卡| 欧美一区二区三区视频在线观看| 欧美亚洲日本国产| 欧美日韩国产美| 欧美精品久久一区二区三区| 欧美性三三影院| 欧美日韩国产片| 91麻豆精品国产91久久久久久 | 男女男精品视频| 日本视频中文字幕一区二区三区| 亚洲自拍偷拍综合| 亚洲大片免费看| 亚洲精选视频在线| 亚洲国产精品综合小说图片区| 亚洲国产中文字幕| 免费av成人在线| 久久精品国产在热久久| 国产一区激情在线| 成人性生交大片免费看视频在线 | 一区二区三区欧美视频| 亚洲男同性恋视频| 天天操天天干天天综合网| 蜜桃av一区二区三区电影| 国产在线精品一区二区| 成人一区二区三区| 在线观看一区二区精品视频| 在线观看91av| 日本一区二区三区四区在线视频| 国产精品网站在线播放| 亚洲中国最大av网站| 美女免费视频一区二区| 韩国女主播一区| 国产一区91精品张津瑜| 精品一区二区成人精品| 成人va在线观看| 欧美老年两性高潮| 国产欧美日韩精品一区| 一区二区三区不卡视频在线观看| 亚洲一区二区五区| 国产精品自拍一区| 欧美日韩一区二区电影| 久久精品一区二区三区不卡 | 日本va欧美va瓶| 成人一区二区三区| 91精品免费观看| 亚洲女同ⅹxx女同tv| 免费一区二区视频| 91丝袜高跟美女视频| 日韩视频免费观看高清完整版在线观看 | 午夜伊人狠狠久久| 国产毛片一区二区| 欧美酷刑日本凌虐凌虐|