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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,32d9aa9d79729b31 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.241.162 with SMTP id wj2mr1543104pbc.2.1341289372125; Mon, 02 Jul 2012 21:22:52 -0700 (PDT) MIME-Version: 1.0 Path: l9ni10735pbj.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!newsfeed.utanet.at!newsfeed.tele2net.at!newsfeed.straub-nv.de!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Any easy/build-in construct to extract submatrices from larger matrix? Date: Mon, 2 Jul 2012 23:22:46 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <788af57d-750d-418d-94bb-75c6557e36a9@g4g2000pbn.googlegroups.com> <3f8db781-fd78-4505-837d-1811c0f9b96f@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1341289370 16227 69.95.181.76 (3 Jul 2012 04:22:50 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 3 Jul 2012 04:22:50 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-07-02T23:22:46-05:00 List-Id: "Adam Beneschan" wrote in message news:3f8db781-fd78-4505-837d-1811c0f9b96f@googlegroups.com... > On Tuesday, June 26, 2012 2:19:36 PM UTC-7, Robert A Duff wrote: > >> > I realize that this may not be important to all programmers, and that >> > they'd rather have the ability to express what they want and not worry >> > about whether it slows things down ("distributed overhead"). But I >> > think that being able to generate efficient code was one of the design >> > principles in Ada 83. >> >> Well, efficient code (or more precisely, avoiding distributed overhead) >> was a design goal of Fortran, too, yet Fortran has multi-dim slices. >> You have to pass in the "stride" (distance between noncontiguous >> pieces). > > True. That's a pretty small amount of overhead. Huh? A stride isn't enough for a general slice. I suppose you are thinking that a slice has to be a 1D array, but that doesn't follow IMHO. I always thought that a 2D slice should be 2D (at least possible to have that). And if you have something like M (2 .. 3, 2 .. 4), this is does not have fixed strides between the included elements. Even if you assume a slice is 1D, you have to support selecting parts of rows, and the syntax would have two dimensions. All which means that the result would be too complex to use for most people. Not to mention the extra overhead. (I agree that the overhead would not be too bad for unconstrained array parameters, which are passing a descriptor anyway; but for constrained array parameters, which don't pass any descriptors, this would require a substantial change in the way array parameters are passed and managed (adding a lot of overhead to the uses of those arrays).) > Really, I was just making an educated guess as to why they allowed > 1-dimensional slices > but not higher dimensions. I don't have the real answer, unless I > happened to guess right. > Does anyone else know more about this? Not really; I've always assumed like you did (and as above). The Ada 83 Rationale doesn't say anything about this in the section on slices, so it may be lost to the mists of time. Randy.