The Inbox: Collections-ul.423.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Collections-ul.423.mcz

commits-2
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ul.423.mcz

==================== Summary ====================

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!