本文整理汇总了C++中nomad::Eval_Point::get_current_run方法的典型用法代码示例。如果您正苦于以下问题:C++ Eval_Point::get_current_run方法的具体用法?C++ Eval_Point::get_current_run怎么用?C++ Eval_Point::get_current_run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nomad::Eval_Point
的用法示例。
在下文中一共展示了Eval_Point::get_current_run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: find
/*-----------------------------------------------------*/
bool NOMAD::Cache::erase ( const NOMAD::Eval_Point & x )
{
// check the eval types:
if ( x.get_eval_type() != _eval_type )
throw NOMAD::Cache::Cache_Error ( "Cache.cpp" , __LINE__ ,
"NOMAD::Cache:erase(x): x.eval_type != cache.eval_type" );
std::set<NOMAD::Cache_Point>::iterator it;
NOMAD::cache_index_type cache_index;
// search in cache:
const NOMAD::Eval_Point * cache_x = find ( x , it , cache_index );
// the point has been found:
if ( cache_x ) {
// remove the point from the list of extern points:
if ( cache_x->get_current_run() || x.get_current_run() ) {
std::list<const NOMAD::Eval_Point*>::const_iterator end2 = _extern_pts.end();
std::list<const NOMAD::Eval_Point*>::iterator it2 = _extern_pts.begin();
while ( it2 != end2 ) {
if ( *it2 == cache_x || *it2 == &x ) {
_extern_pts.erase ( it2 );
break;
}
++it2;
}
}
// erase the point in cache if its address is different from &x:
if ( cache_x != &x )
delete cache_x;
// remove the point from the cache:
_sizeof -= x.size_of();
switch ( cache_index ) {
case NOMAD::CACHE_1:
_cache1.erase ( it );
break;
case NOMAD::CACHE_2:
_cache2.erase ( it );
break;
case NOMAD::CACHE_3:
_cache3.erase ( it );
break;
case NOMAD::UNDEFINED_CACHE:
break;
}
return true;
}
return false;
}
示例2:
/*---------------------------------------------------------------------*/
void NOMAD::Cache::insert_extern_point ( const NOMAD::Eval_Point & x ) const
{
if ( !x.get_current_run() )
_extern_pts.push_front ( &x );
}