Elements  6.0.1
A C++ base framework for the Euclid Software.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
GslExample.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 
32 using std::map;
33 using std::string;
34 
35 namespace Elements {
36 namespace Examples {
37 
38 class GslExample : public Program {
39 
40 public:
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 
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
Macro to silence unused variables warnings from the compiler.
Everything is OK.
Abstract class for all Elements programs.
Definition: Program.h:52
STL class.
STL class.
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition: Main.h:113
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
Definition: GslExample.cpp:41
#define ELEMENTS_UNUSED
Definition: Unused.h:39
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63