Elements  5.10
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 #include <boost/program_options.hpp> // for program options from configuration file of command line arguments
24 #include <boost/format.hpp> // for format
25 
26 #include <gsl/gsl_version.h>
27 #include <gsl/gsl_sf_bessel.h> // for gsl_sf_bessel_J0
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 using boost::program_options::variable_value;
35 
36 namespace Elements {
37 namespace Examples {
38 
39 class GslExample: public Program {
40 
41 public:
42 
44 
45  auto log = Logging::getLogger("GslExample");
46 
47  log.info() << "GSL version: " << gsl_version;
48 
49  double x = 5.0;
50  double y = gsl_sf_bessel_J0(x);
51 
52  log.info() << boost::format("J0(%g) = %.18e\n") % x % y;
53 
54  return ExitCode::OK;
55 
56  }
57 
58 };
59 
60 } // namespace Examples
61 } // namespace Elements
62 
63 
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:98
Macro to silence unused variables warnings from the compiler.
Everything is OK.
ExitCode mainMethod(ELEMENTS_UNUSED map< string, variable_value > &args) override
Definition: GslExample.cpp:43
Abstract class for all Elements programs.
Definition: Program.h:51
STL class.
STL class.
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition: Main.h:117
#define ELEMENTS_UNUSED
Definition: Unused.h:39
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63