From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:aed:2499:: with SMTP id t25mr5256044qtc.127.1584448301945; Tue, 17 Mar 2020 05:31:41 -0700 (PDT) X-Received: by 2002:aca:4858:: with SMTP id v85mr3174337oia.51.1584448301633; Tue, 17 Mar 2020 05:31:41 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 17 Mar 2020 05:31:41 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=2a02:6d40:37b4:9a01:7dc0:7cc7:6ddc:6c75; posting-account=3Fg1FgoAAACfsmWScNfMD1tGFhR4DU0o NNTP-Posting-Host: 2a02:6d40:37b4:9a01:7dc0:7cc7:6ddc:6c75 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2e1f10ed-a442-4c69-a97c-5f184940a245@googlegroups.com> Subject: multidimensional sort From: Gilbert Gosseyn Injection-Date: Tue, 17 Mar 2020 12:31:41 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58207 Date: 2020-03-17T05:31:41-07:00 List-Id: I want to sort an n-dim array by ascending dimensions and ascending elements as keys, in Ada. For example: consider an array with n = 5 like: ((5, 8, 21, 37, 46), (5, 7, 12, 19, 26), (10, 12, 19, 33, 44), (7, 8, 34, 36, 38), (5, 11, 12, 27, 32), (10, 16, 30, 41, 45), (10, 13, 19, 40, 45), (10, 11, 18, 32, 41), (11, 28, 34, 37, 38)) which shall become ((5, 7, 12, 19, 26), (5, 8, 21, 37, 46), (5, 11, 12, 27, 32), (7, 8, 34, 36, 38), (10, 11, 18, 32, 41), (10, 12, 19, 33, 44), (10, 13, 19, 40, 45), (10, 16, 30, 41, 45), (11, 28, 34, 37, 38)) How to store, how to sort, and how to deallocate the original? Thank you for your advice.