comp.lang.ada
 help / color / mirror / Atom feed
From: Vinzent Hoefler <ada.rocks@jlfencey.com>
Subject: Re: Is ther any sense in *= and matrices?
Date: Thu, 05 Jun 2003 18:38:37 +0200
Date: 2003-06-05T18:38:37+02:00	[thread overview]
Message-ID: <bbnrot$ba59c$1@ID-175126.news.dfncis.de> (raw)
In-Reply-To: slrnbdupg6.88r.randhol+abuse@kiuk0152.chembio.ntnu.no

Preben Randhol wrote:

>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).

Ok, understood.

Depends on how you look at it:

Let's take an extreme example and suppose I have an integer type
defined only for range 0 .. 1. So writing a += would only make sense
for the "special" case that at least one of the operands is zero, not
for the general case, because then the result doesn't fit into the
original operand. But I wouldn't say, writing such a function wouldn't
make sense at all... ;)

In the matrix case it's just that you can't write a *= that works for
the more general case. Simple as that. I really wouldn't see a problem
with that.

>So *= is only usefule (/= too) in special
>cases such as square matrix.

Yes.

>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.

No, maybe you want to multiply square matrices only? ;)


Vinzent.

-- 
Parents strongly cautioned  --  this  posting  is  intended for mature
audiences  over  18.  It  may  contain some material that many parents
would not find suitable for children and may include intense violence,
sexual situations, coarse language and suggestive dialogue.



  reply	other threads:[~2003-06-05 16:38 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-05 10:45 Is ther any sense in *= and matrices? Preben Randhol
2003-06-05 11:13 ` Vinzent Hoefler
2003-06-05 11:28   ` Preben Randhol
2003-06-05 11:53     ` Vinzent Hoefler
2003-06-05 15:27       ` Preben Randhol
2003-06-05 15:40         ` Vinzent Hoefler
2003-06-05 15:47           ` Preben Randhol
2003-06-05 16:38             ` Vinzent Hoefler [this message]
2003-06-05 17:16               ` Preben Randhol
2003-06-05 17:17               ` Preben Randhol
2003-06-05 17:59                 ` Vinzent Hoefler
2003-06-07 19:38             ` Russ
2003-06-08  6:46               ` John R. Strohm
2003-06-08 18:51                 ` Russ
2003-06-08 20:52                   ` tmoran
2003-06-09  4:24                     ` Russ
2003-06-09  5:13                       ` John R. Strohm
2003-06-10  9:38                         ` Ole-Hjalmar Kristensen
2003-06-10 16:11                           ` Wesley Groleau
2003-06-10 19:24                             ` Ole Kristensen
2003-06-10 18:33                           ` Russ
2003-06-10 23:16                             ` John R. Strohm
2003-06-09  6:58                       ` tmoran
2003-06-08 22:23                   ` John R. Strohm
2003-06-09  6:06                     ` Russ
2003-06-09 10:06                       ` Mango Jones
2003-06-08 22:56                   ` Bobby D. Bryant
2003-06-09  4:27                     ` Russ
2003-06-09  5:17                       ` John R. Strohm
2003-06-09 14:53                       ` Bobby D. Bryant
2003-06-09 17:46                         ` Russ
2003-06-10  9:57                           ` Ole-Hjalmar Kristensen
2003-06-05 12:33     ` John R. Strohm
2003-06-05 19:25   ` Wesley Groleau
2003-06-05 20:17     ` David C. Hoos
2003-06-05 20:52       ` Wesley Groleau
  -- strict thread matches above, loose matches on Subject: below --
2003-06-10 19:00 tmoran
2003-06-10 19:37 ` Ole Kristensen
2003-06-10 19:37 ` Ole Kristensen
2003-06-10 19:48 ` Ole Kristensen
replies disabled

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