Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute determinant for MX using CSparse #2621

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

nielsvd
Copy link
Contributor

@nielsvd nielsvd commented Jun 17, 2020

This PRQ adds a determinant computation for large sparse matrices using the LU decomposition of CSparse. This is useful for e.g., optimal experiment design where the D-optimality criterion involves computing the determinant.

Any feedback is welcome, let me know if you want to move the copyright notice.

@nielsvd nielsvd requested a review from jgillis June 17, 2020 16:48
@GiulioRomualdi
Copy link
Contributor

Hi @jgillis and @jaeandersson is there any plan to merge this PR? It would be a really useful feature

@jaeandersson
Copy link
Member

Hi @jgillis and @jaeandersson is there any plan to merge this PR? It would be a really useful feature

Sorry for slow response. I'm a bit questioning whether it should be using CSparse by default like this. A determinant can also be numerically calculated using CasADi's native sparse QR factorization, by just multiplying the diagonal entries of the R factor. That way, it could also support C code generation, which might be useful. We try to avoid having third-party codes (like CSparse) be used without having the user explicitly say that the particular external code is used. Part of the reason is to give the CSparse developers due credit.

So I'd like to at least implement LinsolInternal::det for the LinsolQr plugin (which calls the native QR factorization) and make this the default solver and make CSparse a choice in the public API (cf. MX::inv).

This is a trivial change though, so I could do this myself.

@jaeandersson jaeandersson self-assigned this Jan 5, 2021
@jaeandersson jaeandersson added this to the Version 3.6 milestone Jan 5, 2021
@jaeandersson
Copy link
Member

I'll make sure that it's merged (with the minor change mentioned above) before the 3.6 release.

@jaeandersson jaeandersson modified the milestones: Version 3.6, Version 3.7 Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants