eigen/doc/snippets/compile_snippet.cpp.in
Rohit Goswami 6f9bffe8dd DOC: Update documentation for 3.4.x
(cherry picked from commit b0eded878d5d162d61583a286c0d8a45406ad1bc)
2023-07-10 14:52:08 -07:00

25 lines
574 B
C++

static bool eigen_did_assert = false;
#define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;}
#include <iostream>
#include <cassert>
#include <Eigen/Eigen>
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif
using namespace Eigen;
using namespace std;
int main(int, char**)
{
cout.precision(3);
// intentionally remove indentation of snippet
{
${snippet_source_code}
}
return 0;
}