Elements 6.1.2
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
callBackExample.cpp
Go to the documentation of this file.
1
22#include <functional> // for function
23#include <vector> // for vector
24
25#include "ElementsKernel/Logging.h" // for Logging
26
28
29using std::vector;
30
31namespace Elements {
32namespace Examples {
33
35
36 auto log = Logging::getLogger("ElementsExamples");
37
38 log.info() << "Calling the Python function from C++";
39
40 double f = fun(x);
41
42 log.info() << "The value of the function is " << f;
43
44 log.info() << "Returning the result";
45
46 return (f);
47}
48
49} // namespace Examples
50} // namespace Elements
Logging facility.
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63
ELEMENTS_API double testCallBack(std::vector< double > x, const std::function< double(std::vector< double >)> &fun)