-
Notifications
You must be signed in to change notification settings - Fork 2
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
Increase sparsity for Diagonal
inputs
#165
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #165 +/- ##
==========================================
- Coverage 92.70% 91.83% -0.88%
==========================================
Files 37 37
Lines 1590 1763 +173
==========================================
+ Hits 1474 1619 +145
- Misses 116 144 +28 ☔ View full report in Codecov by Sentry. |
Is this even necessary? |
This issue started with #145, where a user had a The functionality of this PR is just 10 LOC to obtain much sparser patterns. Most of it is rewriting our array tests to be more flexible. |
I think this PR does two things: 1) more overloads for Diagonal inside generic code and 2) handling a Diagonal as input of sparsity detection. I'm only questioning the legitimacy of 2. While ComponentArrays or Symmetric matrices as input to sparsity detection make sense, Diagonal matrices make less sense to me. |
Point 2) is 4 LOC and worth it for easier testing of point 1), even if no user ever has |
I'm just asking where you draw the line. To push this reasoning to the extreme, we want code to work if it uses FillArrays internally, but no sane person would give a FillArray as input of sparsity detection |
I definitely want to support As soon as we "internally" support an array type, it makes sense to write a matching
Your point reminds me that we don't explicitly test FillArrays yet. |
By having
trace_input
create aDiagonal
matrix of tracers with only the indices fromdiagind
, the sparsity of patterns can be increased by a lot onDiagonal
inputs:Previously, this would have returned a dense pattern of ones (see #147).