-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-32190: [C++][Compute] Implement cumulative prod, max and min funct…
…ions (#36020) ### Rationale for this change Implement cumulative prod, max and min compute functions ### What changes are included in this PR? 1. Add implementations, docs and tests for the three functions. 2. Refactor `CumulativeSumOptions` to `CumulativeOptions` for reusability. 3. Fix a bug where `GenericFromScalar(GenericToScalar(std::nullopt)) != std::nullopt`. 4. Remove an unnecessary Cast with the default start value. 5. Add tests to check behavior with `NaN`. I'll explain some of the changes in comments. ### Are these changes tested? Yes, in vector_accumulative_ops_test.cc and test_compute.py ### Are there any user-facing changes? No. The data members of `CumulativeSumOptions` are changed, but the member functions behave as before. And std::optional<T> also can be constructed directly from T. So users should not feel any difference. * Closes: #32190 Lead-authored-by: Jin Shang <[email protected]> Co-authored-by: Benjamin Kietzman <[email protected]> Signed-off-by: Benjamin Kietzman <[email protected]>
- Loading branch information
Showing
14 changed files
with
1,096 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.