This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 588 - Compute a determinant using SparseLU
Summary: Compute a determinant using SparseLU
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: unspecified
Hardware: All All
: Normal enhancement
Assignee: Desire NUENTSA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3.3
  Show dependency treegraph
 
Reported: 2013-04-15 17:41 UTC by Desire NUENTSA
Modified: 2019-12-04 12:16 UTC (History)
2 users (show)



Attachments
Support for the determinant with Sparse LU (5.30 KB, application/octet-stream)
2013-04-15 17:41 UTC, Desire NUENTSA
no flags Details

Description Desire NUENTSA 2013-04-15 17:41:47 UTC
Created attachment 331 [details]
Support for the determinant with Sparse LU

Currently, It should be straightforward to compute the determinant of a sparse matrix using the decomposition returned by the SparseLU module.
An implementation is available in the attached patch. 
However, this determinant can easily overflow. Equilibrate the matrix before the factorization can fix the issue.
This is useful as well to limit the amount of pivoting. So we should add this functionnality before pushing the support to compute the determinant.
Comment 1 Christoph Hertzberg 2013-04-18 14:20:18 UTC
(In reply to comment #0)
> However, this determinant can easily overflow. Equilibrate the matrix before
> the factorization can fix the issue.

An alternative to avoid overflow would be to compute log(abs(determinate)) and sign(determinate). That is what, e.g., numpy offers (search for slogdet).
Comment 2 Gael Guennebaud 2013-04-19 14:10:51 UTC
(In reply to comment #1) 
> An alternative to avoid overflow would be to compute log(abs(determinate)) and
> sign(determinate). That is what, e.g., numpy offers (search for slogdet).

This is also what HouseholderQR already offers.
Comment 3 Desire NUENTSA 2013-04-19 14:20:46 UTC
(In reply to comment #2)
> (In reply to comment #1) 
> > An alternative to avoid overflow would be to compute log(abs(determinate)) and
> > sign(determinate). That is what, e.g., numpy offers (search for slogdet).
> 
> This is also what HouseholderQR already offers.

Thanks,
So, we will provide the two versions together with sign(determinant), with a warning about risks of overflow/underflow when calling abs(determinant).
Comment 4 Desire NUENTSA 2013-06-11 14:55:34 UTC
The feature is now available with this changeset

https://bitbucket.org/eigen/eigen/commits/c3e84dfb5afb/
Changeset:   c3e84dfb5afb
User:        dnuentsa
Date:        2013-06-11 14:46:13
Summary:     Fix bug 588 : Compute a determinant using SparseLU
Affected #:  1 file
Comment 5 Nobody 2019-12-04 12:16:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/588.

Note You need to log in before you can comment on or make changes to this bug.