Elements 6.1.2
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
Eigen.cpp
Go to the documentation of this file.
1
21#include <iostream>
22
23#include <map> // for map
24#include <string> // for string
25
26#include <Eigen/Dense>
27
28#include "ElementsKernel/ProgramHeaders.h" // for including all Program/related headers
29#include "ElementsKernel/Unused.h" // for ELEMENTS_UNUSED
30
31using std::map;
32using std::string;
33
34namespace Elements {
35namespace Examples {
36
37class Eigen : public Program {
38
39public:
41
42 using ::Eigen::MatrixXd;
43
44 auto log = Logging::getLogger("EigenExample");
45
46 MatrixXd m(2, 2);
47 m(0, 0) = 3;
48 m(1, 0) = 2.5;
49 m(0, 1) = -1;
50 m(1, 1) = m(1, 0) + m(0, 1);
51 std::cout << m << std::endl;
52
53 log.info() << "This is the end of the test";
54
55 return ExitCode::OK;
56 }
57};
58
59} // namespace Examples
60} // namespace Elements
61
Macro to silence unused variables warnings from the compiler.
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
Definition: Eigen.cpp:40
Simple example of an Elements program.
Definition: Program.cpp:79
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63
T endl(T... args)
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.