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 665
    • Issues 665
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Custom issue tracker
    • Custom issue tracker
  • Merge requests 17
    • Merge requests 17
  • 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
  • libeigenlibeigen
  • eigeneigen
  • Issues
  • #597
Closed
Open
Issue created Dec 04, 2019 by Eigen Bugzilla@eigenbzReporter

Prune does not work as documented

Submitted by Kolja Brix

Assigned to Nobody

Link to original bugzilla bug (#597)
Version: 3.1

Description

Created attachment 336
Test code for bugs in prune() method in sparse matrix

Pruning (deleting entries with an absolute value smaller than a threshold) sparse matrices does not work as documented, please see the test code attached.

The problem arises in version 3.1.6 and newer.

The documentation states (taken from current http://eigen.tuxfamily.org/dox/TutorialSparse.html):


The second algorithm prunes on the fly the explicit zeros, or the values smaller than a given threshold. It is enabled and controlled through the prune() functions:
sm3 = (sm1 * sm2).prune(); // removes numerical zeros
sm3 = (sm1 * sm2).prune(ref); // removes elements much smaller than ref
sm3 = (sm1 * sm2).prune(ref,epsilon); // removes elements smaller than ref*epsilon


But none of the three methods works, the code does not compile.
The compiler error is "'const Type' has no member named 'prune'" in all three cases.

Moreover, calling the method prune for a SparseMatrix<double> does not work when no argument is specified, at least ref must be given.
The compiler error message is "no matching function for call to 'Eigen::SparseMatrix<double>::prune()'".
I would like to propose to set the default value of ref to 1.0.

Furthermore, prune() seems to only work in-place. Would it be possible to provide also a version for assignment, e.g. "sm2 = sm1.prune();"?

Attachment 336, "Test code for bugs in prune() method in sparse matrix":
prunetest.cpp

Blocking

#387 (closed)

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