Can we fix reverse operator overloading (opSub_r et. al.)?

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Mon Jul 13 00:31:40 PDT 2009


Robert Jacques wrote:
> On Fri, 10 Jul 2009 06:24:04 -0400, Lars T. Kyllingstad 
> <public at kyllingen.nospamnet> wrote:
>> There are actually three (four) basic types of vector/matrix 
>> multiplication, and the * operator would more or less be fitting for 
>> any of them:
>>    - element-by-element multiplication, which is what * means now
>>    - dot product
>>    - matrix multiplication
>>   (- cross product )
> 
> Actually, matrix multiplication and the dot product are both cases of 
> the inner product and the cross product is specific to 3D vectors.


Actually, the dot product is both a special case of matrix 
multiplication and an inner product. Matrix multiplication in general is 
not an inner product, since an inner product always associates two 
vectors with a scalar.

That aside, my point was simply that there are several operations for 
which one may want to use the '*' operator, and there is only one '*'. :)

-Lars



More information about the Digitalmars-d mailing list