From 1d8f1faa8176cd2e4f0cd835e4397b7bb23b5d6f Mon Sep 17 00:00:00 2001 From: Gunter Winkler Date: Sat, 7 Apr 2007 20:51:38 +0000 Subject: [PATCH] - new directive BOOST_UBLAS_NDEBUG to disable all debug actions of uBLAS It has an equivalent effect as defining NDEBUG in all uBLAS headers. --- doc/index.htm | 4 +++- include/boost/numeric/ublas/detail/config.hpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/index.htm b/doc/index.htm index 11d7cf99..542f9f1d 100644 --- a/doc/index.htm +++ b/doc/index.htm @@ -273,7 +273,9 @@ enabled, expression templates disabled) and release mode (size and type conformance checks disabled, expression templates enabled). Please check, if the preprocessor symbol NDEBUG of cassert is defined. NDEBUG enables -release mode, which in turn uses expression templates.

+release mode, which in turn uses expression templates. You can +optionally define BOOST_UBLAS_NDEBUG to disable all +bounds, structure and similar checks of uBLAS.

Q: I've written some uBLAS tests, which try to incorrectly assign different matrix types or overrun vector and matrix dimensions. Why don't I get a compile time or runtime diff --git a/include/boost/numeric/ublas/detail/config.hpp b/include/boost/numeric/ublas/detail/config.hpp index 9752c708..376bf60e 100644 --- a/include/boost/numeric/ublas/detail/config.hpp +++ b/include/boost/numeric/ublas/detail/config.hpp @@ -177,7 +177,7 @@ namespace std { // Enable performance options in RELEASE mode -#ifdef NDEBUG +#if defined (NDEBUG) || defined (BOOST_UBLAS_NDEBUG) #ifndef BOOST_UBLAS_INLINE #define BOOST_UBLAS_INLINE inline