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

exceptions in vector constructor

Tags: None
(comma "," separated)
purth
Registered Member
Posts
5
Karma
0

exceptions in vector constructor

Fri Jan 28, 2011 8:24 am
Hello,

when I try to create a Vector with length 0 an exception is thrown in debug mode. Is this behavior intended?
For matrices it is possible to create a matrix with either zero rows or columns. This feature is sort of practical, since in my algorithm it might happen that certain matrices or vectors are of length zero and if no exception is thrown I don't have to worry about those cases.

Cheers,
purth
User avatar
bjacob
Registered Member
Posts
658
Karma
3
Are you talking about eigen 2 or 3?

Eigen2 was touchy with zero-sized objects, eigen 3 should be much better.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
purth
Registered Member
Posts
5
Karma
0

Re: exceptions in vector constructor

Tue Feb 01, 2011 12:11 pm
I am talking about Eigen 3. It just happens in debugging mode.
Right I'm simply using the standard constructor and afterwards I'm resizing the vector. This works for vectors of size zero in debugging mode.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
Oh, thanks, I didn't realized that there still was a problem.

Problem fixed, and unit test added.


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: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft