Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • eigen eigen
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 649
    • Issues 649
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Custom issue tracker
    • Custom issue tracker
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libeigen
  • eigeneigen
  • Issues
  • #526
Closed
Open
Created Dec 04, 2019 by Eigen Bugzilla@eigenbzReporter

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

Edited Dec 05, 2019 by Eigen Bugzilla
Assignee
Assign to
Time tracking