Array operation for computing the dot product?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Feb 3 13:53:46 PST 2010


BCS wrote:
> Hello Ellery,
> 
>> On 02/03/2010 03:09 PM, Simen kjaeraas wrote:
>>
>>> On Wed, 03 Feb 2010 21:19:57 +0100, Michiel Helvensteijn
>>> <m.helvensteijn.remove at gmail.com> wrote:
>>>
>>>> bearophile wrote:
>>>>
>>>>>> Indeed. The difficult question is, what would the syntax be?
>>>>>>
>>>>> What about the simper:
>>>>> x.dot(y)
>>>> I don't like symmetric operations with an asymmetric syntax.
>>>>
>>>> Better: dot(x, y)
>>>> Even better: dot_product(x, y)
>>>> Funner: sum(x .* y)
>>> Weirder:
>>>
>>> x · y
>>>
>> I vote obscure unicode character \u2743: heavy chevron snowflake
>>
>> x ❆ y
>>
> 
> or why not: x ♣ y;
> 
> no wait that would delete y and assign x to it.

Before we solve the difficult problem of naming the thing could we first 
go through the trivial part of optimizing it under its current name.

http://www.digitalmars.com/d/2.0/phobos/std_numeric.html#dotProduct


Andrei



More information about the Digitalmars-d mailing list