libCEED icon indicating copy to clipboard operation
libCEED copied to clipboard

CeedVectorFilter

Open jeremylt opened this issue 6 months ago • 5 comments

@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/

jeremylt avatar May 30 '25 15:05 jeremylt

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).

zatkins-dev avatar May 30 '25 23:05 zatkins-dev

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.

jedbrown avatar May 31 '25 04:05 jedbrown

I think its "filter" like "high pass filter" instead of filter as seen in functional programming?

jeremylt avatar Jun 02 '25 16:06 jeremylt

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".

zatkins-dev avatar Jun 02 '25 18:06 zatkins-dev

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

jeremylt avatar Jun 02 '25 22:06 jeremylt