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


C++ TimeSeries::clear方法代码示例

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


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

示例1: Iterate

// Iterate from an initial state
void DynSysModel::Iterate( NTuple& initial_state, size_t length, TimeSeries& result )
{
	// Make sure the result is empty
	result.clear();

	// Save the initial state as the first time series entry
	result.push_back( initial_state );

	mState = initial_state;
	NTuple next_state;
	PolyModelIter iter;

	size_t i,k;
	for( i = length-1; i > 0; --i )
	{
		k = 1;
		// For each polynomial;
		next_state.Reset();
		iter = mModel.begin();
		while( iter != mModel.end() )
		{
			// Evaluate the k'th polynomial at the current state
			//   to produce a new value for the k'th variable
			next_state.Assign( k, mModel[k-1].Evaluate( mState ) );

			// next polynomial
			++iter; ++k;
		}
		// Update the current state to be the newly compute state
		mState = next_state;
		result.push_back( next_state );
	}
}
开发者ID:PlantSimLab,项目名称:polynome,代码行数:34,代码来源:DynSysModel.cpp

示例2: KoIterate

// Iterate from an initial state with the k'th function knocked out
void DynSysModel::KoIterate( NTuple& initial_state, size_t length, TimeSeries& result, size_t kov )
{
	// Make sure the result is empty
	result.clear();

	// Force k'th entry to zero in the initial state -  no longer needed, corrected when file is read in
	// NTuple state1 = initial_state;
	// state1.Reset( kov );

	// Save the initial state as the first time series entry
	result.push_back( initial_state );

	mState = initial_state;
	NTuple next_state;
	PolyModelIter iter;

	size_t i,k;
	for( i = length-1; i > 0; --i )
	{
		k = 1;
		// For each polynomial
		next_state.Reset();
		iter = mModel.begin();
		while( iter != mModel.end() )
		{
			// Force the knockout function result to zero
			if( k == kov )
			{
				next_state.Assign( k, 0 );
			}
			else
			{
				// Evaluate the k'th polynomial at the current state
				//   to produce a new value for the k'th variable
				next_state.Assign( k, mModel[k-1].Evaluate( mState ) );
			}

			// next polynomial
			++iter; ++k;
		}
		// Update the current state to be the newly compute state
		mState = next_state;
		result.push_back( next_state );
	}
}
开发者ID:PlantSimLab,项目名称:polynome,代码行数:46,代码来源:DynSysModel.cpp


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