您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ stringlist_iget函数代码示例

51自学网 2021-06-03 08:30:49
  C++
这篇教程C++ stringlist_iget函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中stringlist_iget函数的典型用法代码示例。如果您正苦于以下问题:C++ stringlist_iget函数的具体用法?C++ stringlist_iget怎么用?C++ stringlist_iget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了stringlist_iget函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ensemble_config_init

void ensemble_config_init(ensemble_config_type * ensemble_config , const config_type * config , ecl_grid_type * grid, const ecl_sum_type * refcase) {  int i;  ensemble_config_set_refcase( ensemble_config , refcase );  if (config_item_set( config , GEN_KW_TAG_FORMAT_KEY))    ensemble_config_set_gen_kw_format( ensemble_config , config_iget( config , GEN_KW_TAG_FORMAT_KEY , 0 , 0 ));    ensemble_config_init_GEN_PARAM( ensemble_config , config );  ensemble_config_init_GEN_DATA( ensemble_config , config );  ensemble_config_init_GEN_KW(ensemble_config , config );   ensemble_config_init_SURFACE( ensemble_config , config );    ensemble_config_init_SUMMARY( ensemble_config , config , refcase );    ensemble_config_init_FIELD( ensemble_config , config , grid );      /* Containers - this must come last, to ensure that the other nodes have been added. */  {    for (i=0; i < config_get_occurences(config , CONTAINER_KEY ); i++) {      const stringlist_type * container_kw_list = config_iget_stringlist_ref(config , CONTAINER_KEY , i);      const char * container_key = stringlist_iget( container_kw_list , 0 );      enkf_config_node_type * container_node = ensemble_config_add_container( ensemble_config , container_key );            for (int j= 1; j < stringlist_get_size( container_kw_list ); j++) {        const char * child_key = stringlist_iget( container_kw_list , j);         enkf_config_node_update_container( container_node , ensemble_config_get_node( ensemble_config , child_key ));      }    }  }  /*****************************************************************/}
开发者ID:danielfmva,项目名称:ert,代码行数:33,


示例2: stringlist_fprintf_fmt

void stringlist_fprintf_fmt(const stringlist_type * stringlist, const stringlist_type * fmt_list , FILE * stream) {  if (stringlist_get_size(stringlist) == stringlist_get_size( fmt_list )) {    int i;    for (i=0; i < stringlist_get_size( stringlist); i++)      fprintf(stream , stringlist_iget( fmt_list , i) , stringlist_iget( stringlist , i ));  } util_abort("%s: length of stringlist:%d   length of fmt_list:%d - must be equal /n",__func__ , stringlist_get_size( stringlist ) , stringlist_get_size( fmt_list ));}
开发者ID:akva2,项目名称:ert,代码行数:7,


示例3: enkf_main_init_case_from_existing_JOB

void * enkf_main_init_case_from_existing_JOB( void * self , const stringlist_type * args) {  enkf_main_type * enkf_main = enkf_main_safe_cast( self );  const char * source_case = stringlist_iget( args , 0 );  enkf_fs_type * source_fs = enkf_main_mount_alt_fs( enkf_main , source_case , true );  {    enkf_fs_type * target_fs;    if (stringlist_get_size(args) > 1) {      const char * current_case = enkf_main_get_current_fs(enkf_main);      const char * target_case = stringlist_iget( args , 1 );      if (0 != strcmp(current_case, target_case)) {        target_fs = enkf_main_mount_alt_fs( enkf_main , target_case , true );      } else        target_fs = enkf_fs_get_ref( enkf_main_get_fs(enkf_main) );  // Using get_ref so that we can unconditionally call decref() further down.    } else      target_fs = enkf_fs_get_ref( enkf_main_get_fs(enkf_main) );    // Using get_ref so that we can unconditionally call decref() further down.    enkf_main_init_case_from_existing(enkf_main, source_fs, 0, ANALYZED, target_fs);    enkf_fs_decref(target_fs);  }  enkf_fs_decref(source_fs);  return NULL;}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:25,


示例4: enkf_main_rank_on_data_JOB

void * enkf_main_rank_on_data_JOB(void * self, const stringlist_type * args) {  enkf_main_type * enkf_main = enkf_main_safe_cast( self );  const char * ranking_name  = stringlist_iget(args, 0);  const char * data_key      = stringlist_iget(args, 1);  bool valid = true;  bool sort_increasing       = stringlist_iget_as_bool(args, 2, &valid);  if (!valid) {    fprintf(stderr,"** Third argument /"sort increasing/" not recognized as bool value, job not started/n");    return NULL;  }  int report_step = (stringlist_get_size(args) > 3) ? stringlist_iget_as_int(args, 3, &valid) : enkf_main_get_history_length(enkf_main) ;  if (!valid) {    fprintf(stderr,"** Fourth argument /"step/" not recognized as integer value, job not started/n");    return NULL;  }  if (report_step < 0) {    fprintf(stderr,"** Negative report step, job not started/n");    return NULL;  }  enkf_main_rank_on_data(enkf_main, ranking_name, data_key, sort_increasing, report_step);  return NULL;}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:26,


示例5: enkf_main_std_scale_correlated_obs_JOB

void * enkf_main_std_scale_correlated_obs_JOB(void * self, const stringlist_type * args)  {  if (stringlist_get_size(args) > 0) {    enkf_main_type * enkf_main              = enkf_main_safe_cast( self );    int ensemble_size                       = enkf_main_get_ensemble_size(enkf_main);    enkf_fs_type * fs                       = enkf_main_get_fs( enkf_main );    enkf_obs_type * obs                     = enkf_main_get_obs( enkf_main );    int_vector_type * realizations          = int_vector_alloc(1, 0);    local_obsdata_type * obsdata = local_obsdata_alloc( "OBS-JOB" );    int_vector_init_range(realizations, 0, ensemble_size, 1);    for (int iarg = 0; iarg < stringlist_get_size(args); iarg++) {      const char * arg_key = stringlist_iget( args , iarg );      stringlist_type * key_list = enkf_obs_alloc_matching_keylist(obs, arg_key);      for (int iobs=0; iobs < stringlist_get_size( key_list ); iobs++) {        const char * obs_key = stringlist_iget( key_list , iobs);        const obs_vector_type * obs_vector = enkf_obs_get_vector(obs, obs_key);        local_obsdata_add_node( obsdata , obs_vector_alloc_local_node(obs_vector) );      }      stringlist_free( key_list );    }    if (local_obsdata_get_size(obsdata) > 0)      enkf_obs_scale_correlated_std(obs, fs, realizations, obsdata );    local_obsdata_free( obsdata );  }  return NULL;}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:31,


示例6: stringlist_alloc_joined_substring

char * stringlist_alloc_joined_substring( const stringlist_type * s , int start_index , int end_index , const char * sep ) {  if (start_index >= stringlist_get_size( s ))    return NULL;  {    char * string = NULL;    int i;    /* Start with allocating a string long enough to hold all the substrings. */    {      int sep_length   = strlen( sep );      int total_length = 0;      for (i=start_index; i < end_index; i++)        total_length += (strlen(stringlist_iget( s , i)) + sep_length);      total_length += (1 - sep_length);      string    = util_malloc( total_length * sizeof * string );      string[0] = '/0';    }    for (i = start_index; i < end_index; i ++) {      strcat( string , stringlist_iget( s , i));      if (i < (end_index - 1))        strcat( string , sep );    }    return string;  }}
开发者ID:akva2,项目名称:ert,代码行数:28,


示例7: stringlist_insert_stringlist_copy

void stringlist_insert_stringlist_copy(stringlist_type * stringlist, const stringlist_type * src, int pos) {  int size_old  = stringlist_get_size(stringlist);  /** Cannot use assert_index here. */  if(pos < 0 || pos > size_old)    util_abort("%s: Position %d is out of bounds. Min: 0 Max: %d/n", pos, size_old);  {  stringlist_type * start = stringlist_alloc_new();  stringlist_type * end   = stringlist_alloc_new();  stringlist_type * newList   = stringlist_alloc_new();  int i;  for( i=0; i<pos; i++)    stringlist_append_ref(start, stringlist_iget(stringlist, i));  for( i=pos; i<size_old; i++)    stringlist_append_ref(end  , stringlist_iget(stringlist, i));  stringlist_append_stringlist_copy(newList, start);  stringlist_append_stringlist_copy(newList, src  );  stringlist_append_stringlist_copy(newList, end  );  stringlist_clear(stringlist);  stringlist_append_stringlist_copy(stringlist, newList);  stringlist_free(newList);  stringlist_free(start);  stringlist_free(end);  }}
开发者ID:akva2,项目名称:ert,代码行数:30,


示例8: enkf_main_export_ranking_JOB

void * enkf_main_export_ranking_JOB(void * self, const stringlist_type * args) {  enkf_main_type * enkf_main = enkf_main_safe_cast( self );  const char * ranking_name  = stringlist_iget(args, 0);  const char * ranking_file  = stringlist_iget(args, 1);  enkf_main_export_ranking(enkf_main, ranking_name, ranking_file);  return NULL;}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:8,


示例9: misfit_ranking_fprintf

void misfit_ranking_fprintf( const misfit_ranking_type * misfit_ranking , const char * filename) {  FILE * stream                       = util_mkdir_fopen( filename , "w");  const int ens_size                  = misfit_ranking->ens_size;  const int * permutations            = misfit_ranking->sort_permutation;  double summed_up = 0.0;  {    // All this whitespace is finely tuned and highly significant ....     const char * key_fmt       = " %18s ";                                    const char * value_fmt     = " %10.3f %8.3f";    const char * start_fmt     = " %2d       %3d     %7.3f %8.3f";      hash_type * obs_hash       = vector_iget( misfit_ranking->ensemble , 0);    stringlist_type * obs_keys = hash_alloc_stringlist( obs_hash );    int num_obs                = stringlist_get_size( obs_keys );    int iobs;    int num_obs_total = num_obs * ens_size;    stringlist_sort( obs_keys , enkf_util_compare_keys__ );    fprintf(stream , "                       Overall  ");    for (iobs =0; iobs < num_obs; iobs++)       fprintf(stream , key_fmt , stringlist_iget( obs_keys , iobs ));    fprintf(stream , "/n");    fprintf(stream , "  #    Realization  Norm    Total");    for (iobs =0; iobs < num_obs; iobs++)       fprintf(stream , "       Norm    Total");        fprintf(stream , "/n");    for (int i = 0; i < ens_size; i++) {      int iens = permutations[i];      hash_type * obs_hash = vector_iget( misfit_ranking->ensemble , iens );      double total_value   = double_vector_iget( misfit_ranking->total , iens );      double normalized_misfit = sqrt(total_value / num_obs_total);      summed_up = summed_up+total_value;      fprintf(stream , start_fmt , i , iens , normalized_misfit , total_value);      for (iobs =0; iobs < num_obs; iobs++){        double single_value = hash_get_double( obs_hash , stringlist_iget( obs_keys , iobs ));        double single_value_normalized = sqrt(single_value / (num_obs_total));        fprintf(stream , value_fmt , single_value_normalized , single_value);      }      fprintf(stream , "/n");    }    double summed_up_normalized = sqrt(summed_up / (num_obs_total * ens_size));    fprintf(stream , "           All    %7.3f %8.3f" , summed_up_normalized , summed_up);    for (iobs = 0; iobs < num_obs; iobs++){      double single_value_summed_up = 0.0;            for (int i = 0; i < ens_size; i++) {          single_value_summed_up = single_value_summed_up + hash_get_double( obs_hash , stringlist_iget( obs_keys , iobs ));      }      double single_value_summed_up_normalized=sqrt(single_value_summed_up / (num_obs_total * ens_size));      fprintf(stream , value_fmt , single_value_summed_up_normalized , single_value_summed_up);    }    fprintf(stream , "/n");  }  fclose( stream );}
开发者ID:blattms,项目名称:ert,代码行数:56,


示例10: site_config_add_jobs

static void site_config_add_jobs(site_config_type * site_config , const config_type * config) {  int  i;    stringlist_type *item_list = config_alloc_complete_stringlist(config , INSTALL_JOB_KEY);  for (i=0; i < stringlist_get_size(item_list); i+=2)     site_config_install_job(site_config , stringlist_iget(item_list , i) , stringlist_iget(item_list , i + 1));  stringlist_free(item_list);}
开发者ID:akva2,项目名称:ResInsight,代码行数:10,


示例11: enkf_main_jobs_export_field

static void enkf_main_jobs_export_field(const enkf_main_type * enkf_main, const stringlist_type * args, field_file_format_type file_type) {  const char *      field            = stringlist_iget(args, 0);  const char *      file_name        = stringlist_iget(args, 1);  int               report_step      = 0;  util_sscanf_int(stringlist_iget(args,2), &report_step);  bool_vector_type * iactive = alloc_iactive_vector_from_range(args, 4, stringlist_get_size(args), enkf_main_get_ensemble_size(enkf_main));  enkf_main_export_field(enkf_main,field, file_name, iactive, file_type, report_step ) ;  bool_vector_free(iactive);}
开发者ID:chflo,项目名称:ert,代码行数:10,


示例12: ecl_sum_data_fread__

static void ecl_sum_data_fread__( ecl_sum_data_type * data , time_t load_end , const stringlist_type * filelist) {  ecl_file_enum file_type;  if (stringlist_get_size( filelist ) == 0)    util_abort("%s: internal error - function called with empty list of data files./n",__func__);    file_type = ecl_util_get_file_type( stringlist_iget( filelist , 0 ) , NULL , NULL);  if ((stringlist_get_size( filelist ) > 1) && (file_type != ECL_SUMMARY_FILE))    util_abort("%s: internal error - when calling with more than one file - you can not supply a unified file - come on?! /n",__func__);  {    int filenr;    if (file_type == ECL_SUMMARY_FILE) {            /* Not unified. */      for (filenr = 0; filenr < stringlist_get_size( filelist ); filenr++) {        const char * data_file = stringlist_iget( filelist , filenr);        ecl_file_enum file_type;        int report_step;        file_type = ecl_util_get_file_type( data_file , NULL , &report_step);        /**             ECLIPSE starts a report step by writing an empty summary            file, therefor we must verify that the ecl_file instance            returned by ecl_file_fread_alloc() is different from NULL            before adding it to the ecl_sum_data instance.        */        if (file_type != ECL_SUMMARY_FILE)          util_abort("%s: file:%s has wrong type /n",__func__ , data_file);        {          ecl_file_type * ecl_file = ecl_file_open( data_file );          ecl_sum_data_add_ecl_file( data , load_end , report_step , ecl_file , data->smspec);          ecl_file_close( ecl_file );        }      }    } else if (file_type == ECL_UNIFIED_SUMMARY_FILE) {      ecl_file_type * ecl_file = ecl_file_open( stringlist_iget(filelist ,0 ));      int report_step = 1;   /* <- ECLIPSE numbering - starting at 1. */      while (true) {        /*          Observe that there is a number discrepancy between ECLIPSE          and the ecl_file_select_smryblock() function. ECLIPSE          starts counting report steps at 1; whereas the first          SEQHDR block in the unified summary file is block zero (in          ert counting).         */        if (ecl_file_select_smryblock( ecl_file , report_step - 1)) {          ecl_sum_data_add_ecl_file( data , load_end , report_step , ecl_file , data->smspec);           report_step++;         } else break;       }      ecl_file_close( ecl_file );     } else       util_abort("%s: invalid file type:%s /n",__func__ , ecl_util_file_type_name(file_type ));   }   ecl_sum_data_build_index( data );}
开发者ID:akva2,项目名称:ResInsight,代码行数:55,


示例13: enkf_main_analysis_update_JOB

void * enkf_main_analysis_update_JOB( void * self , const stringlist_type * args) {  enkf_main_type * enkf_main = enkf_main_safe_cast( self );  enkf_fs_type   * source_fs = enkf_main_mount_alt_fs( enkf_main , stringlist_iget(args , 0 ) , false);  enkf_fs_type   * target_fs = enkf_main_mount_alt_fs( enkf_main , stringlist_iget(args , 1 ) , true);  enkf_main_smoother_update( enkf_main , source_fs , target_fs);  enkf_fs_decref( source_fs );  enkf_fs_decref( target_fs );  return NULL;}
开发者ID:Ensembles,项目名称:ert,代码行数:11,


示例14: stringlist_fprintf__

static void stringlist_fprintf__(const stringlist_type * stringlist, const char * sep , FILE * stream) {  int length = vector_get_size( stringlist->strings );  if (length > 0) {    int i;    for (i=0; i < length - 1; i++) {      const char * s = stringlist_iget(stringlist , i);      fprintf(stream , "%s%s", s  , sep);    }    fprintf(stream , "%s", stringlist_iget( stringlist , length - 1 ));  }}
开发者ID:akva2,项目名称:ert,代码行数:12,


示例15: sched_history_add_groups_welspecs

static void sched_history_add_groups_welspecs( sched_history_type * sched_history , const sched_kw_welspecs_type * welspecs , int report_step , const stringlist_type * wells, const stringlist_type * groups) {  for (int i = 0; i < stringlist_get_size( groups ); i++) {    const char * group_name  = stringlist_iget( groups , i );    const char * well_name   = stringlist_iget( wells , i );    well_history_type * well = sched_history_get_well( sched_history , well_name );    group_history_type * group;    if (!hash_has_key( sched_history->group_history , group_name ))       sched_history_add_group( sched_history , group_history_alloc( group_name , sched_history->time , report_step ) , NULL , report_step );        group = sched_history_get_group( sched_history , group_name );    group_history_add_child( group , well , well_name , report_step);  }}
开发者ID:Ensembles,项目名称:ert,代码行数:13,


示例16: output_table_init

void output_table_init( const ecl_sum_type * refcase, hash_type * output_table , const config_type * config ) {  int i,j;  for (i=0; i < config_get_occurences( config , "OUTPUT" ); i++) {    const stringlist_type * tokens = config_iget_stringlist_ref( config , "OUTPUT" , i);    const char * file              = stringlist_iget( tokens , 0 );    const char * format_string     = stringlist_iget( tokens , 1 );    output_type * output           = output_alloc( file , format_string );        /* All the keys are just added - without any check. */    for (j = 2; j < stringlist_get_size( tokens ); j++)      output_add_key( refcase , output , stringlist_iget( tokens , j));        hash_insert_hash_owned_ref( output_table , file , output , output_free__ );  }}
开发者ID:akva2,项目名称:ResInsight,代码行数:15,


示例17: enkf_main_analysis_enkf_update_JOB

void * enkf_main_analysis_enkf_update_JOB( void * self , const stringlist_type * args) {  enkf_main_type   * enkf_main = enkf_main_safe_cast( self );  enkf_fs_type * target_fs = enkf_main_get_fs( enkf_main );  int target_step;  int_vector_type * step_list;  // Argument 0: The number of the step to write to  if (stringlist_get_size(args) > 1)    util_sscanf_int(stringlist_iget( args , 1) , &target_step);  else    target_step = 0;  // Argument 1 - ??: The timesteps to use in the update  if (stringlist_get_size( args ) > 2) {    char * step_args = stringlist_alloc_joined_substring(args , 2 , stringlist_get_size(args) , " ");    step_list = string_util_alloc_active_list( step_args );    free( step_args );  } else    step_list = int_vector_alloc(1,target_step);  enkf_main_UPDATE( enkf_main , step_list , target_fs , target_step , SMOOTHER_UPDATE);  int_vector_free( step_list );  return NULL;}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:26,


示例18: ensemble_init

void ensemble_init( ensemble_type * ensemble , config_type * config) {  /*1 : Loading ensembles and settings from the config instance */  /*1a: Loading the eclipse summary cases. */  {    thread_pool_type * tp = thread_pool_alloc( LOAD_THREADS , true );    {      int i,j;      for (i=0; i < config_get_occurences( config , "CASE_LIST"); i++) {        const stringlist_type * case_list = config_iget_stringlist_ref( config , "CASE_LIST" , i );        for (j=0; j < stringlist_get_size( case_list ); j++)           ensemble_load_from_glob( ensemble , stringlist_iget( case_list , j ) , tp);      }    }    thread_pool_join( tp );    thread_pool_free( tp );  }    {    const sum_case_type * tmp = vector_iget_const( ensemble->data , 0 );    ensemble->refcase = tmp->ecl_sum;  }    /*1b: Other config settings */  if (config_item_set( config , "NUM_INTERP" ))    ensemble->num_interp  = config_iget_as_int( config , "NUM_INTERP" , 0 , 0 );      /*2: Remaining initialization */  ensemble_init_time_interp( ensemble );  if (vector_get_size( ensemble->data ) < MIN_SIZE )    util_exit("Sorry - quantiles make no sense with with < %d realizations; should have ~> 100./n" , MIN_SIZE);}
开发者ID:akva2,项目名称:ResInsight,代码行数:33,


示例19: summary_key_set_fread

bool summary_key_set_fread(summary_key_set_type * set, const char * filename) {    bool file_exists = false;    pthread_rwlock_wrlock( &set->rw_lock );    {        hash_clear(set->key_set);        if (util_file_exists(filename)) {            FILE * stream = util_fopen(filename, "r");            if (stream) {                stringlist_type * key_set = stringlist_fread_alloc(stream);                for (int i = 0; i < stringlist_get_size(key_set); i++) {                    hash_insert_int(set->key_set, stringlist_iget(key_set, i), 1);                }                stringlist_free(key_set);                fclose( stream );            } else {                util_abort("%s: failed to open: %s for reading /n",__func__ , filename );            }            file_exists = true;        }    }    pthread_rwlock_unlock( &set->rw_lock );    return file_exists;}
开发者ID:Ensembles,项目名称:ert,代码行数:25,


示例20: test_reverse

void test_reverse() {  const char *s0 = "AAA";  const char *s1 = "BBB";  const char *s2 = "CCC";  stringlist_type * s = stringlist_alloc_new();  stringlist_append_copy( s , s0 );  stringlist_append_copy( s , s1 );  stringlist_append_copy( s , s2 );  stringlist_reverse(s);  test_assert_string_equal( s2 , stringlist_iget(s , 0 ));  test_assert_string_equal( s1 , stringlist_iget(s , 1 ));  test_assert_string_equal( s0 , stringlist_iget(s , 2 ));}
开发者ID:OPM,项目名称:ResInsight,代码行数:16,


示例21: enkf_main_jobs_export_field

static void enkf_main_jobs_export_field(const enkf_main_type * enkf_main, const stringlist_type * args, field_file_format_type file_type) {  const char *      field            = stringlist_iget(args, 0);  const char *      file_name        = stringlist_iget(args, 1);  int               report_step      = 0;  util_sscanf_int(stringlist_iget(args,2), &report_step);  state_enum        state            = enkf_types_get_state_enum(stringlist_iget(args, 3));  if (BOTH == state) {      fprintf(stderr,"** Field export jobs only supports state_enum ANALYZED or FORECAST, not BOTH./n");      return;  }  bool_vector_type * iactive = alloc_iactive_vector_from_range(args, 4, stringlist_get_size(args), enkf_main_get_ensemble_size(enkf_main));  enkf_main_export_field(enkf_main,field, file_name, iactive, file_type, report_step, state) ;  bool_vector_free(iactive);}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:16,


示例22: enkf_main_smoother_JOB__

static void * enkf_main_smoother_JOB__( void * self , int iter , const stringlist_type * args ) {  enkf_main_type   * enkf_main = enkf_main_safe_cast( self );  int ens_size                 = enkf_main_get_ensemble_size( enkf_main );  bool_vector_type * iactive   = bool_vector_alloc( ens_size , true );  bool valid                   = true;  const char * target_case;  enkf_fs_type * target_fs     = enkf_main_get_fs( enkf_main );  // Argument 0: Which case to write to. Default current case.  if (stringlist_get_size(args)) {    target_case = stringlist_iget( args , 0 );    if (strcmp( target_case , CURRENT_CASE_STRING) == 0)      target_case = enkf_fs_get_case_name(target_fs);  } else    target_case = enkf_fs_get_case_name(target_fs);  //Argument 1: Rerun. Default false.  bool rerun = (stringlist_get_size(args) >= 2) ? stringlist_iget_as_bool(args, 1, &valid) : false;  if (!valid) {      fprintf(stderr, "** Warning: Function %s : Second argument must be a bool value. Exiting job/n", __func__);      return NULL;  }  enkf_main_run_smoother( enkf_main , target_case , iactive , iter , rerun);  bool_vector_free( iactive );  return NULL;}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:28,


示例23: enkf_main_create_case_JOB

void * enkf_main_create_case_JOB( void * self , const stringlist_type * args) {  enkf_main_type * enkf_main = enkf_main_safe_cast( self );  const char * new_case = stringlist_iget( args , 0 );  enkf_fs_type * fs = enkf_main_mount_alt_fs( enkf_main , new_case , true );  enkf_fs_decref( fs );  return NULL;}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:7,


示例24: ecl_grid_alloc

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void RifEclipseOutputFileTools::readGridDimensions(const QString& gridFileName, std::vector< std::vector<int> >& gridDimensions){    ecl_grid_type * grid         = ecl_grid_alloc(RiaStringEncodingTools::toNativeEncoded(gridFileName).data());                               // bootstrap ecl_grid instance    stringlist_type * lgr_names  = ecl_grid_alloc_lgr_name_list( grid );                                   // get a list of all the lgr names.    //printf("grid:%s has %d a total of %d lgr's /n", grid_filename , stringlist_get_size( lgr_names ));    for (int lgr_nr = 0; lgr_nr < stringlist_get_size( lgr_names); lgr_nr++)    {        ecl_grid_type * lgr_grid  = ecl_grid_get_lgr( grid , stringlist_iget( lgr_names , lgr_nr ));    // get the ecl_grid instance of the lgr - by name.        int nx,ny,nz,active_size;        ecl_grid_get_dims( lgr_grid , &nx , &ny , &nz , &active_size);                             // get some size info from this lgr.        std::vector<int> values;        values.push_back(nx);        values.push_back(ny);        values.push_back(nz);        values.push_back(active_size);        gridDimensions.push_back(values);    }    ecl_grid_free( grid );    stringlist_free( lgr_names );}
开发者ID:OPM,项目名称:ResInsight,代码行数:29,


示例25: misfit_ranking_alloc

misfit_ranking_type *  misfit_ranking_alloc(const misfit_ensemble_type * misfit_ensemble , const stringlist_type * sort_keys , const int_vector_type * steps, const char * ranking_key) {  const int ens_size = misfit_ensemble_get_ens_size( misfit_ensemble );  int iens;  misfit_ranking_type * ranking = misfit_ranking_alloc_empty(ens_size);    for (iens = 0; iens < ens_size; iens++) {    const misfit_member_type * misfit_member = misfit_ensemble_iget_member( misfit_ensemble , iens );  /* Lookup in the master ensemble. */        {      double iens_valid = true;      double total = 0;      hash_type * obs_hash = hash_alloc();      for (int ikey = 0; ikey < stringlist_get_size( sort_keys ); ikey++) {        const char * obs_key        = stringlist_iget( sort_keys , ikey );        if (misfit_member_has_ts( misfit_member , obs_key )) {          misfit_ts_type * ts = misfit_member_get_ts( misfit_member , obs_key );          double value        = misfit_ts_eval( ts , steps );  /* Sum up the misfit for this key - and these timesteps. */          hash_insert_double( obs_hash , obs_key , value);          total += value;        } else          iens_valid = true;      }      if (iens_valid)         misfit_ranking_iset( ranking , iens , obs_hash , total );      else        misfit_ranking_iset_invalid( ranking , iens );    }  }  ranking->sort_permutation = double_vector_alloc_sort_perm( ranking->total );  return ranking;}
开发者ID:blattms,项目名称:ert,代码行数:32,


示例26: custom_kw_config_deserialize

void custom_kw_config_deserialize(custom_kw_config_type * config, stringlist_type * config_set) {    pthread_rwlock_wrlock(& config->rw_lock);    {        custom_kw_config_reset__(config);        for (int i = 0; i < stringlist_get_size(config_set); i++) {            const char * items = stringlist_iget(config_set, i);            char key[128];            int index;            int is_double;            int count = sscanf(items, "%s %d %d", key, &index, &is_double);                        if (count == 3) {              hash_insert_int(config->custom_keys, key, index);              hash_insert_int(config->custom_key_types, key, is_double);            } else              util_abort("%s: internal error - deserialize failed/n",__func__);        }        config->undefined = false;        config->key_definition_file = util_alloc_string_copy("from storage"); //Todo: Handle this differently?    }    pthread_rwlock_unlock(& config->rw_lock);}
开发者ID:Ensembles,项目名称:ert,代码行数:25,


示例27: ensemble_config_init_SUMMARY

void ensemble_config_init_SUMMARY( ensemble_config_type * ensemble_config , const config_type * config , const ecl_sum_type * refcase) {  const config_content_item_type * item = config_get_content_item( config , SUMMARY_KEY );  if (item != NULL) {    int i;    for (i=0; i < config_content_item_get_size( item ); i++) {      const config_content_node_type * node = config_content_item_iget_node( item , i );      int j;      for (j= 0; j < config_content_node_get_size( node ); j++) {        const char * key = config_content_node_iget( node , j );                if (util_string_has_wildcard( key )) {          if (ensemble_config->refcase != NULL) {            int k;            stringlist_type * keys = stringlist_alloc_new ( );            ecl_sum_select_matching_general_var_list( ensemble_config->refcase , key , keys );   /* expanding the wildcard notatition with help of the refcase. */            for (k=0; k < stringlist_get_size( keys ); k++)               ensemble_config_add_summary(ensemble_config , stringlist_iget(keys , k) , LOAD_FAIL_SILENT );            stringlist_free( keys );          } else            util_exit("error: when using summary wildcards like: /"%s/" you must supply a valid refcase./n",key);        } else           ensemble_config_add_summary(ensemble_config , key , LOAD_FAIL_SILENT);      }    }  }}
开发者ID:danielfmva,项目名称:ert,代码行数:29,


示例28: findSummaryHeaderFileInfo

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------std::vector<std::string> RifEclipseSummaryTools::findSummaryDataFiles(const std::string& caseFile){    std::vector<std::string> fileNames;    std::string path;    std::string base;    findSummaryHeaderFileInfo(caseFile, NULL, &path, &base, NULL);    if (path.empty() || base.empty()) return fileNames;    char* header_file = NULL;    stringlist_type* summary_file_list = stringlist_alloc_new();    ecl_util_alloc_summary_files(path.data(), base.data(), NULL, &header_file, summary_file_list);    if (stringlist_get_size( summary_file_list ) > 0)    {        for (int i = 0; i < stringlist_get_size(summary_file_list); i++)        {            fileNames.push_back(stringlist_iget(summary_file_list, i));        }    }    util_safe_free(header_file);    stringlist_free(summary_file_list);    return fileNames;}
开发者ID:magnesj,项目名称:ResInsight,代码行数:30,


示例29: sched_history_fprintf

void sched_history_fprintf( const sched_history_type * sched_history , const stringlist_type * key_list , FILE * stream) {  int step = 1;  time_t start_time = time_t_vector_iget( sched_history->time , 0);  int total_length = bool_vector_size( sched_history->historical );  while (true) {    if (bool_vector_safe_iget( sched_history->historical , step)) {      {        int mday,month,year;        time_t t = time_t_vector_iget( sched_history->time , step );        double days = (t - start_time) * 1.0 / 86400;        util_set_date_values_utc( t , &mday , &month , &year);        //fprintf(stream , "%02d-%02d-%4d  " , mday , month , year );        fprintf(stream , " %5.0f " , days);      }            for (int ikey =0; ikey < stringlist_get_size( key_list ); ikey++)         fprintf(stream , "%16.3f " , sched_history_iget( sched_history , stringlist_iget( key_list , ikey) , step));            fprintf( stream, "/n");    } else      break; // We have completed the historical period - and switched to prediction    step++;    if (step == total_length)      break;  }}
开发者ID:Ensembles,项目名称:ert,代码行数:27,


示例30: output_add_key

static void output_add_key( const ecl_sum_type * refcase , output_type * output , const char * qkey) {  int tokens;  double  quantile;  char ** tmp;  char  * sum_key;  util_split_string( qkey , SUMMARY_JOIN , &tokens , &tmp);  if (tokens == 1)    util_exit("Hmmm - the key:%s is malformed - must be of the form SUMMARY_KEY:QUANTILE./n",qkey);  if (!util_sscanf_double( tmp[tokens - 1] , &quantile))    util_exit("Hmmmm - failed to interpret:%s as a quantile - must be a number (0,1)./n",tmp[tokens-1]);  if (quantile <= 0 || quantile >= 1.0)    util_exit("Invalid quantile value:%g - must be in interval (0,1)/n", quantile);  sum_key = util_alloc_joined_string( (const char **) tmp , tokens - 1 , SUMMARY_JOIN);  {    stringlist_type * matching_keys = stringlist_alloc_new();    int i;    ecl_sum_select_matching_general_var_list( refcase , sum_key , matching_keys );    for (i=0; i < stringlist_get_size( matching_keys ); i++)      vector_append_owned_ref( output->keys , quant_key_alloc( stringlist_iget( matching_keys , i ) , quantile) , quant_key_free__ );    if (stringlist_get_size( matching_keys ) == 0)      fprintf(stderr,"** Warning: No summary vectors matching:/'%s/' found?? /n", sum_key);    stringlist_free( matching_keys );  }  util_free_stringlist( tmp, tokens );}
开发者ID:YingfangZhou,项目名称:ert,代码行数:31,



注:本文中的stringlist_iget函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ stringmatchlen函数代码示例
C++ stringlist_get_size函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。