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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Robin" Newsgroups: comp.lang.ada Subject: Re: How to access an array using two different indexing schemes Date: Sun, 26 Nov 2017 02:39:25 +1100 Organization: Aioe.org NNTP Server Message-ID: References: Reply-To: "Robin" NNTP-Posting-Host: zgURL8BkmJu8LEkj1uTL5Q.user.gioia.aioe.org X-Complaints-To: abuse@aioe.org X-Priority: 3 X-Antivirus-Status: Clean X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-Notice: Filtered by postfilter v. 0.8.2 X-Antivirus: Avast (VPS 171125-0, 25/11/2017), Outbound message X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: feeder.eternal-september.org comp.lang.ada:48188 Date: 2017-11-26T02:39:25+11:00 List-Id: "Jeffrey R. Carter" wrote in message news:ov93ij$njh$1@dont-email.me... > On 11/24/2017 12:42 PM, Jerry wrote: >> I want to access an array such as Real_Vector (built-in for Ada >= 2005) with two different >> indexing schemes. For example, I would access a Real_Vector indexed (0 .. 4) when thinking of it >> as a times series and the same data indexed (1 .. 5) when thinking of it as a vector. Another >> application would be a vector indexed (-128 .. 127) because it fits my problem domain, perhaps a >> spatial variable, but I need to index it as (0 .. 255) when thinking of doing a Fast Fourier >> Transform on it. > > I can't think of any situation when I'd need to access the same component of an array using > different indices, It can arise in boundary value problems, where operations are carried out on all elements of a matrix except the first and last rows, and first and last columns. In PL/I, such situations are handled using the iSUB facility. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus