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 Topics Snippets
  • Register
  • Sign in
  • eigen eigen
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 699
    • Issues 699
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Custom issue tracker
    • Custom issue tracker
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
    • Model experiments
  • 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
  • #875
Closed
Open
Issue created Dec 04, 2019 by Eigen Bugzilla@eigenbzReporter

SparseMatrixBase<Derived>::nonZeros() is broken for most types of Derived

Submitted by Henrik Friberg

Assigned to Nobody

Link to original bugzilla bug (#875)
Version: 3.3 (current stable)

Description

The call to nonZeros() on a SparseSparseProduct object leads to an infinite recursion smacking the stack. This can be seen by running valgrind with the verbose "-v" parameter on the following example:


#include "Eigen/SparseCore"
#include <iostream>

using namespace Eigen;

typedef SparseMatrix<double, ColMajor> SpMat;

int main(int argc, char **argv)
{
const int m = 3;

SpMat A(m,m);  
A.insert(0,0) = 1.0;  
A.insert(1,1) = 2.0;  
A.insert(2,2) = 3.0;  
A.makeCompressed();  

SpMat B(m,m);  
B.insert(0,0) = 1.0;  
B.insert(1,1) = 2.0;  
B.insert(2,2) = 3.0;  
B.makeCompressed();  

int nnz = (A * B).nonZeros();  

std::cout << nnz << std::endl;  

}

Blocking

#558 (closed)

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