Elements
6.2
A C++ base framework for the Euclid Software.
ElementsExamples
src
program
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
32
using
std::map
;
33
using
std::string
;
34
35
namespace
Elements
{
36
namespace
Examples {
37
38
class
Gsl
:
public
Program
{
39
40
public
:
41
ExitCode
mainMethod
(
ELEMENTS_UNUSED
map<string, VariableValue>
& args)
override
{
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
63
MAIN_FOR
(
Elements::Examples::Gsl
)
Elements::ExitCode::OK
@ OK
Everything is OK.
std::string
STL class.
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition:
Exit.h:97
Elements::Examples::Program
Simple example of an Elements program.
Definition:
Program.cpp:79
Elements::Examples::Gsl
Definition:
Gsl.cpp:38
std::map
STL class.
ProgramHeaders.h
Elements::Examples::log
auto log
Definition:
BackTrace.cpp:36
Elements::Logging::getLogger
static Logging getLogger(const std::string &name="")
Definition:
Logging.cpp:63
Elements::Examples::Gsl::mainMethod
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
Definition:
Gsl.cpp:41
MAIN_FOR
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition:
Main.h:113
Unused.h
Macro to silence unused variables warnings from the compiler.
ELEMENTS_UNUSED
#define ELEMENTS_UNUSED
Definition:
Unused.h:39
Elements
Definition:
callBackExample.h:35
Generated by
1.8.17