comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Any easy/build-in construct to extract submatrices from larger matrix?
Date: Mon, 2 Jul 2012 23:22:46 -0500
Date: 2012-07-02T23:22:46-05:00	[thread overview]
Message-ID: <jsts2q$fr3$1@munin.nbi.dk> (raw)
In-Reply-To: 3f8db781-fd78-4505-837d-1811c0f9b96f@googlegroups.com

"Adam Beneschan" <adam@irvine.com> 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.





  reply	other threads:[~2012-07-03  4:22 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-24  8:05 Any easy/build-in construct to extract submatrices from larger matrix? Nasser M. Abbasi
2012-06-24  8:24 ` Dmitry A. Kazakov
2012-06-24  8:55   ` Nasser M. Abbasi
2012-06-24 11:10     ` Dmitry A. Kazakov
2012-06-24 12:16       ` Nasser M. Abbasi
2012-06-24 16:11         ` Dmitry A. Kazakov
2012-06-24 17:14           ` Nasser M. Abbasi
2012-06-24 18:33             ` Dmitry A. Kazakov
2012-06-25  5:44             ` J-P. Rosen
2012-06-25  6:32               ` Nasser M. Abbasi
2012-06-25  7:54                 ` J-P. Rosen
2012-06-25  8:20                   ` Dmitry A. Kazakov
2012-06-25 14:21                   ` Nasser M. Abbasi
2012-06-25  8:36                 ` Georg Bauhaus
2012-06-25 13:17                   ` Nasser M. Abbasi
2012-06-26 11:44                     ` Georg Bauhaus
2012-06-25 16:49                 ` Pascal Obry
2012-06-25 17:36                   ` Nasser M. Abbasi
2012-06-25 18:49                     ` stefan-lucks
2012-06-26  4:41                       ` Nasser M. Abbasi
2012-06-26  7:15                 ` Jacob Sparre Andersen
2012-06-26  9:51                   ` Nasser M. Abbasi
2012-06-25  9:33               ` Simon Wright
2012-06-26  2:48 ` Jerry
2012-06-26  4:19   ` Nasser M. Abbasi
2012-06-26  7:06   ` Nasser M. Abbasi
2012-06-26 12:54     ` Robert A Duff
2012-06-26 15:19       ` Adam Beneschan
2012-06-26 21:14         ` Robert A Duff
2012-06-27 23:42     ` Shark8
2012-06-26  7:10   ` Dmitry A. Kazakov
2012-06-26 15:06   ` Adam Beneschan
2012-06-26 21:19     ` Robert A Duff
2012-06-26 21:40       ` Adam Beneschan
2012-07-03  4:22         ` Randy Brukardt [this message]
2012-07-03  8:37           ` Dmitry A. Kazakov
2012-07-05  1:33             ` Randy Brukardt
2012-07-05  7:08               ` Dmitry A. Kazakov
2012-07-06 23:47                 ` Randy Brukardt
2012-07-07  8:22                   ` Dmitry A. Kazakov
2012-07-05 18:56               ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox