compile_snippet.cpp.in 555 B

1234567891011121314151617181920212223
  1. static bool eigen_did_assert = false;
  2. #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;}
  3. #include <iostream>
  4. #include <Eigen/Eigen>
  5. #ifndef M_PI
  6. #define M_PI 3.1415926535897932384626433832795
  7. #endif
  8. using namespace Eigen;
  9. using namespace std;
  10. int main(int, char**)
  11. {
  12. cout.precision(3);
  13. // intentionally remove indentation of snippet
  14. {
  15. ${snippet_source_code}
  16. }
  17. return 0;
  18. }