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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b375f07e05d12c7a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-13 13:23:48 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!cyclone2.usenetserver.com!usenetserver.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: Larry Hazel Newsgroups: comp.lang.ada Subject: Re: efficient vector/matrix operations in Ada Date: Mon, 13 Aug 2001 15:23:14 -0500 Organization: MindSpring Enterprises Message-ID: <3B783732.A3A1EB82@mindspring.com> References: <3B6F40C1.FD215D1D@sneakemail.com> <3B6F5ABC.3C40E189@sneakemail.com> <9f6e2b77.0108100854.66b084b4@posting.google.com> NNTP-Posting-Host: c7.ae.9c.2b Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 13 Aug 2001 20:24:08 GMT X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en,x-ns11F8K63r3NhQ,x-ns2r2e09OnmPe2 Xref: archiver1.google.com comp.lang.ada:11869 Date: 2001-08-13T20:24:08+00:00 List-Id: Russ wrote: > > Here's how you write "A = B + C + D;" efficiently: > > A = B; > A += C; > A += D; > > This requires no temporary matrices or passing by value. The original > form (A=B+C+D) is fine for rapid prototyping, but the efficient form > is preferable for production code. As far as I am concerned, Ada > really needs arithmetic assignment operators. Sure, you can use > procedures, but they're intent and effect is not as obvious to the > reader. > Seems to me if a compiler can't generate the most efficient code for A = B + C + D or A := B + C + D in any language, you need a different compiler. Larry