gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-252-gf9a3f78
a Global And Modular Bsm Inference Tool
Gambit::Diver_1_0_2 Namespace Reference

Classes

struct  diverScanData
 Structure for passing likelihood and printer data through Diver to the objective function. More...
 

Functions

double objective (double params[], const int param_dim, int &fcall, bool &quit, const bool validvector, void *&context)
 Function to be minimised by Diver. More...
 

Function Documentation

◆ objective()

double Gambit::Diver_1_0_2::objective ( double  params[],
const int  param_dim,
int fcall,
bool &  quit,
const bool  validvector,
void *&  context 
)

Function to be minimised by Diver.

Definition at line 183 of file diver.cpp.

References Gambit::GreAT::data, Gambit::Scanner::Plugins::pluginInfo::early_shutdown_in_progress(), Gambit::Diver_1_0_2::diverScanData::likelihood_function, and Gambit::Scanner::Plugins::plugin_info.

Referenced by scanner_plugin().

184  {
185  // Return the worst possible likelihood if the point is outside the prior box.
186  if (not validvector) return std::numeric_limits<double>::max();
187 
188  // Put the parameters into a C++ vector
189  std::vector<double> param_vec(params, params + param_dim);
190 
191  // Retrieve the likelihood function from the context pointer and call it
192  diverScanData* data = static_cast<diverScanData*>(context);
193  double lnlike = data->likelihood_function(param_vec);
194 
195  // Increment the number of function calls, tell Diver to continue and return the likelihood
196  fcall += 1;
197 
198  // Check whether the calling code wants us to shut down early
200 
201  return -lnlike;
202 
203  }
greatScanData data
Definition: great.cpp:38
Structure for passing likelihood and printer data through Diver to the objective function.
Definition: diver.hpp:37
EXPORT_SYMBOLS pluginInfo plugin_info
Access Functor for plugin info.
Scanner::like_ptr likelihood_function
Definition: diver.hpp:39
Here is the call graph for this function:
Here is the caller graph for this function: