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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? getfileargs.cc

?? PostsBayesian Optimization Algorithm with Decision Graphs in C++,
?? CC
字號:
// ################################################################################//// name:          getFileArgs.cc      //// author:        Martin Pelikan//// purpose:       functions for reading the input file, printing the description //                of the parameters that can be processed, and the related//// last modified: February 1999//// #################################################################################include <stdio.h>#include <stdlib.h>#include <time.h>#include <string.h>#include "getFileArgs.h"#include "memalloc.h"#include "utils.h"// ---------------------------------------// some compilers do not know strdup, I do// ---------------------------------------#ifndef strdup#define strdup(s) strcpy((char*) Malloc(strlen(s)+1),s)#endif// -----------------------------------// the type description for parameters// -----------------------------------char *typeDesc[30] =         { "char", 	  "int", 	  "long", 	  "float", 	  "char*",	  "(int,int)*"	};// -------------// no comment...// -------------char *yesString = "Yes";char *noString = "No";// ================================================================================//// name:          yesNoDescriptor//// function:      returns "Yes" if input is true, "No" otherwise//// parameters:    i............a number determining what to return//// returns:       (char*) resulting string ("Yes"/"No")//// ================================================================================char *yesNoDescriptor(int i){  if (i)    return yesString;  else    return noString;}// ================================================================================//// name:          getFirstString//// function:      gets a first string composed of letters or characters "-" and "_"//                from a current file position and stores it; also stores the first//                character of the remaining output; skips spaces at the beginning//                if needed//// parameters:    f............the pointer to input stream//                s............the pointer where to store the read string//                restC........the character following the string//// returns:       (int) 0 if end of file reached, non-zero otherwise//// ================================================================================int getFirstString(FILE *f, char *s, char *restC){  register int i;  char c;  do   {    c = fgetc(f);  } while ((!feof(f)) &&            (((c<'a') || (c>'z')) &&            ((c<'A') || (c>'Z')) &&            ((c<'0') || (c>'9')) &&            (c!='_') &&	    (c!='-')));  if (!feof(f))  {    i=0;    while ((c!=10) && (!feof(f)) && (c!=' ') && (c!='='))    {      s[i++] = c;      c = fgetc(f);    }    s[i]=0;  }  if (restC)    *restC=c;  return (!feof(f));}// ================================================================================//// name:          setParamValue//// function:      sets the value of a parameter from the file, the pointer in the//                file must be at the beginning of the value or spaces before it;//                if the pointer to the file is NULL, the value of a paramter//                is set to its default value//// parameters:    f............the pointer to the input stream//                param........the pointer to the parameter to set//// returns:       (int) 0 (if everything went fine)//// ================================================================================int setParamValue(FILE *f, ParamStruct *param){  char s[100];  int iTmp;  time_t t;  // set the value of paremeter from the file, if the file is NULL then the value is chosen  // to be the default value given as the param's attribute  switch (param->type)     {    case PARAM_CHAR:      if (f)	getFirstString(f,s,NULL);      else	strcpy(s,param->defValue);      sscanf(s,"%i",&iTmp);      *(( char*)param->where)=(char)iTmp;      break;          case PARAM_INT:       if (f)	getFirstString(f,s,NULL);      else	strcpy(s,param->defValue);      if (strcmp(s,"time"))	sscanf(s,"%i",(int*)param->where);      else	*((int*)param->where) = time(&t);      break;          case PARAM_LONG:       if (f)	getFirstString(f,s,NULL);      else	strcpy(s,param->defValue);      if (strcmp(s,"time"))	sscanf(s,"%li",(long*)param->where);      else	*((long*)param->where) = time(&t);      sscanf(s,"%li",(long *)param->where);      break;          case PARAM_FLOAT:      if (f)	getFirstString(f,s,NULL);      else	strcpy(s,param->defValue);      sscanf(s,"%f",(float*)param->where);      break;    case PARAM_STRING:      if (f)	{	  getFirstString(f,(char*) s,NULL);	  *((char**)param->where) = strdup(s);	}      else	{	  if (param->defValue)	    *((char**)param->where) = strdup((char*)param->defValue);	  else	    *((char**)param->where) = (char*) NULL;	}      break;    case PARAM_DIVIDER:      break;    case PARAM_END:      break;    default:       fprintf(stderr,"ERROR: Undefined parameter type (%u)\n",param->type);      exit(-2);    }  // get back  return 0;}// ================================================================================//// name:          getParamsFromFile//// function:      reads the values of parameters from a file//// parameters:    filename.....the name of an input file//                params.......the array of parameters to be set (either from the//                             file or default values//// returns:       (int) 0 (if everything went fine)//// ================================================================================int getParamsFromFile(char *filename, ParamStruct params[]){  FILE *f=NULL;  char s[200];  register int i;  int numParams;  char *defined;  int which;  char c;  numParams=0;  while (params[numParams].type!=PARAM_END) numParams++;  // allocate memory for the array saying what was defined and what hasn't been defined yet  defined = (char*) Malloc(numParams);  // set this array values to 0 (nothing has been defined yet)  for (i=0; i<numParams; i++)      defined[i]=0;  // if there's configuration file name given, this file has got to exist  if (filename)    {      f = fopen(filename,"r");      if (f==NULL)	{	  fprintf(stderr,"ERROR: File %s doesn't exist!\n",filename);	  exit(-1);	}    }  // read configuration file...  if (f)  while (!feof(f))  {    // if it is possible, read the first identifier    if (getFirstString(f,s,&c))    {          which=-1;          for (i=0; (i<numParams) && (which==-1); i++)	      if ((params[i].type!=PARAM_DIVIDER) && (!strcmp(params[i].identifier,s)))                 which=i;	  // does identifier not exist?          if (which==-1)	    {	      fprintf(stderr,"ERROR: Parameter %s in file %s is not understood!\n",s,filename);	      exit(-1);	    }	  // defined twice?          if (defined[which])	    {              fprintf(stderr,"ERROR: Parameter %s in file %s was redefined!\n",s,filename);	      exit(-1);	    }	  // missing '=' after identifier?          while ((!feof(f)) && (c!='=')) c = fgetc(f);          if ((feof(f))||(c!='='))	    {	      fprintf(stderr,"ERROR: Parameter identifier %s in file %s is not followed by '='!\n",params[which].identifier,filename);	      exit(-1);	    }	  // read the parameter value           setParamValue(f,&(params[which]));          defined[which]=1;    }  }  // set default values for the rest of parameters (that has not been define in configuration  // file)  for (i=0; i<numParams; i++)  if (!defined[i])    setParamValue(NULL,&(params[i]));  // free allocated memory  free(defined);  // get back  return 0;}// ================================================================================//// name:          printParamsDescription//// function:      prints out the description of parameters that can be specified//// parameters:    out..........where to print the description//                params.......the array of parameters to print the description of//// returns:       (int) 0 (if everything went fine)//// ================================================================================int printParamsDescription(FILE *out, ParamStruct params[]){  int i=0;  // print the header (description of information pieces that follow)  printf("Configuration file description:\n\n");  fputs("Description                                                Identifier                 Type       Default\n",out);  printf("----------------------------------------------------------------------------------------------------------------\n");  // print the description of all parameters  while (params[i].type!=PARAM_END)    {      if (params[i].type==PARAM_DIVIDER)	printf("\n");      else	fprintf(out,"%-58s %-26s %-10s %-8s\n",params[i].description,params[i].identifier, typeDesc[params[i].type], (params[i].defValue)? params[i].defValue:"(null)"); 	      i++;    }  // get back  return 0;}// ================================================================================//// name:          printParamsDescription//// function:      prints out the values of the parameters//// parameters:    out..........where to print the values to//                params.......the array of parameters to print the values of//// returns:       (int) 0 (if everything went fine)//// ================================================================================int printParamValues(FILE *out, ParamStruct params[]){  int i=0;  // is output stream null  if (out==NULL)    return 0;  // print out the header (the description of information that follows)  fprintf(out,"Parameter Values:\n\n");  fputs("Description                                                Identifier                 Type       Value\n",out);  fprintf(out,"----------------------------------------------------------------------------------------------------------------\n");  // print out the descriptions and the values of all parameters  while (params[i].type!=PARAM_END)    {      if (params[i].type!=PARAM_DIVIDER)	fprintf(out,"%-58s %-26s %-10s ",params[i].description,params[i].identifier, typeDesc[params[i].type]);      switch (params[i].type)	{	case PARAM_CHAR:	  if (params[i].getValueDescription)	    {	      fprintf(out,"%i (",*((char*)params[i].where));	      fputs((*((GetValueDescription*)params[i].getValueDescription))(*((char*)params[i].where)),out);	      fprintf(out,")");	    }	  else	    fprintf(out,"%i",*((char*)params[i].where));	  break;	case PARAM_INT:	  if (params[i].getValueDescription)	    {	      fprintf(out,"%i (",*((char*)params[i].where));	      fputs((*((GetValueDescription*)params[i].getValueDescription))(*((int*)params[i].where)),out);	      fprintf(out,")");	    }	  else	    fprintf(out,"%i",*((int*)params[i].where));	  break;	case PARAM_LONG:	  fprintf(out,"%i",*((long*)params[i].where));	  break;	case PARAM_FLOAT:	  fprintf(out,"%f",*((float*)params[i].where));	  break;	case PARAM_STRING:	  if (*((char**)params[i].where))	    fputs(*((char**)params[i].where),out);	  else	    fputs("(null)",out);	  break;	  	case PARAM_DIVIDER:	  fprintf(out,"/n");	  break;	}      fprintf(out,"\n");      i++;    }  // get back    return 0;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区四区在线| 亚洲精品一区二区在线观看| 国产精品国产成人国产三级| 国产 欧美在线| 中文字幕欧美区| 91美女在线看| 亚欧色一区w666天堂| 日韩欧美在线观看一区二区三区| 日本欧美一区二区| 久久久久久99久久久精品网站| 韩国av一区二区| 成人欧美一区二区三区白人| 在线观看av一区| 久久精品国产亚洲a| 精品黑人一区二区三区久久| 成人免费毛片高清视频| 一区二区三区在线播放| 91精品久久久久久久久99蜜臂| 狠狠色综合播放一区二区| 国产精品日韩精品欧美在线| 在线影院国内精品| 激情偷乱视频一区二区三区| 中文字幕一区免费在线观看| 91精品一区二区三区在线观看| 九九精品一区二区| 亚洲女女做受ⅹxx高潮| 91.xcao| 国产不卡在线播放| 亚洲午夜免费电影| 久久久777精品电影网影网 | 亚洲免费观看高清完整版在线观看| 色综合天天综合色综合av| 日韩综合小视频| 国产精品久久久久久久裸模| 欧美精品第一页| 不卡的av中国片| 日本不卡一区二区| 亚洲日本电影在线| 欧美精品一区男女天堂| 91国偷自产一区二区开放时间 | 97成人超碰视| 久久99精品国产.久久久久久| 亚洲免费视频成人| 久久久一区二区三区| 欧美日韩中文精品| 国产91清纯白嫩初高中在线观看 | 日本欧美肥老太交大片| 国产精品久久久久久久午夜片| 欧美一区二区三区四区久久| 91污片在线观看| 国产精品亚洲一区二区三区妖精 | 91久久国产综合久久| 极品尤物av久久免费看| 午夜激情一区二区| 国产精品成人免费精品自在线观看 | 国产老妇另类xxxxx| 日本亚洲电影天堂| 亚洲国产精品一区二区久久恐怖片| 国产精品毛片久久久久久| 欧美精品一区二区三区蜜臀| 欧美一级在线视频| 欧美猛男gaygay网站| 色婷婷av一区二区三区之一色屋| 国产99久久久国产精品| 激情综合色播激情啊| 美女视频网站久久| 美女看a上一区| 日韩中文字幕91| 偷拍日韩校园综合在线| 亚洲国产欧美在线| 午夜免费欧美电影| 五月综合激情日本mⅴ| 亚洲国产欧美日韩另类综合 | 亚洲综合在线免费观看| 17c精品麻豆一区二区免费| 国产精品水嫩水嫩| 中文字幕成人网| 欧美激情一区二区三区全黄| 国产人成一区二区三区影院| 国产三区在线成人av| 日本一区二区三区在线不卡| 中文字幕av在线一区二区三区| 国产日韩欧美一区二区三区乱码 | 日韩欧美一卡二卡| 337p日本欧洲亚洲大胆色噜噜| 日韩精品一区二区三区视频| 精品精品国产高清a毛片牛牛| 久久综合久久鬼色中文字| 国产亚洲欧美日韩在线一区| 欧美国产精品劲爆| 亚洲私人影院在线观看| 亚洲一区二区av电影| 日本sm残虐另类| 精品中文字幕一区二区小辣椒| 国产精品一区在线观看你懂的| 成人蜜臀av电影| 91成人在线观看喷潮| 欧美一区午夜视频在线观看| 精品久久国产字幕高潮| 国产欧美精品一区| 伊人婷婷欧美激情| 免费成人av资源网| 成人毛片视频在线观看| 欧美偷拍一区二区| 精品国产乱码久久久久久1区2区| 国产丝袜在线精品| 亚洲最新在线观看| 久久99国产精品麻豆| 96av麻豆蜜桃一区二区| 91精品国产综合久久久久| 久久综合狠狠综合| 一区二区三区日韩| 麻豆精品一区二区av白丝在线 | 色综合中文综合网| 欧美一区二区三区免费观看视频 | 色综合激情五月| 日韩一区和二区| 国产精品三级av| 日本va欧美va精品| 91网址在线看| 亚洲精品在线免费观看视频| 亚洲伦在线观看| 国产原创一区二区| 欧美中文一区二区三区| 国产亚洲午夜高清国产拍精品| 亚洲综合清纯丝袜自拍| 国产麻豆精品在线| 欧美精品视频www在线观看| 国产三级精品三级| 久草中文综合在线| 欧美日韩中文精品| 亚洲三级在线看| 国产一区视频网站| 欧美视频精品在线| 日韩理论片中文av| 国产精品一线二线三线| 欧美日韩免费在线视频| 日韩一区欧美一区| 国产九九视频一区二区三区| 欧美日本在线看| 亚洲青青青在线视频| 国产乱色国产精品免费视频| 欧美伦理视频网站| 一区二区三区.www| jlzzjlzz亚洲女人18| 久久亚洲二区三区| 美女视频黄a大片欧美| 欧美日韩你懂的| 亚洲一区二区三区激情| 97成人超碰视| 亚洲视频精选在线| 成人黄色大片在线观看| 久久久久九九视频| 韩国精品一区二区| 亚洲精品在线免费观看视频| 免费成人在线视频观看| 91精品国产综合久久久久久| 视频一区中文字幕| 欧美日韩国产小视频| 亚洲精品欧美激情| 色综合久久99| 亚洲欧美日韩在线| 91精彩视频在线| 亚洲码国产岛国毛片在线| 91国内精品野花午夜精品| 亚洲卡通动漫在线| 色8久久精品久久久久久蜜| 亚洲免费观看在线视频| 91福利资源站| 五月婷婷色综合| 欧美高清激情brazzers| 日本伊人色综合网| 日韩亚洲欧美中文三级| 捆绑调教一区二区三区| 欧美成人一区二区三区在线观看| 日韩激情一区二区| 欧美电影免费观看高清完整版在线观看 | 7777精品伊人久久久大香线蕉超级流畅 | 国产91精品免费| 国产精品久久久久久久久免费相片 | 国产日韩欧美精品在线| 成人高清免费观看| 亚洲同性同志一二三专区| 91免费看视频| 五月激情综合色| 欧美精品一区二区三| 成人免费毛片高清视频| 一区二区三区欧美久久| 5858s免费视频成人| 国产一区二区三区日韩| 中文字幕一区二区在线观看| 欧美性猛交xxxx乱大交退制版 | 水野朝阳av一区二区三区| 欧美一区二区三区播放老司机| 精品制服美女久久| 亚洲特黄一级片| 日韩免费视频一区二区| 成人网页在线观看| 亚洲国产视频a| 久久久精品tv|