-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add a function get_sparsity_pattern #307
Conversation
ddbf563
to
6c5578d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @amontoison !
Here is a first batch of comments.
04bd4d4
to
0cd1e10
Compare
0cd1e10
to
339e048
Compare
174fcf1
to
4991e76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just made a cosmetic comment, otherwise it's good to me. Thanks!
Co-authored-by: Tangi Migot <[email protected]>
Thanks for the review @tmigot 👍 |
* Add a function get_sparsity_pattern * Fix an error in sparsity_pattern.jl * Apply suggestions from code review Co-authored-by: Tangi Migot <[email protected]> * Fix a typo * Use multiple dispatch for get_sparsity_pattern * Fix sparse.md * Update src/sparsity_pattern.jl Co-authored-by: Tangi Migot <[email protected]> --------- Co-authored-by: Tangi Migot <[email protected]>
close #300
@frapac @sshin23 @jbcaillau @tmigot
I added a function,
get_sparsity_pattern
, to easily extract the sparsity pattern of the Jacobian or the Hessian of the Lagrangian from anyADNLPModel
orADNLSModel
:https://jso.dev/ADNLPModels.jl/previews/PR307/sparse/#Extracting-sparsity-patterns
This could help detect specific patterns that can be exploited in the linear algebra computations.
Additionally, if a problem needs to be solved multiple times, we can skip the sparsity pattern detection step by directly injecting the previously extracted pattern.
Example: https://jso.dev/ADNLPModels.jl/dev/sparsity_pattern/