Statistics
| Revision:

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

History | View | Annotate | Download (505 Bytes)

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

    
9
double better_rand(long int&);
10

    
11
double function_minimizer::get_monte_carlo_value(int nvar, const dvector& x)
12
{
13
  //initial_params::xinit(x);
14
  double f=0.0;
15
  {
16
    dvariable vf=0.0;
17
    vf=initial_params::reset(dvar_vector(x));
18
    *objective_function_value::pobjfun=0.0;
19
    userfunction();
20
    vf+=*objective_function_value::pobjfun;
21
    f=value(vf);
22
  }
23
  return f;
24
}