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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fded8d14c74b14e5 X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Looking for Ada Technique Name and References Date: 2000/02/23 Message-ID: #1/1 X-Deja-AN: 588643174 References: <88uoim$8i81@news.cis.okstate.edu> X-Complaints-To: abuse@pacbell.net X-Trace: nnrp3-w.snfc21.pbi.net 951269528 206.170.2.236 (Tue, 22 Feb 2000 17:32:08 PST) Organization: SBC Internet Services NNTP-Posting-Date: Tue, 22 Feb 2000 17:32:08 PST Newsgroups: comp.lang.ada Date: 2000-02-23T00:00:00+00:00 List-Id: >Why is this obfuscated? It does Transpose (E) * F. The * operator does >multiplication. Transpose does invert the array, it just does so by >redefining it instead of moving stuff around in memory. It's not the Transpose does not invert the array. It tells the compiler to use a different definition of "*". Suppose the body of the Matrix."*" routine was re-written, say to take advantage of new vector arithmetic hardware or to fix an error. "Transpose (E) * F" would be no faster, and no more correct, since it actually calls a different "*" function entirely. It looks like "Transpose" is doing something to E, but instead it's modifying "*". Granted this seems like a useful little white lie, but tricky code makes me uncomfortable. The usual recommendation for tricky, but useful, code is to comment thoroughly. But compare X := Transpose(E) * F; -- use the Transpose_Left_And_Multiply function to X := TLM(E, F); -- X := Transpose(E) * F; Of course if you are trying to save the time of copying an array, you surely will use procedures, rather than array-returning functions, anyway.