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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8c8550b9f2cf7d40 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-07 12:38:41 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: 18k11tm001@sneakemail.com (Russ) Newsgroups: comp.lang.ada Subject: Re: Is ther any sense in *= and matrices? Date: 7 Jun 2003 12:38:40 -0700 Organization: http://groups.google.com/ Message-ID: References: NNTP-Posting-Host: 63.194.87.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1055014721 32718 127.0.0.1 (7 Jun 2003 19:38:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 7 Jun 2003 19:38:41 GMT Xref: archiver1.google.com comp.lang.ada:38790 Date: 2003-06-07T19:38:41+00:00 List-Id: Preben Randhol wrote in message news:... > Vinzent Hoefler wrote: > > Preben Randhol wrote: > > > >>Vinzent Hoefler wrote: > >>> Of course it is. But because you have to write the Multiply function > >>> yourself anyway and such can take care of that issue, I don't see why > >>> this should be a problem. > >> > >>Because it doesn't make sense mathematically. > > > > Dividing by zero doesn't make sense either. So IMO that's what the > > Constraint_Error is for. > > The Contraint_Error here is for that *= would return a C (m x n) which > differes from the A (n x n). So *= is only usefule (/= too) in special > cases such as square matrix. Therefore you must make a function Prod > (A,B) at any rate and the *= will be of no use as Prod (A,B) is > general. "*=" is not so useful for multipying non-square matrices. However, it is very useful for multiplying a matrix (or a vector) by a scalar. For example, A *= 2.0 can be used to multiply matrix A by two in place. This is potentially more efficient than A := A * 2 for all the same reasons discussed with respect to "+=".