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


C++ Samples::push_back方法代码示例

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


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

示例1: evaluateRange

BSplineInterpolation::Samples BSplineInterpolation::evaluateRange(
        const float start, const float stop, const float stepsize)
{
    Samples samples;
    for (float x=start; x<stop; x+=stepsize) {
        float y = evaluate(x);
        samples.push_back(std::make_pair(x, y));
    }

    return samples;
}
开发者ID:aurelw,项目名称:beholder,代码行数:11,代码来源:bsplineinterpolation.cpp

示例2: motionBegin

void TransformStack::motionBegin( const std::vector<float> &times )
{
	// resample the current stack top at the specified times
	Samples newSamples;
	for( std::vector<float>::const_iterator it = times.begin(), eIt = times.end(); it != eIt; ++it )
	{
		newSamples.push_back( Sample( *it, get( *it ) ) );
	}
	m_stack.top() = newSamples;

	m_motionIndex = 0;
}
开发者ID:appleseedhq,项目名称:cortex,代码行数:12,代码来源:TransformStack.cpp

示例3: create

	RawSample* create(const string& sampleName) {
		RawSample* sam = byNames[sampleName];
		if (sam == NULL) {
			// sample does not exist: create it
			sam = new RawSample(sampleName);
			samples.push_back(sam);
			// register name
			byNames[sampleName] = sam;
		} else {
			// sample already exists: not supported
			throw runtime_error("Duplicate sample names are not permitted in RawSampleSet.");
		}
		return sam;
	}
开发者ID:djhshih,项目名称:genomic,代码行数:14,代码来源:RawSampleSet.hpp

示例4:

void
diy::detail::KDTreeSamplingPartition<Block,Point>::
add_samples(Block* b, const diy::ReduceProxy& srp, Samples& samples) const
{
    // dequeue and combine the samples
    for (int i = 0; i < srp.in_link().size(); ++i)
    {
        int nbr_gid = srp.in_link().target(i).gid;

        Samples smpls;
        srp.dequeue(nbr_gid, smpls);
        for (size_t i = 0; i < smpls.size(); ++i)
            samples.push_back(smpls[i]);
    }
}
开发者ID:sujin-philip,项目名称:diy2,代码行数:15,代码来源:kdtree-sampling.hpp

示例5: exception

Y_PROGRAM_START()
{
    Record::DataBase db;

    for(int i=1;i<argc;++i)
    {
        const Record::Pointer r = new Record(argv[i]);
        if(!db.insert(r))
        {
            throw exception("multiple file/conc '%s'",*(r->name));
        }
    }
    const size_t nrec = db.size();
    std::cerr << "Loaded #" << nrec << " files" << std::endl;
    db.sort_keys(compare_natural);

    Samples samples;
    for( Iterator i=db.begin();i!=db.end();++i)
    {
        Record &r = **i;
        std::cerr << r.filename << std::endl;
        samples.push_back(r.sample);
    }
    assert(samples.size()==nrec);

    ////////////////////////////////////////////////////////////////////////////
    //
    // prepare fit
    //
    ////////////////////////////////////////////////////////////////////////////
    Fit::LeastSquares<double>   ls;
    Proton                      proton;
    Fit::Type<double>::Function F( &proton, & Proton::Compute );

    ////////////////////////////////////////////////////////////////////////////
    //
    // First pass, individual fits
    //
    ////////////////////////////////////////////////////////////////////////////
    Variables &gvars = samples.variables;
    Vector C;
    Vector P;
    Vector Q;
    Vector pHi;
    Vector pHe;
    Vector T0;

    {
        gvars.free();
        gvars << "p" << "q" << "vi" << "ve" << "t0";
        const size_t nvar = gvars.size();
        Vector aorg( nvar );
        Vector aerr( nvar );
        vector<bool> used( nvar, false);

        {
            ios::ocstream fp("ind.dat");
            for( Iterator i=db.begin();i!=db.end();++i)
            {
                Record &r = **i;
                Sample &sample = *r.sample;
                r.vars = gvars;
                std::cerr << "-- Individual for " << r.filename << std::endl;
                std::cerr << r.name << ".vars=" << r.vars << std::endl;

                gvars(aorg,"p")  = 1.0;
                gvars(aorg,"q")  = r.thalf-r.t_min;
                gvars(aorg,"vi") = r.pH_min;
                gvars(aorg,"ve") = r.pH_end;

                gvars(aorg,"ve") = 7.1;


                tao::ld(used,false);


                int level = 0;
                gvars.display(std::cerr,aorg);
                {
                    //gvars.on(used,"p");
                    gvars.on(used,"q");
                    ++level;
                    std::cerr << "starting level " << level << " with: " << std::endl;
                    gvars.display(std::cerr,aorg);
                    if( !ls.fit( sample, F, aorg, aerr, used) )
                    {
                        throw exception("couldn't fit %s @level-%d", *(r.name), level );
                    }
                    //gvars.diplay(std::cerr, aorg, aerr, "\t");
                    //std::cerr << "\tR2=" << sample.computeR2() << std::endl;
                }

                if(false)
                {
                    gvars.on(used,"p");
                    ++level;
                    std::cerr << "starting level " << level << " with: " << std::endl;
                    gvars.display(std::cerr,aorg);
                    if( !ls.fit( sample, F, aorg, aerr, used) )
                    {
//.........这里部分代码省略.........
开发者ID:ybouret,项目名称:biosystems,代码行数:101,代码来源:fit-hall.cpp


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