Add TruncationUnion to support supplying minimal ranks#183
Conversation
`TruncationUnion` is the symmetric counterpart to `TruncationIntersection`, keeping values that are present in *any* component strategy. `NoTruncation` acts as the absorbing element (union with "keep all" = keep all). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
`minrank` provides a lower bound on the number of kept values, composing with other constraints via `TruncationUnion`. When no upper-bound constraints are active, `minrank` alone returns `truncrank(minrank)` directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add examples for the `minrank` keyword argument and the `|` operator, and add `@docs` entries for `TruncationIntersection` and `TruncationUnion`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
After the build completes, the updated documentation will be available here |
Mirrors the existing `_ind_intersect` overrides: collect GPU index vectors to CPU before computing the union, since `union` does not work on GPU arrays. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
... and 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
| true | ||
| ``` | ||
|
|
||
| Use `maxrank` together with a tolerance to keep at most `maxrank` values above the tolerance (intersection): |
There was a problem hiding this comment.
Can the tolerance be both/either relative/absolute?
There was a problem hiding this comment.
yes to all, although for this particular set of examples I think the focus is more on the fact that you can combine them, not necessarily on what trunctol accepts, which should be listed in the docstrings
| @test length(diagview(S2)) == 2 | ||
| @test collect(diagview(S2)) ≈ collect(diagview(S)[1:2]) | ||
| end | ||
| end |
There was a problem hiding this comment.
I am probably too tired, but this looks like two times the same identical block of code / set of tests?
There was a problem hiding this comment.
It is, but with the addition of the alg. The goal here is to test certain operations for the supplied alg, while the goal above is to test if things work for an array type if you have not specified alg.
This adds a new composite truncation strategy based on the concept of taking unions instead of intersections of existing truncations.
This allows for more advanced combinations, such as minimal tolerances, multiple split regions etc, in a very agnostic way that should work with other truncation schemes we don't even know about.
Fixes #181.