Elements 6.1.2
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
Gsl.cpp
Go to the documentation of this file.
1
21#include <map> // for map
22#include <string> // for string
23
24#include <boost/format.hpp> // for format
25
26#include <gsl/gsl_sf_bessel.h> // for gsl_sf_bessel_J0
27#include <gsl/gsl_version.h>
28
29#include "ElementsKernel/ProgramHeaders.h" // for including all Program/related headers
30#include "ElementsKernel/Unused.h" // for ELEMENTS_UNUSED
31
32using std::map;
33using std::string;
34
35namespace Elements {
36namespace Examples {
37
38class Gsl : public Program {
39
40public:
42
43 auto log = Logging::getLogger("GslExample");
44
45 log.info() << "GSL version: " << gsl_version;
46
47 double x = 5.0;
48 double y = gsl_sf_bessel_J0(x);
49
50 log.info() << boost::format("J0(%g) = %.18e\n") % x % y;
51
52 return ExitCode::OK;
53 }
54};
55
56} // namespace Examples
57} // namespace Elements
58
Macro to silence unused variables warnings from the compiler.
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
Definition: Gsl.cpp:41
Simple example of an Elements program.
Definition: Program.cpp:79
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition: Main.h:113
#define ELEMENTS_UNUSED
Definition: Unused.h:39
@ OK
Everything is OK.