aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-08-10 11:37:23 +0100
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-08-10 11:37:23 +0100
commit76fbe94279bda314e717cb3f98b46b253d081993 (patch)
tree3610b5e67431da5956036c4cb0e4bbaae1afc33c
parent530b3287695e136269eb10c553bb90392ef9a6ba (diff)
Document EIGEN_NO_DEBUG macro.
I needed some doxygen tricks to get this to work, so it may not be worth it.
-rw-r--r--Eigen/Core8
-rw-r--r--Eigen/src/Core/util/Macros.h13
-rw-r--r--doc/I00_CustomizingEigen.dox2
-rw-r--r--doc/I11_Aliasing.dox8
-rw-r--r--doc/QuickReference.dox2
5 files changed, 26 insertions, 7 deletions
diff --git a/Eigen/Core b/Eigen/Core
index b14286f0d..5260ce7e8 100644
--- a/Eigen/Core
+++ b/Eigen/Core
@@ -32,7 +32,13 @@
// then include this file where all our macros are defined. It's really important to do it first because
// it's where we do all the alignment settings (platform detection and honoring the user's will if he
// defined e.g. EIGEN_DONT_ALIGN) so it needs to be done before we do anything with vectorization.
-#include "src/Core/util/Macros.h"
+#ifndef EIGEN_PARSED_BY_DOXYGEN
+ #include "src/Core/util/Macros.h"
+#else
+ namespace Eigen { // for some reason Doxygen needs this namespace
+ #include "src/Core/util/Macros.h"
+ }
+#endif
// if alignment is disabled, then disable vectorization. Note: EIGEN_ALIGN is the proper check, it takes into
// account both the user's will (EIGEN_DONT_ALIGN) and our own platform checks
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index 7600cc3e7..2da9ab291 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -109,6 +109,19 @@
#define EIGEN_DEBUG_VAR(x) std::cerr << #x << " = " << x << std::endl;
+#ifdef EIGEN_PARSED_BY_DOXYGEN
+ /** \def EIGEN_NO_DEBUG
+ * \ingroup Core_Module
+ * \brief If defined, Eigen's assertions are disabled.
+ * \details Disabling run-time assertions improves the performance, but it is dangerous because the
+ * assertions guard against programming errors. By default, the EIGEN_NO_DEBUG macro is not defined and
+ * Eigen's run-time assertions are thus enabled. However, if the NDEBUG macro is defined (this is a
+ * standard C++ macro which disables all asserts), then the EIGEN_NO_DEBUG macro will also be defined, and
+ * so Eigen's assertions will also be disabled.
+ */
+ #define EIGEN_NO_DEBUG
+#endif
+
#ifdef NDEBUG
# ifndef EIGEN_NO_DEBUG
# define EIGEN_NO_DEBUG
diff --git a/doc/I00_CustomizingEigen.dox b/doc/I00_CustomizingEigen.dox
index fddd42348..d87fb8d6a 100644
--- a/doc/I00_CustomizingEigen.dox
+++ b/doc/I00_CustomizingEigen.dox
@@ -184,7 +184,7 @@ namespace adtl {
\section PreprocessorDirectives Preprocessor directives
You can control some aspects of Eigen by defining the following preprocessor tokens them before including any of Eigen's headers.
- - \b EIGEN_NO_DEBUG disables Eigen assertions. Like NDEBUG but only affects Eigen's assertions.
+ - \b #EIGEN_NO_DEBUG disables Eigen assertions. Like NDEBUG but only affects Eigen's assertions.
- \b EIGEN_DONT_VECTORIZE disables explicit vectorization when defined.
- \b EIGEN_UNROLLING_LIMIT defines the maximal instruction counts to enable meta unrolling of loops. Set it to zero to disable unrolling. The default is 100.
- \b EIGEN_DEFAULT_TO_ROW_MAJOR the default storage order for matrices becomes row-major instead of column-major.
diff --git a/doc/I11_Aliasing.dox b/doc/I11_Aliasing.dox
index f89c8337e..e026d02ce 100644
--- a/doc/I11_Aliasing.dox
+++ b/doc/I11_Aliasing.dox
@@ -46,7 +46,7 @@ the blocks <tt>mat.bottomRightCorner(2,2)</tt> and <tt>mat.topLeftCorner(2,2)</t
contain the coefficient <tt>mat(1,1)</tt> at the centre of the 3-by-3 matrix \c mat . The next section
explains how to solve this problem by calling \link DenseBase::eval() eval()\endlink.
-Note that if \c mat were a bigger, then the blocks would not overlop, and there would be no aliasing
+Note that if \c mat were a bigger, then the blocks would not overlap, and there would be no aliasing
problem. This means that in general aliasing cannot be detected at compile time. However, Eigen does detect
some instances of aliasing, albeit at run time. The following example exhibiting aliasing was mentioned in
\ref TutorialMatrixArithmetic :
@@ -61,15 +61,15 @@ Output: \verbinclude tut_arithmetic_transpose_aliasing.out
Again, the output shows the aliasing issue. However, by default Eigen uses a run-time assertion to detect this
and exits with a message like
-\code
+\verbatim
void Eigen::DenseBase<Derived>::checkTransposeAliasing(const OtherDerived&) const
[with OtherDerived = Eigen::Transpose<Eigen::Matrix<int, 2, 2, 0, 2, 2> >, Derived = Eigen::Matrix<int, 2, 2, 0, 2, 2>]:
Assertion `(!ei_check_transpose_aliasing_selector<Scalar,ei_blas_traits<Derived>::IsTransposed,OtherDerived>::run(ei_extract_data(derived()), other))
&& "aliasing detected during tranposition, use transposeInPlace() or evaluate the rhs into a temporary using .eval()"' failed.
-\endcode
+\endverbatim
The user can turn Eigen's run-time assertions like the one to detect this aliasing problem off by defining the
-EIGEN_NO_DEBUG macro, and the above program was compiled with this macro turned off in order to illustrate the
+#EIGEN_NO_DEBUG macro, and the above program was compiled with this macro turned off in order to illustrate the
aliasing problem. See \ref TopicAssertions for more information about Eigen's run-time assertions.
diff --git a/doc/QuickReference.dox b/doc/QuickReference.dox
index 73873da1a..d426b85de 100644
--- a/doc/QuickReference.dox
+++ b/doc/QuickReference.dox
@@ -181,7 +181,7 @@ vector[i] vector.y()
vector.w()
\endcode</td><td>\code
matrix(i,j)
-\endcode</td><td class="note">Range checking is disabled if \n NDEBUG or EIGEN_NO_DEBUG is defined</td></tr>
+\endcode</td><td class="note">Range checking is disabled if \n NDEBUG or #EIGEN_NO_DEBUG is defined</td></tr>
<tr><td>Coeff access without \n range checking</td>
<td>\code