当前位置: 首页>>代码示例>>C++>>正文


C++ auto_vector::size方法代码示例

本文整理汇总了C++中auto_vector::size方法的典型用法代码示例。如果您正苦于以下问题:C++ auto_vector::size方法的具体用法?C++ auto_vector::size怎么用?C++ auto_vector::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在auto_vector的用法示例。


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

示例1: nest

bool 
ChemistryMulti::check (const Scope& scope, const Geometry& geo,
		       const Soil& soil, const SoilWater& soil_water,
		       const SoilHeat& soil_heat, const Chemistry& chemistry,
		       Treelog& msg) const
{ 
  bool ok = true; 
  for (size_t c = 0; c < combine.size (); c++)
    {
      Treelog::Open nest (msg, "Chemistry: '" + combine[c]->objid  + "'");
      if (!combine[c]->check (scope, geo, soil, soil_water, soil_heat,
                              chemistry, msg))
	ok = false;
    }

  // Check for duplicate chemicals.
  std::map<symbol, size_t> found;
  for (size_t i = 0; i < chemicals.size (); i++)
    {
      const symbol type = chemicals[i]->objid;
      std::map<symbol, size_t>::const_iterator f = found.find (type);
      if (f != found.end ())
	{
	  std::ostringstream tmp;
	  tmp << "Chemical '" << type << "' definded in multiple chemistries:";
	  for (size_t j = 0; j < combine.size (); j++)
	    if (combine[j]->know (type))
	      tmp << " '" << combine[j]->objid << "'";
	  msg.error (tmp.str ());
	  ok = false;
	}
      found[type] = i;
    }
  return ok;
}
开发者ID:perabrahamsen,项目名称:daisy-model,代码行数:35,代码来源:chemistry_multi.C

示例2: has_attribute

  bool has_attribute (const symbol name) const
  { 
    bool missing = false;
    for (size_t i = 0; i < layers.size (); i++)
      if (!layers[i]->horizon->has_attribute (name))
	missing = true;
    for (size_t i = 0; i < zones.size (); i++)
      if (!zones[i]->horizon->has_attribute (name))
	missing = true;
    return !missing;
  }
开发者ID:pamoakoy,项目名称:daisy-model,代码行数:11,代码来源:soil.C

示例3:

void 
ChemistryMulti::mass_balance (const Geometry& geo, 
                              const SoilWater& soil_water) const
{
  for (size_t c = 0; c < combine.size (); c++)
    combine[c]->mass_balance (geo, soil_water); 
}
开发者ID:perabrahamsen,项目名称:daisy-model,代码行数:7,代码来源:chemistry_multi.C

示例4: output

void ErrorEstimatorImpl::output(std::ostream& os) const
{
    os << "[ErrorEstimator] iterations:" << iterationCount_ <<
        " error:" << error_ << endl;
    for (int i=0; i<(int)massSpreads_.size(); i++)
        os << "  " << *massSpreads_[i] << endl;
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:7,代码来源:ErrorEstimator.cpp

示例5: massSpread

const MassSpread* ErrorEstimatorImpl::massSpread(int index) const
{
    if (index < 0 || index >= (int)massSpreads_.size())
        throw out_of_range("[ErrorEstimatorImpl::massSpread] Index out of range.");

    return massSpreads_[index];
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:7,代码来源:ErrorEstimator.cpp

示例6: paintColumns

    void paintColumns()
	{
	for(size_t i=0;i< columns.size();++i)
	    {

	    }
	}
开发者ID:BioWu,项目名称:variationtoolkit,代码行数:7,代码来源:angelheart.cpp

示例7:

void 
Movement1D::initialize_derived (const Soil& soil,
                                const Groundwater& groundwater,
                                bool has_macropores, Treelog& msg)
{
  TREELOG_MODEL (msg);

  for (size_t i = 0; i < matrix_water.size (); i++)
    matrix_water[i]->has_macropores (has_macropores);
}
开发者ID:pamoakoy,项目名称:daisy-model,代码行数:10,代码来源:movement_1D.C

示例8: loop

    void loop()
	{
	rows.push_back(new Column);
	rows.back()->label.assign("CHROM");
	rows.push_back(new Column);
	rows.back()->label.assign("POS");
	rows.push_back(new Column);
	rows.back()->label.assign("ID");
	rows.push_back(new Column);
	rows.back()->label.assign("REF");
	rows.push_back(new Column);
	rows.back()->label.assign("ALT");
	for(int i=0;i< samples.size();++i)
	    {
	    Sample* sample=samples.at(i);
	    rows.push_back(new Column);
	    rows.back()->label.assign(sample->name).append(":QUAL");
	    rows.push_back(new Column);
	    rows.back()->label.assign(sample->name).append(":FILTER");
	    rows.push_back(new Column);
	    rows.back()->label.assign(sample->name).append(":INFO");
	    rows.push_back(new Column);
	    rows.back()->label.assign(sample->name).append(":FORMAT");
	    rows.push_back(new Column);
	    rows.back()->label.assign(sample->name).append(":CALL");
	    }


	screen=Screen::startup();
	screen->border();
	screen->refresh();
	for(;;)
	    {
	    int c=screen->getch();
	    switch(c)
		{
		case 'q':
		    {
		    break;
		    }
		case
		}
	    }

	Screen::shutdown();
	}
开发者ID:BioWu,项目名称:variationtoolkit,代码行数:46,代码来源:angelheart.cpp

示例9: nest

void 
Movement1D::tick_water (const Geometry1D& geo,
                        const Soil& soil, const SoilHeat& soil_heat, 
                        Surface& surface, Groundwater& groundwater,
                        const std::vector<double>& S,
                        std::vector<double>& h_old,
                        const std::vector<double>& Theta_old,
                        const std::vector<double>& h_ice,
                        std::vector<double>& h,
                        std::vector<double>& Theta,
                        std::vector<double>& q,
                        std::vector<double>& q_p,
                        const double dt, 
                        Treelog& msg)
{
  const size_t top_edge = 0U;
  const size_t bottom_edge = geo.edge_size () - 1U;

  // Limit for groundwater table.
  size_t last  = soil.size () - 1;

  // Limit for ridging.
  const size_t first = (surface.top_type (geo, 0U) == Surface::soil)
    ? surface.last_cell (geo, 0U) 
    : 0U;
  // Calculate matrix flow next.

  for (size_t m = 0; m < matrix_water.size (); m++)
    {
      water_attempt (m);
      Treelog::Open nest (msg, matrix_water[m]->name);
      try
        {
          matrix_water[m]->tick (msg, geo, soil, soil_heat,
                                 first, surface, top_edge, 
                                 last, groundwater, bottom_edge,
                                 S, h_old, Theta_old, h_ice, h, Theta, 0U, q, 
                                 dt);

          for (size_t i = last + 2; i <= soil.size (); i++)
            {
              q[i] = q[i-1];
              q_p[i] = q_p[i-1];
            }

          // Update surface and groundwater reservoirs.
          surface.accept_top (q[0] * dt, geo, 0U, dt, msg);
          surface.update_pond_average (geo);
          const double q_down = q[soil.size ()] + q_p[soil.size ()];
          groundwater.accept_bottom (q_down * dt, geo, soil.size ());
          if (m > 0)
            msg.debug ("Reserve model succeeded");
          return;
        }
      catch (const char* error)
        {
          msg.debug (std::string ("UZ problem: ") + error);
        }
      catch (const std::string& error)
        {
          msg.debug (std::string ("UZ trouble: ") + error);
        }
      
      water_failure (m);
    }
  throw "Water matrix transport failed"; 
}
开发者ID:pamoakoy,项目名称:daisy-model,代码行数:67,代码来源:movement_1D.C

示例10: main

	int main(int argc,char** argv)
	    {
	    const char* exonFile=0;
	    int optind=1;
	    char* faidxfile=NULL;
	    while(optind < argc)
		{
		if(strcmp(argv[optind],"-h")==0)
		    {
		    this->usage(cerr,argc,argv);
		    return(EXIT_FAILURE);
		    }
		else if(strcmp(argv[optind],"-f")==0 && optind+1< argc)
		    {
		    faidxfile = argv[++optind];
		    }
		else if(strcmp(argv[optind],"-g")==0 && optind+1< argc)
		    {
		    exonFile=argv[++optind];
		    }
		else if(strcmp(argv[optind],"--")==0)
		    {
		    ++optind;
		    break;
		    }
		else if(argv[optind][0]=='-')
		    {
		    cerr << "unknown option '" << argv[optind]<< "'" << endl;
		    this->usage(cerr,argc,argv);
		    return EXIT_FAILURE;
		    }
		else
		    {
		    break;
		    }
		++optind;
		}
	    if(faidxfile==0)
		{
		cerr << "no fasta genome defined." << endl;
		this->usage(cerr,argc,argv);
		return EXIT_FAILURE;
		}
	    this->faidx.reset(new IndexedFasta(faidxfile));





	    if(exonFile==0)
		{
		cerr << "no bed for exons defined." << endl;
		this->usage(cerr,argc,argv);
		return EXIT_FAILURE;
		}



	    if(optind==argc)
		{
		cerr << "BAM files missing"<< endl;
		return EXIT_FAILURE;
		}
	    else
		{
		while(optind< argc)
		    {
		    char* bamfile=argv[optind++];
		    WHERE("Open "<< bamfile);
		    BamFile2* bam=new BamFile2(bamfile);
		    this->bamFiles.push_back(bam);
		    bam->open(true);
		    }
		}

	   //open exon file
	    igzstreambuf buf(exonFile);
	    istream in(&buf);
	    this->readExons(in);
	    buf.close();
	    if(exons.empty())
		{
		cerr << "No exon.\n";
		return EXIT_FAILURE;
		}

	    run();
	    for(size_t i=0;i< bamFiles.size();++i)
		{
		bamFiles[i]->close();
		}
	    return EXIT_SUCCESS;
	    }
开发者ID:BioWu,项目名称:variationtoolkit,代码行数:93,代码来源:redondepth.cpp


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