libCEED
libCEED copied to clipboard
CeedVectorFilter
@zatkins-dev would it be adequate to your purposes to add this in libCEED? (Though you could access it via PETSc also)
https://petsc.org/release/manualpages/Vec/VecFilter/
I swear whoever names these functions is doing it to hurt me specifically. Filter?? I think the libCEED version should be more sensibly named, threshold or clip or something. Filter to me implies selecting a subset based on a condition (see the python intrinsic of the same name).
I feel it. FWIW, it was once Chop and changed to Filter in https://gitlab.com/petsc/petsc/-/merge_requests/6699.
A closely related name is the "shrink" operation.
I think its "filter" like "high pass filter" instead of filter as seen in functional programming?
I mean, I would argue that the high-pass filter interpretation means that "Filter" is still too vague, but if we want parity with PETSc functions I can support it.
I would really like the words "threshold" and "clip" in the function documentation so I can search for it easier -- something like "filters the entries of a vector by clipping entries with absolute value below a threshold to zero".
That feels reasonable - I don't like deviating from the names PETSc uses if we can avoid it, even if I hate the name PETSc gave a function