Statistics
| Revision:

root / trunk / src / nh99 / mod_mc4.cpp @ 1639

History | View | Annotate | Download (561 Bytes)

1
/*
2
 * $Id: mod_mc4.cpp 1639 2014-02-13 20:34:09Z johnoel $
3
 *
4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California
6
 */
7
#include <admodel.h>
8

    
9
/*
10
#ifdef __GNUDOS__
11
  #include <gccmanip.h>
12
#endif
13
*/
14

    
15
double better_rand(long int&);
16

    
17
double function_minimizer::get_monte_carlo_value(int nvar, const dvector& x)
18
{
19
  //initial_params::xinit(x);
20
  double f=0.0;
21
  {
22
    dvariable vf=0.0;
23
    vf=initial_params::reset(dvar_vector(x));
24
    *objective_function_value::pobjfun=0.0;
25
    userfunction();
26
    vf+=*objective_function_value::pobjfun;
27
    f=value(vf);
28
  }
29
  return f;
30
}