Exemplo n.º 1
0
/*---------------------------------------------------------*/
void NOMAD::Cache::display_extern_pts ( const NOMAD::Display & out ) const
{
    int  nb = static_cast<int>(_extern_pts.size());
    int cnt = 0;
    std::list<const NOMAD::Eval_Point *>::const_iterator it , end = _extern_pts.end();
    for ( it = _extern_pts.begin() ; it != end ; ++it ) {
        out << "point ";
        out.display_int_w ( ++cnt , nb );
        out << "/" << nb << ": ";
        (*it)->display_eval ( out , false );
        out << std::endl;
    }
}
Exemplo n.º 2
0
/*--------------------------------------------*/
void NOMAD::TGP_Model::display_X(const NOMAD::Display &out           ,
                                 int                    display_limit) const
{
    if (_p == 0 || !_X)
    {
        out << "no interpolation points" << std::endl;
        return;
    }

    int i , j;
    int m  = _bbot.size();
    int i0 = (display_limit > 0) ? _p - display_limit : 0;
    NOMAD::Point x(_n) , bbo(m);

    out << NOMAD::open_block("interpolation points (X)");

    if (i0 > 0)
        out << "..." << std::endl;
    else if (i0 < 0)
        i0 = 0;

    for (i = i0 ; i < _p ; ++i)
    {

        for (j = 0 ; j < _n ; ++j)
            x[j] = _X[i][j];

        bbo = NOMAD::Point(m);
        if (_tgp_models)
            for (j = 0 ; j < m ; ++j)
                if (_tgp_models[j])
                    bbo[j] = (_tgp_models[j]->get_Z())[i];

        out << "#";
        out.display_int_w(i , _p);
        out << " x=(";
        x.display(out , " " , 15 , -1);
        out << " ) f(x)=[";
        bbo.display(out , " " , 15 , -1);
        out << " ]" << std::endl;
    }

    std::ostringstream oss;
    oss << "(size=" << _p << ")";
    out << NOMAD::close_block(oss.str()) << std::endl;
}
Exemplo n.º 3
0
/*---------------------------------------------------------*/
void NOMAD::Cache::display ( const NOMAD::Display & out ) const
{
    out << "number of cache points: " << size() << std::endl
    << "size in memory        : ";
    out.display_size_of ( _sizeof );
    out << std::endl << "cache file            : ";
    if ( _locked_file.empty() )
        out << "-" << std::endl;
    else
        out << _locked_file << std::endl;
    
#ifdef DEBUG
    int  nb = size();
    int cnt = 0;
    out << NOMAD::open_block ( "cache points" ) << std::endl;
    const NOMAD::Eval_Point * cur = begin();
    while ( cur ) {
        out << "point ";
        out.display_int_w ( ++cnt , nb );
        out << "/" << nb << ": ";
        cur->display_eval ( out , false );
        out << std::endl;
        cur = next();
    }
    out.close_block();
    
    // this display is repeated here as there can
    // be a lot of points displayed just before:
    out << "number of cache points: " << size() << std::endl
    << "size in memory        : ";
    out.display_size_of ( _sizeof );
    out << std::endl << "cache file            : ";
    if ( _locked_file.empty() )
        out << "-";
    else
        out << _locked_file;
    out << std::endl;
#endif
}
Exemplo n.º 4
0
/*--------------------------------------------------*/
void NOMAD::Eval_Point::display_tag(const NOMAD::Display &out) const
{
    out << "#";
    out.display_int_w(_tag , NOMAD::Eval_Point::_current_tag);
}
Exemplo n.º 5
0
void NOMAD::display_cardinalities ( const NOMAD::Display & out )
{

#ifdef USE_MPI
  if ( !NOMAD::Slave::is_master() )
    return;
#endif

  // compute the biggest int value for appropriate display width:
  int max = (NOMAD::Double::get_max_cardinality() > NOMAD::Point::get_max_cardinality())
    ? NOMAD::Double::get_max_cardinality() : NOMAD::Point::get_max_cardinality();
  if ( NOMAD::Direction::get_max_cardinality() > max )
    max = NOMAD::Direction::get_max_cardinality();
  if ( NOMAD::Set_Element<NOMAD::Eval_Point>::get_max_cardinality() > max )
    max = NOMAD::Set_Element<NOMAD::Eval_Point>::get_max_cardinality();
  if ( NOMAD::Set_Element<NOMAD::Signature>::get_max_cardinality() > max )
    max = NOMAD::Set_Element<NOMAD::Signature>::get_max_cardinality();
  if ( NOMAD::Cache_File_Point::get_max_cardinality() > max )
    max = NOMAD::Cache_File_Point::get_max_cardinality();
 
  // cardinalities display:
  // ----------------------
  out << std::endl
      << NOMAD::open_block ( "important objects in memory" );

  // NOMAD::Signature:
  out << "Signature              : ";
  out.display_int_w ( NOMAD::Signature::get_cardinality() , max );
  out << " (max=";
  out.display_int_w ( NOMAD::Signature::get_max_cardinality() , max );
  out << ")" << std::endl;

  // NOMAD::Double:
  out << "Double                 : ";
  out.display_int_w ( NOMAD::Double::get_cardinality() , max );
  out << " (max=";
  out.display_int_w ( NOMAD::Double::get_max_cardinality() , max );
  out << ")" << std::endl;

  // NOMAD::Point:
  out << "Point                  : ";
  out.display_int_w ( NOMAD::Point::get_cardinality() , max );
  out << " (max=";
  out.display_int_w ( NOMAD::Point::get_max_cardinality() , max );
  out << ")" << std::endl;

  // NOMAD::Direction:
  out << "Direction              : ";
  out.display_int_w ( NOMAD::Direction::get_cardinality() , max );
  out << " (max=";
  out.display_int_w ( NOMAD::Direction::get_max_cardinality() , max );
  out << ")" << std::endl;

  // Set_Element<Eval_Point>:
  out << "Set_Element<Eval_Point>: ";
  out.display_int_w (NOMAD::Set_Element<NOMAD::Eval_Point>::get_cardinality(), max);
  out << " (max=";
  out.display_int_w (NOMAD::Set_Element<NOMAD::Eval_Point>::get_max_cardinality(), max);
  out << ")" << std::endl;

  // Set_Element<NOMAD::Signature>:
  out << "Set_Element<Signature> : ";
  out.display_int_w (NOMAD::Set_Element<NOMAD::Signature>::get_cardinality(), max);
  out << " (max=";
  out.display_int_w (NOMAD::Set_Element<NOMAD::Signature>::get_max_cardinality(), max);
  out << ")" << std::endl;

  // NOMAD::Cache_File_Point:
  out << "Cache_File_Point       : ";
  out.display_int_w ( NOMAD::Cache_File_Point::get_cardinality() , max );
  out << " (max=";
  out.display_int_w ( NOMAD::Cache_File_Point::get_max_cardinality() , max );
  out << ")" << std::endl;

  out << NOMAD::close_block();
}