comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: how to copy complete column (or row) of matrix to another?
Date: Mon, 2 Oct 2017 18:08:57 -0500
Date: 2017-10-02T18:08:57-05:00	[thread overview]
Message-ID: <oqugub$iqi$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: e7eb0977-c449-4d52-8010-72df7c261e0f@googlegroups.com

"Lucretia" <laguest9000@googlemail.com> wrote in message 
news:e7eb0977-c449-4d52-8010-72df7c261e0f@googlegroups.com...
>I agree that multi-dimensional array slices should be supported. One
>of the tenet's of Ada is to leave the implementation of things up to the
>compiler, because it knows how best to do it, e.g. parameter passing.
>
>I asked about it here, 
>https://groups.google.com/d/msg/comp.lang.ada/L9XiRrjm3B0/cXfKlQ9-AwAJ
>and the response was, it's not going to happen due to a slice being a name 
>as Randy mentions,
>but it's not a request to speed up the assignment, it's just syntactic 
>sugar to aid readability,
>another of Ada's tenets.

Sigh.

The problem is that supporting that would slow down ALL array assignments to 
parameters, regardless of whether or not the 2-d slices are used. Every such 
assignment would have to be element at a time, because there would be no way 
to determine (within the subprogram) whether or not some slices were used 
that makes the array non-contiguous.

It also would make array indexing operations on such parameters much more 
expensive, for the same reason.

Use of matrixes is thought to be common enough that such a performance hit 
(on code *not* using slices) is unacceptable. This is known as a 
"distributed overhead", where the existence of a feature makes code that 
doesn't use it more expensive.

                                   Randy.



  reply	other threads:[~2017-10-02 23:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05  8:41 how to copy complete column (or row) of matrix to another? Nasser M. Abbasi
2017-09-05 22:45 ` Randy Brukardt
2017-09-05 23:10   ` Nasser M. Abbasi
2017-09-06  5:34     ` faryumg
2018-03-21 13:58       ` Marius Amado-Alves
2018-03-30 21:25         ` gerdien.de.kruyf
2017-09-06  7:17     ` Simon Wright
2017-09-06  7:31   ` Dmitry A. Kazakov
2017-09-09 22:33 ` darek
2017-09-09 22:48 ` darek
2017-09-12 12:57   ` Lucretia
2017-10-02 23:08     ` Randy Brukardt [this message]
2017-09-12 21:22 ` Johan Söderlind Åström
2017-09-17 12:01 ` Robert Eachus
replies disabled

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