[Pharo-project] Issue 3701 in pharo: FloatArray>>dot: is defined in plugin but not at the image level

pharo at googlecode.com pharo at googlecode.com
Mon Feb 14 10:09:06 CET 2011


Status: FixedWaitingToBePharoed
Owner: stephane... at gmail.com
Labels: Milestone-1.3 Type-Squeak Difficulty-Easy

New issue 3701 by stephane... at gmail.com: FloatArray>>dot: is defined in  
plugin but not at the image level
http://code.google.com/p/pharo/issues/detail?id=3701

Name: Collections-ul.423
Author: ul
Time: 7 February 2011, 8:55:57.134 pm
UUID: e18716fc-a36b-874c-8946-5c21b447a96f
Ancestors: Collections-ul.422

- use the primitive for FloatArray >> #dot: (~50x faster).

=============== Diff against Collections-ul.422 ===============

Item was changed:
  ----- Method: FloatArray>>dot: (in category 'arithmetic') -----
  dot: aFloatVector
        "Primitive. Return the dot product of the receiver and the argument.
        Fail if the argument is not of the same size as the receiver."
+
        | result |
+       <primitive: 'primitiveDotProduct' module: 'FloatArrayPlugin'>
-       "<primitive:'primitiveFloatArrayDotProduct'>"
        self size = aFloatVector size ifFalse:[^self error:'Must be equal  
size'].
        result := 0.0.
        1 to: self size do:[:i|
                result := result + ((self at: i) * (aFloatVector at: i)).
        ].
        ^result!






More information about the Pharo-project mailing list