This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOlVED] subscript checking

Tags: None
(comma "," separated)
HWJ
Registered Member
Posts
18
Karma
0

[SOlVED] subscript checking

Wed Feb 18, 2009 9:20 am
Hi,

I'm teaching C++ and in my experience one very often gets out-of-bound indices when developping code. This was one of the reason for my own matrix library I have written some years, ago, (non-templated).

So, is there an (optional, of course) checking of index bounds in Eigen2?

Eigen2 looks very promising and fills an important gap since even the
forthcoming new C++ standard (2009?) doesn't improve support for
matrix calculcations.

Many thanks for a hint,
Helmut.

Last edited by ggael on Wed Feb 18, 2009 11:32 am, edited 1 time in total.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

RE: subscript checking

Wed Feb 18, 2009 9:34 am
Hi,

yes checking of index bounds is the default behavior in debug mode, i.e., when NDEBUG is not defined. Also note that such bound checking only occurs when using operator() and operator[]. The more explicit .coeff() and .coeffRef() member functions bypass this test (unless EIGEN_INTERNAL_DEBUGGING is defined).

See: http://eigen.tuxfamily.org/dox/classEig ... 2015b21530
User avatar
bjacob
Registered Member
Posts
658
Karma
3

RE: [SOlVED] subscript checking

Wed Feb 18, 2009 1:26 pm
HWJ wrote:since even the forthcoming new C++ standard (2009?) doesn't improve support for
matrix calculcations.


It may not directly improve support for matrix computations, but that's only because the design philosophy of c++ is to put in the language itself only the minimum to allow making libraries. I can tell you that C++09 is a real christmas wishlist for Eigen, and if we had had C++09 we could have made many parts of Eigen code simpler. Unfortunately, it'll be another 5 years at least before we can require C++09, wrt to our more conservative users.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell