You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles Sadowski (Jira)" <ji...@apache.org> on 2021/06/17 11:07:00 UTC

[jira] [Commented] (NUMBERS-164) Port "sortInPlace" from Commons Math

    [ https://issues.apache.org/jira/browse/NUMBERS-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17364874#comment-17364874 ] 

Gilles Sadowski commented on NUMBERS-164:
-----------------------------------------

Please review the API in commit b34fa4cf4713bd0bd765dcb3fe633abdf8ff4e84 ("master" branch).

> Port "sortInPlace" from Commons Math
> ------------------------------------
>
>                 Key: NUMBERS-164
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-164
>             Project: Commons Numbers
>          Issue Type: Task
>          Components: arrays
>            Reporter: Gilles Sadowski
>            Assignee: Gilles Sadowski
>            Priority: Minor
>              Labels: api, port
>             Fix For: 1.0
>
>
> Method is currently in utility class [{{MathArrays}}|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=commons-math-legacy-core/src/main/java/org/apache/commons/math4/legacy/core/MathArrays.java;h=10a8ed15c848c0da08fc92bfd72907dd75d9cd47;hb=HEAD#l612].
> Proposed API:
> {code}
> public enum Sort implements BiConsumer<double[],double[][]> {
>     /** Sort in ascending order. */
>     ASCENDING((o1, o2) -> Double.compare(o1.key(), o2.key())),
>     /** Sort in descending order. */
>     DESCENDING(ASCENDING.comparator.reversed());
>     // ...
>     @Override
>     public void accept(double[] x,
>                        double[]... yList) {
>         // ...
>     }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)