From: dmitry@elros.cbb-automation.de (Dmitry Kazakov)
Subject: Re: efficient vector/matrix operations in Ada
Date: Mon, 13 Aug 2001 07:50:33 GMT
Date: 2001-08-13T07:50:33+00:00 [thread overview]
Message-ID: <3b7781ea.292937@news.cis.dfn.de> (raw)
In-Reply-To: 9f6e2b77.0108100854.66b084b4@posting.google.com
On 10 Aug 2001 09:54:33 -0700, B_Gaffney@My-Deja.com (B.Gaffney)
wrote:
>"Russ P." <18k11tm001@sneakemail.com> wrote in message news:<3B6F5ABC.3C40E189@sneakemail.com>...
>> No, you really need the dynamically instantiated temporary matrix, I
>> believe. I've been through this little lesson years ago. Don't forget
>> that you also need to be able to handle expressions such as "A = B + C +
>> D;". You can play complicated games with static arrays of "work"
>> matrices, but you are asking for trouble and the resulting code is
>> likely to not be re-entrant.
>
>Um, OK, but how would you handle this case using your "+="
>implementation? That was your original point wasn't it?
One could allow to define "accelerators" for binary and unary
operations. For instance:
function "+" (A, B : Matrix) return Matrix;
procedure InPlaceSum (A : in out Matrix, B : Matrix);
pragma Accelerator (InPlaceSum, "+");
The compiler should replace calls to "+" with calls to InPlaceSum if
the left argument is temporal. So B+C+D has to be compiled into:
InPlaceSum ("+"(B,C),D)
[or silently ignore the pragma (:-))]
As for +=, it would be nice to extend the set of operators in Ada.
However it should be done in a consistent manner, i.e. for each
operator @ there should a @:= counterpart. Like "<=:=" for "<=". A bit
cumsy, isn't it? And what to do with "and" or "abs"? (:-))
Regards,
Dmitry Kazakov
next prev parent reply other threads:[~2001-08-13 7:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-07 1:13 efficient vector/matrix operations in Ada Russ
2001-08-07 2:18 ` Dale Stanbrough
2001-08-07 2:21 ` tmoran
2001-08-07 3:04 ` Russ P.
2001-08-10 16:54 ` B.Gaffney
2001-08-13 7:50 ` Dmitry Kazakov [this message]
2001-08-13 19:45 ` Russ
2001-08-13 20:23 ` Larry Hazel
2001-08-13 21:26 ` Ted Dennison
2001-08-14 4:46 ` Russ
2001-08-14 5:28 ` David Starner
2001-08-14 8:17 ` Alexander Boucke
2001-08-14 8:56 ` Lutz Donnerhacke
2001-08-14 10:54 ` Jacob Sparre Andersen
2001-08-13 21:30 ` Ted Dennison
2001-08-14 4:56 ` Russ
2001-08-14 7:32 ` efficient vector/matrix operations in Fortran, was Re: ... " tmoran
2001-08-14 14:05 ` efficient vector/matrix operations " Ted Dennison
-- strict thread matches above, loose matches on Subject: below --
2001-08-07 11:36 Gautier Write-only-address
2001-08-14 12:37 Gautier Write-only-address
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox