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

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

?? nstats.c

?? 數(shù)據(jù)挖掘中的apriori算法,很好的代碼
?? 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一区二区三区免费野_久草精品视频
一区二区三区在线视频观看| 亚洲午夜久久久| 国产精品丝袜久久久久久app| 欧美成人国产一区二区| 精品国产人成亚洲区| 精品国产一区二区三区忘忧草 | 日韩精品在线一区| 欧美日韩国产不卡| 久久综合色婷婷| 自拍偷拍亚洲欧美日韩| 天堂久久一区二区三区| 国产精品一二三四| 色哟哟一区二区| 久久久久综合网| 亚洲成年人网站在线观看| 国产一区二区91| 欧美乱妇23p| 亚洲另类中文字| 国产一区久久久| 欧美男男青年gay1069videost| 2023国产一二三区日本精品2022| 国产精品欧美久久久久无广告| 亚洲二区视频在线| 97久久人人超碰| 国产精品日产欧美久久久久| 一区二区成人在线视频| 国产精品一区二区久激情瑜伽| 色婷婷久久久综合中文字幕| 精品粉嫩aⅴ一区二区三区四区| 亚洲精品成人a在线观看| 国产精品夜夜爽| 久久久久久久电影| 久久精品99国产国产精| 制服丝袜国产精品| 亚洲1区2区3区4区| 欧美视频一区二区三区在线观看 | 高清国产午夜精品久久久久久| 日韩亚洲欧美一区二区三区| 天堂蜜桃一区二区三区| 欧美一级艳片视频免费观看| 日韩精品一级二级 | 国内成人免费视频| 亚洲精品一线二线三线| 国产乱码字幕精品高清av| 精品女同一区二区| 成人一级片网址| 久久亚洲一级片| 97久久久精品综合88久久| 中文字幕欧美激情一区| 91色乱码一区二区三区| 亚洲福利电影网| 久久女同互慰一区二区三区| 99精品在线免费| 三级影片在线观看欧美日韩一区二区| 69成人精品免费视频| 国产.精品.日韩.另类.中文.在线.播放| 国产亚洲精品aa午夜观看| 韩国精品免费视频| 一区二区免费视频| 久久久亚洲欧洲日产国码αv| 99久久精品国产精品久久| 日韩va欧美va亚洲va久久| 国产日韩欧美综合在线| 欧美日本一区二区在线观看| 国产精品亚洲专一区二区三区| 中文字幕一区二区不卡| 欧美一区二区三区小说| 免费高清成人在线| 日韩伦理av电影| 欧美草草影院在线视频| 色婷婷久久综合| 成人免费黄色在线| 处破女av一区二区| 国产在线视频一区二区| 性欧美大战久久久久久久久| 自拍偷拍欧美激情| 国产亚洲制服色| 欧美精品一区二区精品网| 在线精品视频免费观看| 91色porny在线视频| 91丝袜美女网| 色综合久久久久久久久| 91色乱码一区二区三区| 色视频欧美一区二区三区| 成人av在线观| www.欧美日韩| 91麻豆蜜桃一区二区三区| 成人国产在线观看| 成人理论电影网| 波多野结衣的一区二区三区| 粉嫩高潮美女一区二区三区| 国产 日韩 欧美大片| av在线不卡观看免费观看| 色婷婷av一区二区三区之一色屋| 在线观看网站黄不卡| 欧美一区2区视频在线观看| 在线观看91av| 中文字幕精品一区二区三区精品| 久久精品视频在线免费观看 | 国产九色sp调教91| 99re8在线精品视频免费播放| 欧美私模裸体表演在线观看| 91精品国产色综合久久不卡蜜臀| wwww国产精品欧美| 亚洲色图.com| 加勒比av一区二区| 一本久道中文字幕精品亚洲嫩 | 奇米四色…亚洲| 99久久国产综合精品麻豆| 欧美久久一区二区| 亚洲天堂福利av| 高清不卡在线观看| 欧美大片日本大片免费观看| 亚洲一区二区三区精品在线| 国产不卡视频在线播放| 欧美日韩视频在线第一区 | 91麻豆视频网站| 久久婷婷国产综合国色天香| 性欧美大战久久久久久久久| av不卡在线播放| 国产女人aaa级久久久级| 蜜桃精品视频在线| 欧美日韩精品系列| 亚洲综合在线电影| 99re这里都是精品| 亚洲视频网在线直播| www.日本不卡| 亚洲欧美日本韩国| 一本到三区不卡视频| 亚洲女同ⅹxx女同tv| 91日韩一区二区三区| 国产精品大尺度| 777午夜精品免费视频| 午夜精品福利一区二区蜜股av | 国产一区二区调教| 精品久久99ma| 成人精品小蝌蚪| 亚洲人成网站精品片在线观看| 91啪亚洲精品| 日韩精品每日更新| 久久一留热品黄| 成人成人成人在线视频| 亚洲mv在线观看| 精品欧美一区二区三区精品久久| 国产一区二区不卡| 一二三四区精品视频| 91精品久久久久久久99蜜桃| 国产精品一区二区在线观看不卡 | aaa欧美日韩| 理论片日本一区| 夜夜嗨av一区二区三区网页| 日韩一区二区精品在线观看| 本田岬高潮一区二区三区| 亚洲国产毛片aaaaa无费看| 久久精品亚洲一区二区三区浴池| 色偷偷88欧美精品久久久| 免费亚洲电影在线| 国产精品视频免费看| 欧美又粗又大又爽| 国产一区二区0| 久久97超碰色| 视频精品一区二区| 夜夜嗨av一区二区三区四季av| 久久精品一区二区三区不卡牛牛| 欧美曰成人黄网| 91一区二区在线观看| 成人免费视频视频在线观看免费| 另类成人小视频在线| 日韩福利电影在线| 国产精品久久久久久久久免费桃花| 欧美一区二区三区色| 欧美女孩性生活视频| 在线观看视频91| 欧美影院一区二区三区| 欧美日韩免费观看一区二区三区| 色综合久久综合网97色综合 | 中文字幕欧美国产| 久久精品网站免费观看| 国产精品欧美一级免费| 国产精品嫩草影院av蜜臀| 亚洲桃色在线一区| 亚洲一区二区黄色| 美女视频黄免费的久久 | www亚洲一区| 亚洲欧美日韩中文字幕一区二区三区| 亚洲免费观看视频| 亚洲网友自拍偷拍| 日韩av成人高清| 欧美电影免费观看高清完整版在线| 日韩欧美国产午夜精品| 26uuu久久天堂性欧美| 国产精品色哟哟| 亚洲宅男天堂在线观看无病毒| 一区二区三区在线影院| 久久精品99久久久| 成+人+亚洲+综合天堂| 成人av先锋影音| 精品国产伦理网| 亚洲主播在线观看| 成人激情免费视频|