Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • eigen eigen
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 680
    • Issues 680
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Custom issue tracker
    • Custom issue tracker
  • Merge requests 20
    • Merge requests 20
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and 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
  • libeigenlibeigen
  • eigeneigen
  • Issues
  • #1104
Closed
Open
Issue created Dec 04, 2019 by Eigen Bugzilla@eigenbzReporter

Add ability to iterate (non-nested) over values in sparse matrix

Submitted by Matthew Woehlke

Assigned to Nobody

Link to original bugzilla bug (#1104)
Version: 3.4 (development)

Description

In modern C++, especially with range-based for, and considering that SparseMatrix::InnerIterator knows the row and column, it would be useful to have an iterator that allowed visiting every non-zero cell without a nested loop. For example:

for (auto iter : /adapt/(sparse_matrix))
{
static_assert(decltype(iter) == decltype(sparse_matrix)::InnerIterator);
// do stuff with iter
}

It's debatable if direct iteration should be permitted (and whether such should include zero cells also), or if construction of an adaptor would be required (different adaptors could provide sparse or dense iteration).

Depends on

#1271 #231 (closed)

Blocking

#1179 #1608

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