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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: multidimensional sort Date: Tue, 17 Mar 2020 17:08:13 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <2e1f10ed-a442-4c69-a97c-5f184940a245@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 17 Mar 2020 16:08:13 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="5b2cc3fa5eedcfb9aea1b423f85ebb68"; logging-data="17207"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/73m9C94w8aMeVbcuUaqjatchnI3CX1J0=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 Cancel-Lock: sha1:gAJ9C9qtyjZg+QfUwog3TeF88tY= In-Reply-To: <2e1f10ed-a442-4c69-a97c-5f184940a245@googlegroups.com> Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:58210 Date: 2020-03-17T17:08:13+01:00 List-Id: On 3/17/20 1:31 PM, Gilbert Gosseyn wrote: > 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)) This appears to be a 2-D array, not 5, or perhaps a 1-D array of 1-D arrays with 5 components, so I'm not sure what you're asking in general. What would it look like for n = 4? -- Jeff Carter "Gentlemen, you can't fight in here. This is the War Room!" Dr. Strangelove 30