BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Public Member Functions | |
ScalarFunctionAdapter (fcn_scalar_t func, const Parameters ¶meters) | |
const RootScalarFunction * | rootObjectiveFunction () |
int | numberOfCalls () const |
int | numberOfGradientCalls () const |
Protected Attributes | |
int | m_number_of_calls |
int | m_number_of_gradient_calls |
Private Attributes | |
fcn_scalar_t | m_fcn |
Parameters | m_parameters |
std::unique_ptr< RootScalarFunction > | m_root_objective |
Converts user objective function to chi2 like function which ROOT expects.
More precisely, ROOT call to std::function<double(const double*)> will cause the call of user function std::function<double(std::vector<double>)>, where function input parameters will be current values fit parameters.
Definition at line 36 of file ScalarFunctionAdapter.h.
ScalarFunctionAdapter::ScalarFunctionAdapter | ( | fcn_scalar_t | func, |
const Parameters & | parameters | ||
) |
Definition at line 20 of file ScalarFunctionAdapter.cpp.
const RootScalarFunction * ScalarFunctionAdapter::rootObjectiveFunction | ( | ) |
Definition at line 25 of file ScalarFunctionAdapter.cpp.
References m_fcn, Fit::IFunctionAdapter::m_number_of_calls, m_parameters, m_root_objective, Fit::Parameters::setValues(), and Fit::Parameters::size().
|
inherited |
Definition at line 23 of file IFunctionAdapter.cpp.
References Fit::IFunctionAdapter::m_number_of_calls.
|
inherited |
Definition at line 28 of file IFunctionAdapter.cpp.
References Fit::IFunctionAdapter::m_number_of_gradient_calls.
|
private |
Definition at line 44 of file ScalarFunctionAdapter.h.
Referenced by rootObjectiveFunction().
|
private |
Definition at line 45 of file ScalarFunctionAdapter.h.
Referenced by rootObjectiveFunction().
|
private |
Definition at line 46 of file ScalarFunctionAdapter.h.
Referenced by rootObjectiveFunction().
|
protectedinherited |
Definition at line 34 of file IFunctionAdapter.h.
Referenced by Fit::ResidualFunctionAdapter::chi2(), Fit::IFunctionAdapter::numberOfCalls(), and rootObjectiveFunction().
|
protectedinherited |
Definition at line 35 of file IFunctionAdapter.h.
Referenced by Fit::ResidualFunctionAdapter::calculate_gradients(), and Fit::IFunctionAdapter::numberOfGradientCalls().