コード例 #1
0
ファイル: nomad.cpp プロジェクト: shubhangid/MultiMADS
  bool eval_x ( Eval_Point   & x          ,
                const Double & h_max      ,
                bool         & count_eval   ) const {

    int n = x.size();
    int m = x.get_bb_outputs().size();

    int i;

    double * xx = new double [n];
    double * fx = new double [m];

    for ( i = 0 ; i < x.size() ; ++i )
      xx[i] = x[i].value();

    // call the FORTRAN routine:
    bb_ ( xx , fx );

    for ( i = 0 ; i < m ; ++i )
      x.set_bb_output ( i , fx[i] );

    count_eval = true; // count a black-box evaluation

    return true;       // the evaluation succeeded
  }
コード例 #2
0
/*---------------------------------------------------------------------*/
NOMAD::Eval_Point::Eval_Point ( const Eval_Point & x )
    : NOMAD::Point        ( x.get_n()                         ) ,
      _tag                ( NOMAD::Eval_Point::_current_tag++ ) ,
      _signature          ( x._signature                      ) ,
      _f                  ( x._f                              ) ,
      _h                  ( x._h                              ) ,
      _in_cache           ( x._in_cache                       ) ,
      _current_run        ( x._current_run                    ) ,
      _eval_type          ( x._eval_type                      ) ,
      _direction          ( NULL                              ) ,
      _poll_center_type   ( x._poll_center_type               ) ,
      _eval_status        ( x._eval_status                    ) ,
      _EB_ok              ( x._EB_ok                          ) ,
      _bb_outputs         ( x.get_bb_outputs()                ) ,
      _user_eval_priority ( x._user_eval_priority             ) ,
      _rand_eval_priority ( x._rand_eval_priority             )
{
    // point coordinates:
    int n = size();
    for ( int i = 0 ; i < n ; ++i )
        (*this)[i] = x[i];

    // _direction:
    if ( x._direction )
        _direction = new Direction ( *x._direction );

#ifdef MODEL_STATS
    set_model_data ( x );
#endif
}