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

std::bad_alloc problem

Tags: None
(comma "," separated)
davidwang
Registered Member
Posts
12
Karma
0

Re: std::bad_alloc problem

Tue Feb 18, 2014 4:28 am
Your test code also works well on my machine.

But my own still does not work. I will see what I can do to
provide you with more useful information.

D.
davidwang
Registered Member
Posts
12
Karma
0

Re: std::bad_alloc problem

Wed Feb 19, 2014 2:24 pm
I think I figured out the remaining problem.

In SparseMatrix.h, line 1084, you can see the definition of "positions":
VectorXi positions(dest.outerSize());

In my data, some numbers in the vector of "positions" are too large
to be represented by integers. So I changed VectorXi to VectorXl (long).
Then the problem went away. Of course we need to define VectorXl first.

D.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: std::bad_alloc problem

Wed Feb 19, 2014 8:43 pm
ah, thanks for finding this. I only searched for 'int'. Fixed:

https://bitbucket.org/eigen/eigen/commits/3b221f1f7633/
Changeset: 3b221f1f7633
User: ggael
Date: 2014-02-19 21:42:29
Summary: More int versus Index fixes


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]