• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ read_double函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: return

PackageCanvas * PackageCanvas::read(char * & st, UmlCanvas * canvas, char * k) {
  if (!strcmp(k, "packagecanvas_ref"))
    return ((PackageCanvas *) dict_get(read_id(st), "packagecanvas", canvas));
  else if (!strcmp(k, "packagecanvas")) {
    int id = read_id(st);
    BrowserNode * br = BrowserPackage::read_ref(st);
    UmlColor color = UmlDefaultColor;
    Uml3States in_tab = UmlDefaultState;
    ShowContextMode context = DefaultShowContextMode;
    Uml3States show_stereotype_properties = UmlDefaultState;;
    
    k = read_keyword(st);
    
    if (!strcmp(k, "name_in_tab")) {
      in_tab = state(read_keyword(st));
      k = read_keyword(st);
    }
    
    if (!strcmp(k, "show_context_mode")) {
      context = context_mode(read_keyword(st));
      k = read_keyword(st);
    }

    if (!strcmp(k, "show_stereotype_properties")) {
      show_stereotype_properties = state(read_keyword(st));
      k = read_keyword(st);
    }

    read_color(st, "color", color, k);
    
    if (strcmp(k, "xyzwh"))
      wrong_keyword(k, "xyzwh");
    
    int x = (int) read_double(st);
    PackageCanvas * result =
      new PackageCanvas(br, canvas, x, (int) read_double(st), id);
    
    read_zwh(st, result);
    
    if (read_file_format() >= 58) {
      k = read_keyword(st);
      result->read_stereotype_property(st, k);	// updates k
      if (strcmp(k, "end"))
	wrong_keyword(k, "end");
    }
    
    result->name_in_tab = in_tab;
    result->show_context_mode = context;
    result->show_stereotype_properties = show_stereotype_properties;
    result->itscolor = color;
    result->check_size();
    result->set_center100();
    result->show();
    result->check_stereotypeproperties();
    
    return result;
  }
  else
    return 0;
}
开发者ID:kralf,项目名称:bouml,代码行数:60,代码来源:PackageCanvas.cpp


示例2: readParameters

int readParameters(int *xlength, double *tau, double *velocityWall, int *timesteps, int *timestepsPerPlotting, int argc, char *argv[]){
        // argument handling
        if (argc !=2 ) {
                printf("When running the simulation, please give a valid file name to read from!\n");
                return 1;
        }

	// get file name
	const char *FileName = NULL;
	FileName = argv[1];

	// read parameters, using read functions from helper
	read_int ( FileName, "xlength", xlength );

	read_double ( FileName, "tau", tau );

	read_double ( FileName, "velocityWallx", &velocityWall[0] );
	read_double ( FileName, "velocityWally", &velocityWall[1] );
	read_double ( FileName, "velocityWallz", &velocityWall[2] );

	read_int ( FileName, "timesteps", timesteps );
	read_int ( FileName, "timestepsPerPlotting", timestepsPerPlotting );

	return 0;
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:25,代码来源:initLB.c


示例3: gs_image_size_sub

bool
gs_image_size_sub (string buf, int& w_pt, int& h_pt) {
  int pos= search_forwards ("\n%%BoundingBox: ", buf);
  if (pos < 0) pos = search_forwards ("%%BoundingBox: ", buf);
  if (pos < 0) return false;
  if (buf[pos] == '\n') pos++;
  bool ok= read (buf, pos, "%%BoundingBox: ");
  double X1, Y1, X2, Y2;
  int x1, y1, x2, y2;
  skip_spaces (buf, pos);
  ok= read_double (buf, pos, X1) && ok;
  x1= (int) floor (X1);
  skip_spaces (buf, pos);
  ok= read_double (buf, pos, Y1) && ok;
  y1= (int) floor (Y1);
  skip_spaces (buf, pos);
  ok= read_double (buf, pos, X2) && ok;
  x2= (int) ceil (X2);
  skip_spaces (buf, pos);
  ok= read_double (buf, pos, Y2) && ok;
  y2= (int) ceil (Y2);
  if (!ok) return false;
  w_pt= x2-x1;
  h_pt= y2-y1;
  return true;
}
开发者ID:niujiashu,项目名称:texmacs-mirror,代码行数:26,代码来源:gs_utilities.cpp


示例4: return

AssocContainCanvas * AssocContainCanvas::read(char * & st, UmlCanvas * canvas, char * k)
{
  if (!strcmp(k, "containcanvas_ref"))
    return ((AssocContainCanvas *) dict_get(read_id(st), "contain canvas", canvas));
  else if (!strcmp(k, "containcanvas")) {
    int id = read_id(st);    
    LineGeometry geo;
    bool fixed;
    
    k = read_keyword(st);	// may read id
    if (!strcmp(k, "geometry")) {
      geo = line_geometry(read_keyword(st));
      k = read_keyword(st);
      if (! strcmp(k, "unfixed")) {
	k = read_keyword(st);
	fixed = FALSE;
      }
      else
	fixed = TRUE;
    }
    else {
      geo = NoGeometry;
      fixed = FALSE;
    }
    
    float dbegin;
    float dend;

    if (! strcmp(k, "decenter_begin")) {
      dbegin = read_double(st) / 1000;
      k = read_keyword(st);
    }
    else
      dbegin = -1;

    if (! strcmp(k, "decenter_end")) {
      dend = read_double(st) / 1000;
      k = read_keyword(st);
    }
    else
      dend = -1;
    
    unread_keyword(k, st);
    
    AssocContainCanvas * r = (AssocContainCanvas *)
      read_list(st, canvas, UmlContain, geo, fixed, dbegin, dend, id, &make);
    
    // remove association between components available in the
    // 2.0 deployment diagrams
    if (r->begin->type() == UmlComponent)
      Undefined.append(r);
    else if (read_file_format() == 30)
      // to remove redondant transitions made by release 2.22
      RelsToCheck.append(r);
    
    return r;
  }
  else
    return 0;
}
开发者ID:SciBoy,项目名称:douml,代码行数:60,代码来源:AssocContainCanvas.cpp


示例5: collect_memory

static void
collect_memory (CockpitSamples *samples,
                const gchar *path,
                const gchar *cgroup)
{
  double mem_usage_in_bytes;
  double mem_limit_in_bytes;
  double memsw_usage_in_bytes;
  double memsw_limit_in_bytes;

  if (access (path, F_OK) == 0)
    {
      mem_usage_in_bytes = read_double (path, "memory.usage_in_bytes");
      mem_limit_in_bytes = read_double (path, "memory.limit_in_bytes");
      memsw_usage_in_bytes = read_double (path, "memory.memsw.usage_in_bytes");
      memsw_limit_in_bytes = read_double (path, "memory.memsw.limit_in_bytes");

      /* If at max for arch, then unlimited => zero */
      if (mem_limit_in_bytes == (double)G_MAXSIZE ||
          mem_limit_in_bytes == (double)G_MAXSSIZE)
        mem_limit_in_bytes = 0;
      if (memsw_limit_in_bytes == (double)G_MAXSIZE ||
          memsw_limit_in_bytes == (double)G_MAXSSIZE)
        memsw_limit_in_bytes = 0;

      cockpit_samples_sample (samples, "cgroup.memory.usage", cgroup, mem_usage_in_bytes);
      cockpit_samples_sample (samples, "cgroup.memory.limit", cgroup, mem_limit_in_bytes);
      cockpit_samples_sample (samples, "cgroup.memory.sw-usage", cgroup, memsw_usage_in_bytes);
      cockpit_samples_sample (samples, "cgroup.memory.sw-limit", cgroup, memsw_limit_in_bytes);
    }
}
开发者ID:AmartC,项目名称:cockpit,代码行数:31,代码来源:cockpitcgroupsamples.c


示例6: readParameters

/**
 * Reads the parameters for the lid driven cavity scenario from a config file.
 * Throws an error if number of program arguments does not equal 2.
 **/
int readParameters(
    int *xlength,                       /* reads domain size. Parameter name: "xlength" */
    double *tau,                        /* relaxation parameter tau. Parameter name: "tau" */
    double *velocityWall,               /* velocity of the lid. Parameter name: "characteristicvelocity" */
    int *timesteps,                     /* number of timesteps. Parameter name: "timesteps" */
    int *timestepsPerPlotting,          /* timesteps between subsequent VTK plots. Parameter name: "vtkoutput" */
    int argc,                           /* number of arguments. Should equal 2 (program + name of config file */
    char *argv[]                        /* argv[1] shall contain the path to the config file */
    ){

    const char *szFileName = argv[1];

    if (argc != 2) {
        ERROR("number of arguments is incorrect");
    }

    read_int(szFileName, "xlength", xlength);
    read_double(szFileName,"tau", tau);
    read_double(szFileName, "characteristicvelocity_x", &velocityWall[0]);
    read_double(szFileName, "characteristicvelocity_y", &velocityWall[1]);
    read_double(szFileName, "characteristicvelocity_z", &velocityWall[2]);
    read_int(szFileName, "timesteps", timesteps);
    read_int(szFileName, "vtkoutput", timestepsPerPlotting);

    return 0;
}
开发者ID:nathanwbrei,项目名称:cfdlab,代码行数:30,代码来源:initLB.c


示例7: read_uint8

void 
Squeezer_file_header_t::read_from_file(FILE * in)
{
    file_type_mark[0] = read_uint8(in);
    file_type_mark[1] = read_uint8(in);
    file_type_mark[2] = read_uint8(in);
    file_type_mark[3] = read_uint8(in);

    floating_point_check = read_double(in);

    date_year = read_uint16(in);
    date_month = read_uint8(in);
    date_day = read_uint8(in);

    time_hour = read_uint8(in);
    time_minute = read_uint8(in);
    time_second = read_uint8(in);

    radiometer.horn = read_uint8(in);
    radiometer.arm = read_uint8(in);
    od = read_uint16(in);
    first_obt = read_double(in);
    last_obt = read_double(in);
    first_scet_in_ms = read_double(in);
    last_scet_in_ms = read_double(in);
    number_of_chunks = read_uint32(in);
}
开发者ID:ziotom78,项目名称:squeezer,代码行数:27,代码来源:data_structures.cpp


示例8: sum

template<> std::unique_ptr<Result>
DataServer::command(ReadSalesStatsUserCmd* cmd)
{
    if( cmd->user > 0 ) {
        sql << "select emp, sum(amt), count(amt) as sale_count from sales where amt > 0 and emp = " << cmd->user;
    }
    else {
        sql << "select distinct on (emp) emp, sum(amt), count(amt) as sale_count from sales where amt > 0;";
    }
    run_sql();

    std::unique_ptr<Result> result(new Result);

    for( int i = 0; i < tuple_count(); i++ ) {
        Item* sale_stat = new Item;
        sale_stat->push_property("user", read_int(i, "emp"));
        sale_stat->push_property("total", read_double(i, "sum"));
        sale_stat->push_property("sale_count", read_double(i, "sale_count"));
        result->items.push_back( std::unique_ptr<Item>(sale_stat) );
    }

    clr_sql();

    return result;
}
开发者ID:ballercat,项目名称:pos_qt48,代码行数:25,代码来源:server_reports_commands.cpp


示例9: return

DeploymentNodeCanvas * DeploymentNodeCanvas::read(char * & st, UmlCanvas * canvas, char * k) {
  if (!strcmp(k, "deploymentnodecanvas_ref"))
    return ((DeploymentNodeCanvas *) dict_get(read_id(st), "deploymentnodecanvas", canvas));
  else if (!strcmp(k, "deploymentnodecanvas")) {
    int id = read_id(st);
    BrowserNode * br = BrowserDeploymentNode::read_ref(st);
    QString iname;
    Uml3States write_horizontally = UmlDefaultState;
    Uml3States show_stereotype_properties = UmlDefaultState;
    
    k = read_keyword(st);
    
    if (!strcmp(k, "name")) {
      iname = read_string(st);
      k = read_keyword(st);
    }
    if (!strcmp(k, "write_horizontally") ||
	!strcmp(k, "write_horizontaly")) {
      write_horizontally = state(read_keyword(st));
      k = read_keyword(st);
    }
    if (!strcmp(k, "show_stereotype_properties")) {
      show_stereotype_properties = state(read_keyword(st));
      k = read_keyword(st);
    }
    
    UmlColor color = UmlDefaultColor;
    
    read_color(st, "color", color, k);
    
    if (strcmp(k, "xyzwh"))
      wrong_keyword(k, "xyzwh");
    
    int x = (int) read_double(st);
    DeploymentNodeCanvas * result =
      new DeploymentNodeCanvas(br, canvas, x, (int) read_double(st), id);
    
    read_zwh(st, result);
    
    if (read_file_format() >= 58) {
      k = read_keyword(st);
      result->read_stereotype_property(st, k);	// updates k
      if (strcmp(k, "end"))
	wrong_keyword(k, "end");
    }
    
    result->iname = iname;
    result->write_horizontally = write_horizontally;
    result->show_stereotype_properties = show_stereotype_properties;
    result->itscolor = color;
    result->check_size();
    result->set_center100();
    result->show();
    result->check_stereotypeproperties();
    
    return result;
  }
  else
    return 0;
}
开发者ID:SciBoy,项目名称:douml,代码行数:60,代码来源:DeploymentNodeCanvas.cpp


示例10: read_double

void
Error_t::read_from_file(FILE * in)
{
    min_abs_error = read_double(in);
    max_abs_error = read_double(in);
    mean_abs_error = read_double(in);
    mean_error = read_double(in);
}
开发者ID:ziotom78,项目名称:squeezer,代码行数:8,代码来源:data_structures.cpp


示例11: read_point

 void read_point(boost::ptr_vector<geometry_type> & paths)
 {
     geometry_type* pt = new geometry_type(Point);
     double x = read_double();
     double y = read_double();
     pt->move_to(x, y);
     paths.push_back(pt);
 }
开发者ID:rjw57,项目名称:mapnik,代码行数:8,代码来源:wkb.cpp


示例12: read_point

 mapnik::geometry::point<double> read_point()
 {
     double x = read_double();
     double y = read_double();
     if (Z) pos_ += 8;
     if (M) pos_ += 8;
     return mapnik::geometry::point<double>(x, y);
 }
开发者ID:bblu,项目名称:mapnik,代码行数:8,代码来源:wkb.cpp


示例13: read_point

 geometry_ptr read_point()
 {
     geometry_ptr pt(new point<vertex2d>(srid_));
     double x = read_double();
     double y = read_double();
     pt->move_to(x,y);
     return pt;
 }
开发者ID:BackupTheBerlios,项目名称:mapnik-svn,代码行数:8,代码来源:wkb.cpp


示例14: read_point

 void read_point(boost::ptr_vector<geometry_type> & paths)
 {
     double x = read_double();
     double y = read_double();
     std::unique_ptr<geometry_type> pt(new geometry_type(geometry_type::types::Point));
     pt->move_to(x, y);
     paths.push_back(pt.release());
 }
开发者ID:GISpecialist,项目名称:mapnik,代码行数:8,代码来源:wkb.cpp


示例15: read_variable_count_record

static readstat_error_t read_variable_count_record(readstat_por_ctx_t *ctx) {
    double value;
    if (read_double(ctx, &value) == -1) {
        return READSTAT_ERROR_PARSE;
    }
    ctx->var_count = (int)value;
    ctx->varinfo = calloc(ctx->var_count, sizeof(spss_varinfo_t));
    if (read_double(ctx, NULL) == -1) {
        return READSTAT_ERROR_PARSE;
    }
    return READSTAT_OK;
}
开发者ID:vasanthgx,项目名称:haven,代码行数:12,代码来源:readstat_por.c


示例16: read_multipoint

 geometry_ptr read_multipoint()
 {
     geometry_ptr pt(new point<vertex2d>(srid_));
     int num_points = read_integer();
     for (int i=0;i<num_points;++i) 
     {
         pos_+=5; 
         double x = read_double();
         double y = read_double();
         pt->move_to(x,y);
     }
     return pt; 
 }
开发者ID:BackupTheBerlios,项目名称:mapnik-svn,代码行数:13,代码来源:wkb.cpp


示例17: read_value_label_record

static readstat_error_t read_value_label_record(readstat_por_ctx_t *ctx) {
    double dval;
    int i;
    char string[256];
    int count = 0, label_count = 0;
    char label_name_buf[256];
    char label_buf[256];
    snprintf(label_name_buf, sizeof(label_name_buf), POR_LABEL_NAME_PREFIX "%d", ctx->labels_offset);
    readstat_types_t value_type = READSTAT_TYPE_DOUBLE;
    if (read_double(ctx, &dval) == -1) {
        return READSTAT_ERROR_PARSE;
    }
    count = (int)dval;
    for (i=0; i<count; i++) {
        if (read_string(ctx, string, sizeof(string)) == -1) {
            return READSTAT_ERROR_PARSE;
        }
        spss_varinfo_t *info = (spss_varinfo_t *)ck_str_hash_lookup(string, ctx->var_dict);
        if (info) {
            value_type = info->type;
            info->labels_index = ctx->labels_offset;
        }
    }
    if (read_double(ctx, &dval) == -1) {
        return READSTAT_ERROR_PARSE;
    }
    label_count = (int)dval;
    for (i=0; i<label_count; i++) {
        readstat_value_t value = { .type = value_type };
        if (value_type == READSTAT_TYPE_STRING) {
            if (read_string(ctx, string, sizeof(string)) == -1) {
                return READSTAT_ERROR_PARSE;
            }
            if (read_string(ctx, label_buf, sizeof(label_buf)) == -1) {
                return READSTAT_ERROR_PARSE;
            }
            value.v.string_value = string;
        } else {
            if (read_double(ctx, &dval) == -1) {
                return READSTAT_ERROR_PARSE;
            }
            if (read_string(ctx, label_buf, sizeof(label_buf)) == -1) {
                return READSTAT_ERROR_PARSE;
            }
            value.v.double_value = dval;
        }
        ctx->value_label_handler(label_name_buf, value, label_buf, ctx->user_ctx);
    }
    ctx->labels_offset++;
    return READSTAT_OK;
}
开发者ID:vasanthgx,项目名称:haven,代码行数:51,代码来源:readstat_por.c


示例18: read_vars

ifstream* CovOptimData::read(const char* filename, CovOptimData& cov, std::stack<unsigned int>& format_id, std::stack<unsigned int>& format_version) {

	ifstream* f = CovList::read(filename, cov, format_id, format_version);

	if (format_id.empty() || format_id.top()!=subformat_number || format_version.top()!=FORMAT_VERSION) {
		cov.data->_optim_optimizer_status = (unsigned int) Optimizer::SUCCESS;
		cov.data->_optim_is_extended_space = false;
		cov.data->_optim_uplo = NEG_INFINITY;
		cov.data->_optim_loup = POS_INFINITY;
		cov.data->_optim_loup_point.resize((int) cov.n);
		cov.data->_optim_loup_point = IntervalVector::empty(cov.n);
		cov.data->_optim_time = -1;
		cov.data->_optim_nb_cells = 0;
	}
	else {
		format_id.pop();
		format_version.pop();

		read_vars(*f, cov.n, cov.data->_optim_var_names);

		unsigned int status = read_pos_int(*f);

		switch (status) {
		case 0: cov.data->_optim_optimizer_status = (unsigned int) Optimizer::SUCCESS;           break;
		case 1: cov.data->_optim_optimizer_status = (unsigned int) Optimizer::INFEASIBLE;        break;
		case 2: cov.data->_optim_optimizer_status = (unsigned int) Optimizer::NO_FEASIBLE_FOUND; break;
		case 3: cov.data->_optim_optimizer_status = (unsigned int) Optimizer::UNBOUNDED_OBJ;     break;
		case 4: cov.data->_optim_optimizer_status = (unsigned int) Optimizer::TIME_OUT;     		break;
		case 5: cov.data->_optim_optimizer_status = (unsigned int) Optimizer::UNREACHED_PREC;    break;
		default: ibex_error("[CovOptimData]: invalid optimizer status.");
		}

		cov.data->_optim_is_extended_space = (bool) read_pos_int(*f);
		cov.data->_optim_uplo              = read_double(*f);
		cov.data->_optim_uplo_of_epsboxes  = read_double(*f);
		cov.data->_optim_loup              = read_double(*f);

		unsigned int loup_found   = read_pos_int(*f);
		unsigned int nb_var   = cov.is_extended_space() ? cov.n-1 : cov.n;
		cov.data->_optim_loup_point.resize((int) nb_var);
		// TODO: we assume here that the goal var is n-1
		cov.data->_optim_loup_point 		  = loup_found==1? cov[0].subvector(0,nb_var-1) : IntervalVector::empty(nb_var);

		cov.data->_optim_time              = read_double(*f);
		cov.data->_optim_nb_cells          = read_pos_int(*f);
	}

	return f;
}
开发者ID:ibex-team,项目名称:ibex-lib,代码行数:49,代码来源:ibex_CovOptimData.cpp


示例19: read_double

ArrowPointCanvas * ArrowPointCanvas::read(char *& st, UmlCanvas * canvas,
                                          char * k)
{
    if (strcmp(k, "point"))
        return 0;

    int x = (int) read_double(st);

    ArrowPointCanvas * result =
            new ArrowPointCanvas(canvas, x, (int) read_double(st));

    result->show();

    return result;
}
开发者ID:gilbertoca,项目名称:douml,代码行数:15,代码来源:ArrowPointCanvas.cpp


示例20: the_canvas

void ComponentDiagramView::read(char * st, char * k) {
  UmlCanvas * canvas = the_canvas();
  
  // reads first component package icons notes junctions text and images
  while (ComponentCanvas::read(st, canvas, k) ||
	 NoteCanvas::read(st, canvas, k) ||
	 TextCanvas::read(st, canvas, k) ||
	 IconCanvas::read(st, canvas, k) ||
	 PackageCanvas::read(st, canvas, k) ||
	 FragmentCanvas::read(st, canvas, k) ||
	 ArrowJunctionCanvas::read(st, canvas, k) ||
	 ImageCanvas::read(st, canvas, k))
    k = read_keyword(st);
  
  // then reads relations and anchors
  ArrowCanvas * a;
  
  while (((a = ArrowCanvas::read(st, canvas, k)) != 0) ||
	 ((a = SimpleRelationCanvas::read(st, canvas, k)) != 0)) {
    a->get_start()->check_line(a);
    k = read_keyword(st);
  }
  
  if (!strcmp(k, "preferred_whz") || !strcmp(k, "prefered_whz")) {
    preferred_size.setWidth(read_unsigned(st));
    preferred_size.setHeight(read_unsigned(st));
    preferred_zoom = read_double(st);
    k = read_keyword(st);
  }
  
  if (strcmp(k, "end"))
    wrong_keyword(k, "end");
}
开发者ID:kralf,项目名称:bouml,代码行数:33,代码来源:ComponentDiagramView.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ read_eeprom函数代码示例发布时间:2022-05-30
下一篇:
C++ read_directory函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap