[go: up one dir, main page]

SparseMatrix division by scalar seems to be using dense math

Submitted by Alec Jacobson

Assigned to Nobody

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

Description

In Eigen 3.2.9 the follow code is fast/instantaneous:

Eigen::SparseMatrix<double> I = Eigen::SparseMatrix<double>(100000,100000);
Eigen::SparseMatrix<double> B = I / 100.0;

this suggests that Eigen was only doing the division on the non-zeros (and there aren't any so it's fast).

However, in Eigen 3.3.1 and 3.3.90 the code takes a very long time and uses >1GB in memory. This suggests that its using dense rather than sparse math.

In my library we're doing operations like this to sparse matrices all of the time. Is this sparse matrix divided by scalar no longer supported?

Edited by Eigen Bugzilla