Incorrect result of setLinSpaced
Submitted by Vladimir
Assigned to Nobody
Link to original bugzilla bug (#526)
Version: 3.1
Operating system: Windows
Description
Created attachment 303
output of setLinSpaced
Filling the array with numbers produces incorrect results
I want an array of 50 rows and 49 columns, filled with increasing numbers in columns, like this:
0 50 ... 2400
1 51 2401
2 52
3 53
. .
. .
. .
49 99 ... 2449
Here is the code:
ArrayXXi indsM(50, 49);
for(int i = 0; i < 49; ++i) {
indsM.col(i).setLinSpaced(50, i * 50, (i + 1) * 50 - 1);
}
cout << indsM << endl;
The complete output is in the attached file, here is the excerpt:
0 50 100 150 ... 2400
1 51 101 151 ... 2401
2 50 102 150
3 51 103 151
4 52 104 152
5 53 105 153
.
.
.
.
40 97 149 197 ... 2449
Please, note that all columns, where numbers end with fifty-something, are filled incorrectly.
I also tried overloaded setLinSpaced(low, high), the result is the same.
Attachment 303, "output of setLinSpaced":
linspaced_result.txt