diff options
-rw-r--r-- | Eigen/src/Core/util/Macros.h | 4 | ||||
-rw-r--r-- | doc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | doc/TutorialLinearAlgebra.dox | 7 | ||||
-rw-r--r-- | doc/snippets/compile_snippet.cpp.in | 2 |
4 files changed, 11 insertions, 4 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index e14979490..942af1e48 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -118,6 +118,10 @@ using Eigen::ei_cos; #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat() #endif +// format used in Eigen's documentation +// needed to define it here as escaping characters in CMake add_definition's argument seems very problematic. +#define EIGEN_DOCS_IO_FORMAT IOFormat(3, AlignCols, " ", "\n", "", "") + #define EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \ template<typename OtherDerived> \ Derived& operator Op(const Eigen::MatrixBase<OtherDerived>& other) \ diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 759c3cf89..d90fc887d 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -25,6 +25,8 @@ configure_file( set(examples_targets "") set(snippets_targets "") +add_definitions("-DEIGEN_DEFAULT_IO_FORMAT=EIGEN_DOCS_IO_FORMAT") + add_subdirectory(examples) add_subdirectory(snippets) diff --git a/doc/TutorialLinearAlgebra.dox b/doc/TutorialLinearAlgebra.dox index d7a70abc1..7dd786e98 100644 --- a/doc/TutorialLinearAlgebra.dox +++ b/doc/TutorialLinearAlgebra.dox @@ -158,8 +158,11 @@ Eigen::LUDecomposition<MatrixXf> lu(A); cout << "The rank of A is" << lu.rank() << endl; if(lu.isInvertible()) { cout << "A is invertible, its inverse is:" << endl << lu.inverse() << endl; -cout << "Here's a matrix whose columns form a basis of the kernel a.k.a. nullspace of A:" - << endl << lu.kernel() << endl; +} +else { + cout << "Here's a matrix whose columns form a basis of the kernel a.k.a. nullspace of A:" + << endl << lu.kernel() << endl; +} \endcode \sa LU_Module, LU::solve(), class LU diff --git a/doc/snippets/compile_snippet.cpp.in b/doc/snippets/compile_snippet.cpp.in index 950f06654..3eaee98ac 100644 --- a/doc/snippets/compile_snippet.cpp.in +++ b/doc/snippets/compile_snippet.cpp.in @@ -4,13 +4,11 @@ #include <Eigen/Cholesky> #include <Eigen/Geometry> -USING_PART_OF_NAMESPACE_EIGEN using namespace Eigen; using namespace std; int main(int, char**) { - cout.precision(3); ${snippet_source_code} return 0; } |