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

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

?? nstats.c

?? 關聯模式的Apriori的vc實現
?? 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精品国产综合久久久久久久 | 777亚洲妇女| 91色乱码一区二区三区| 成人激情视频网站| av高清不卡在线| 成人动漫视频在线| 成人美女视频在线看| 粉嫩av一区二区三区在线播放| 精品无人码麻豆乱码1区2区 | 亚洲最快最全在线视频| 日韩码欧中文字| 亚洲欧美另类图片小说| 亚洲精品高清在线观看| 亚洲最新在线观看| 日韩国产精品91| 国产一区二区三区av电影 | 1024国产精品| 亚洲欧美另类久久久精品2019| 18欧美亚洲精品| 亚洲福利一区二区| 久久99精品国产麻豆婷婷| 懂色av中文字幕一区二区三区| 91啪亚洲精品| 日韩一区二区三区免费观看| 久久久不卡网国产精品二区| 中文字幕一区二区三区在线观看 | 欧美视频在线不卡| 91精品国产一区二区三区蜜臀 | 亚洲一二三四区不卡| 日日摸夜夜添夜夜添国产精品 | 狠狠色丁香婷婷综合| 国产精品一区二区视频| 色综合久久久久综合体| 日韩一级高清毛片| 日本一区二区成人在线| 亚洲专区一二三| 国产乱码精品一区二区三区av | 亚洲成国产人片在线观看| 日本人妖一区二区| 99精品久久久久久| 欧美精品一区二区高清在线观看| 综合欧美亚洲日本| 日本亚洲电影天堂| caoporn国产精品| 日韩精品在线网站| 亚洲精品国产精品乱码不99 | 中文字幕一区二区三区在线不卡| 午夜精品福利久久久| 成人va在线观看| 欧美成人猛片aaaaaaa| 亚洲人成网站色在线观看| 极品少妇一区二区| 欧美午夜影院一区| 国产精品短视频| 国产精品自拍毛片| 欧美成人a∨高清免费观看| 一区二区三区蜜桃| 99久久婷婷国产| 亚洲精品一区二区三区蜜桃下载 | 精品亚洲porn| 欧美日产在线观看| 亚洲综合图片区| 懂色av中文字幕一区二区三区| 欧美一区二区美女| 午夜精品久久久久久久99水蜜桃| 91美女片黄在线观看| 国产精品麻豆视频| 福利电影一区二区三区| 欧美r级电影在线观看| 日韩中文字幕91| 欧美日韩在线直播| 一区二区三区资源| 91久久精品日日躁夜夜躁欧美| 中文字幕欧美激情| 国产91丝袜在线播放0| 久久这里只有精品首页| 国精产品一区一区三区mba桃花| 日韩欧美亚洲国产精品字幕久久久| 视频一区二区不卡| 91麻豆精品国产91久久久资源速度 | 欧美精品一区二区三区四区| 麻豆精品在线播放| 欧美成人艳星乳罩| 国产电影精品久久禁18| 国产欧美日韩精品在线| 国产精品一区二区久激情瑜伽 | 92国产精品观看| 国产精品久久久久7777按摩| av一二三不卡影片| 一区二区三区欧美日韩| 制服丝袜亚洲色图| 国内精品伊人久久久久av影院 | 久久久亚洲精品一区二区三区| 日本午夜精品一区二区三区电影| 日韩一区二区三区视频| 国产一区二区福利| 国产精品福利av| 欧美久久久久久久久中文字幕| 亚洲欧美激情一区二区| 欧美日韩国产高清一区二区 | 欧美又粗又大又爽| 婷婷综合五月天| 久久久综合精品| 色天使久久综合网天天| 日韩avvvv在线播放| 国产午夜精品一区二区三区嫩草 | 精品久久久久一区| 国产白丝精品91爽爽久久| 亚洲精品日产精品乱码不卡| 欧美一区二区国产| 91丨国产丨九色丨pron| 日韩**一区毛片| 国产精品国产三级国产普通话三级 | 成人高清视频在线观看| 亚洲精品ww久久久久久p站 | 国产成人在线看| 亚洲综合一区二区三区| 精品国产网站在线观看| 91精品91久久久中77777| 精品一区二区三区视频| 亚洲丝袜另类动漫二区| 日韩一级黄色大片| 欧美亚洲日本一区| 国产成人精品免费看| 婷婷久久综合九色综合绿巨人 | 亚洲成人免费在线| 中文字幕av资源一区| 日韩精品一区二区三区中文精品| av一本久道久久综合久久鬼色| 麻豆视频观看网址久久| 亚洲男人的天堂一区二区| 久久久久久免费| 欧美一区二区三区的| 日本韩国一区二区| 成人精品视频网站| 国产成人亚洲综合色影视| 免费观看成人鲁鲁鲁鲁鲁视频| 一区二区在线看| 亚洲少妇中出一区| 国产精品无码永久免费888| 精品福利一区二区三区| 欧美日韩国产在线观看| 91亚洲男人天堂| 成人免费视频一区| 国产suv精品一区二区三区| 国产在线一区二区综合免费视频| 日本伊人精品一区二区三区观看方式| 一区二区三区国产豹纹内裤在线| 国产精品网站在线| 中文字幕免费在线观看视频一区| 欧美精品一区二区在线播放| 精品日韩一区二区| 日韩欧美第一区| 精品国产乱码久久久久久影片| 日韩一区二区电影网| 欧美一区二区久久久| 欧美一级精品在线| 精品福利一区二区三区免费视频| 精品日产卡一卡二卡麻豆| 日韩三级精品电影久久久| 8v天堂国产在线一区二区| 日韩午夜激情视频| 日韩免费电影一区| 久久天天做天天爱综合色| 国产欧美视频一区二区三区| 日本一区二区高清| 亚洲人午夜精品天堂一二香蕉| 亚洲精品日日夜夜| 日韩专区一卡二卡| 国产精品自在在线| 99国产精品国产精品久久| 99精品国产一区二区三区不卡| 91丨porny丨户外露出| 欧美日韩视频一区二区| 欧美哺乳videos| 国产精品美女久久久久aⅴ | 日韩精品一区二区三区视频在线观看 | 色综合久久久久久久久| 在线观看国产91| 日韩一级成人av| 国产精品久久久99| 亚洲va国产天堂va久久en| 精品一区二区日韩| 成a人片国产精品| 欧美美女黄视频| 久久精品夜色噜噜亚洲a∨| 亚洲乱码精品一二三四区日韩在线| 亚洲18影院在线观看| 国产精品亚洲一区二区三区妖精 | 亚洲综合无码一区二区| 美腿丝袜亚洲色图| www.性欧美| 911精品国产一区二区在线| 国产精品污网站| 另类调教123区| 日本高清不卡一区| 国产亚洲视频系列| 婷婷国产v国产偷v亚洲高清|