hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
macros.hh
Go to the documentation of this file.
1 // Copyright (c) 2015 CNRS
2 // Author: Joseph Mirabel
3 //
4 //
5 // This file is part of hpp-constraints
6 // hpp-constraints is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // hpp-constraints is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // hpp-constraints If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_CONSTRAINTS_MACROS_HH
20 # define HPP_CONSTRAINTS_MACROS_HH
21 
22 # ifdef HPP_DEBUG
23 
24 # define HPP_DEBUG_SVDCHECK(svd) \
25  do { \
26  if (svd.rank () > 0) { \
27  value_type SSV = svd.singularValues()(svd.rank()-1); \
28  if (std::abs (SSV) < 1e-8) { \
29  hppDout (warning, "SVD check - low singular value: " << SSV); \
30  } \
31  } \
32  } while (0)
33 
34 # ifdef HPP_CONSTRAINTS_NUMERIC_DEBUG
35 
36 # define hppDnum(channel, data) hppDout (channel, data)
37 
38 # else // HPP_CONSTRAINTS_NUMERIC_DEBUG
39 
40 # define hppDnum(channel, data) do { } while (0)
41 
42 # endif // HPP_CONSTRAINTS_NUMERIC_DEBUG
43 
44 # else // HPP_DEBUG
45 
46 # define HPP_DEBUG_SVDCHECK(svd) do { } while (0)
47 # define hppDnum(channel, data) do { } while (0)
48 
49 # endif // HPP_DEBUG
50 
51 #endif // HPP_CONSTRAINTS_MACROS_HH