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

ArrayXd can't resize

Tags: None
(comma "," separated)
liuzhipeng
Registered Member
Posts
1
Karma
0

ArrayXd can't resize

Sat Jul 05, 2014 4:57 am
Hello, I'm using Eigen to do some work, but I meet some troubles.

In one function, I need a tmp array, so I defined ArryXd xyz, and then xyz.resize(x, y), the 2nd line is next to the 1st line. It can be compiled, but when I debug it, it can't run at the 2nd line which is xyz.resize(x, y)

the hint is "invalid sizes of matrix or array"

I debugged the program, I'm sure the number of size is correct.

I used it before, and it could run previously, can anybody help to resolve it?

My working environment is win7x64sp1, MSYS2x64 with mingw64-4.9.0 for MSYS2, and eigen was installed separately.
jitseniesen
Registered Member
Posts
204
Karma
2

Re: ArrayXd can't resize

Mon Jul 07, 2014 11:10 am
The issue may be that ArrayXd is a one-dimensional array. If you want a two-dimensional array, you need ArrayXXd (two Xs indicating two dimensions). This is different from MatrixXd which is always two-dimensional, because a "one-dimensional matrix" is called a vector.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]