[eigen] plea for a new feature to help debugging |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hi,
I know all developers of Eigen are busy due to bug fixing for Eigen3.
Still I want to start a discussion about a new feature for Eigen.
If an index to a matrix is out-of-range, one doesn't get any
information where this occurred. This is a restriction of C++
since it seems impossible to get the value of the __LINE__ macro at the
line where an inline function is expanded.
But it would be helpful to know the name of the matrix whose index was
out-of-range. To do this one needs an additional constructor parameter
'Name' which is defaulted to say 'NoName'. The matrix class would have
an additional string variable 'ID' which can be used for the error
message given to the exception object.
Of course, this additional variable ID would be present in the
DEBUG case (i.e. EIGEN_NO_DEBUG is undefined), only.
Usage:
VectorXi T(5,"T"); // second parameter is ignored if EIGEN_NO_DEBUG
This would be very help, esp. for beginners.
Helmut.