BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
PyCallback.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Fit/Kernel/PyCallback.cpp
6 //! @brief Implements class PyCallback.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #include "Fit/Kernel/PyCallback.h"
16 
18  : m_callback_type(callback_type)
19 {
20 }
21 
23 {
24  return m_callback_type;
25 }
26 
27 PyCallback::~PyCallback() = default;
28 
30 {
31  throw std::runtime_error("PyCallback::call_scalar() -> Error. Not implemented");
32 }
33 
35 {
36  throw std::runtime_error("PyCallback::call_residuals() -> Error. Not implemented");
37 }
Defines class PyCallback.
virtual std::vector< double > call_residuals(mumufit::Parameters pars) const
Call Python callable and returns its result. Intended to be overloaded in Python.
Definition: PyCallback.cpp:34
CallbackType m_callback_type
Definition: PyCallback.h:44
PyCallback(CallbackType callback_type=SCALAR)
Definition: PyCallback.cpp:17
virtual double call_scalar(mumufit::Parameters pars) const
Call Python callable and returns its result. Intended to be overloaded in Python.
Definition: PyCallback.cpp:29
virtual ~PyCallback()
CallbackType callback_type() const
Definition: PyCallback.cpp:22
A collection of fit parameters.
Definition: Parameters.h:26