本文整理汇总了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 );
}
}
示例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 );
}
}