Added minimum
option to KSComp
#3229
Open
+78
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The existing
KSComp
has no option to compute the minimum of the input array, rather than the maximum. It does include thelower_flag
option, but that returns the negative of the minimum instead of the actual minimum because it assumes the component is being used to compute a constraint with a limit of zero (where it doesn't matter that the output is negated).Ideally, I think the
minimum
option should replacelower_flag
, but this would break backward compatibility. Maybe it should have a warning if bothlower_flag
andminimum
are specified? It works fine with both, but it's a weird thing to choose.Related Issues
Backwards incompatibilities
None
New Dependencies
None