Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cmm.499.mcz ==================== Summary ==================== Name: Collections-cmm.499 Author: cmm Time: 28 January 2013, 8:19:08.858 pm UUID: 9af9bd27-3342-4203-88e5-22c85c57d5ae Ancestors: Collections-bf.498 FloatCollection inherits the convenient add:/remove: API of OrderedCollection, but using an internal FloatArray for better efficiency. =============== Diff against Collections-bf.498 =============== Item was added: + OrderedCollection subclass: #FloatCollection + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'Collections-Sequenceable'! + + !FloatCollection commentStamp: 'cmm 1/28/2013 19:49' prior: 0! + FloatCollctions store 32bit IEEE floating point numbers.! Item was added: + ----- Method: FloatCollection class>>arrayType (in category 'overriding') ----- + arrayType + ^ FloatArray! Item was added: + ----- Method: FloatCollection>>addLast: (in category 'as yet unclassified') ----- + addLast: aFloat + aFloat isNumber ifFalse: [ self error: 'This collection can only store Floats.' ]. + ^ super addLast: aFloat! |
If I understand correctly, another difference between a FloatCollection and an OrderedCollection of Floats, besides the noted efficiency due to the use of FloatArray, is that a FloatCollection will store IEEE 32-bit single precision floats, while an OrderedCollection of Floats will store double precision floats. Is this correct? This is analogous to the current difference between an Array of Floats and a FloatArray.
On Jan 29, 2013, at 02:19 , [hidden email] wrote: > Chris Muller uploaded a new version of Collections to project The Trunk: > http://source.squeak.org/trunk/Collections-cmm.499.mcz > > ==================== Summary ==================== > > Name: Collections-cmm.499 > Author: cmm > Time: 28 January 2013, 8:19:08.858 pm > UUID: 9af9bd27-3342-4203-88e5-22c85c57d5ae > Ancestors: Collections-bf.498 > > FloatCollection inherits the convenient add:/remove: API of OrderedCollection, but using an internal FloatArray for better efficiency. > > =============== Diff against Collections-bf.498 =============== > > Item was added: > + OrderedCollection subclass: #FloatCollection > + instanceVariableNames: '' > + classVariableNames: '' > + poolDictionaries: '' > + category: 'Collections-Sequenceable'! > + > + !FloatCollection commentStamp: 'cmm 1/28/2013 19:49' prior: 0! > + FloatCollctions store 32bit IEEE floating point numbers.! > > Item was added: > + ----- Method: FloatCollection class>>arrayType (in category 'overriding') ----- > + arrayType > + ^ FloatArray! > > Item was added: > + ----- Method: FloatCollection>>addLast: (in category 'as yet unclassified') ----- > + addLast: aFloat > + aFloat isNumber ifFalse: [ self error: 'This collection can only store Floats.' ]. > + ^ super addLast: aFloat! > > |
Yes.
On Tue, Jan 29, 2013 at 10:00 AM, Douglas McPherson <[hidden email]> wrote: > If I understand correctly, another difference between a FloatCollection and an OrderedCollection of Floats, besides the noted efficiency due to the use of FloatArray, is that a FloatCollection will store IEEE 32-bit single precision floats, while an OrderedCollection of Floats will store double precision floats. Is this correct? This is analogous to the current difference between an Array of Floats and a FloatArray. > > > On Jan 29, 2013, at 02:19 , [hidden email] wrote: > >> Chris Muller uploaded a new version of Collections to project The Trunk: >> http://source.squeak.org/trunk/Collections-cmm.499.mcz >> >> ==================== Summary ==================== >> >> Name: Collections-cmm.499 >> Author: cmm >> Time: 28 January 2013, 8:19:08.858 pm >> UUID: 9af9bd27-3342-4203-88e5-22c85c57d5ae >> Ancestors: Collections-bf.498 >> >> FloatCollection inherits the convenient add:/remove: API of OrderedCollection, but using an internal FloatArray for better efficiency. >> >> =============== Diff against Collections-bf.498 =============== >> >> Item was added: >> + OrderedCollection subclass: #FloatCollection >> + instanceVariableNames: '' >> + classVariableNames: '' >> + poolDictionaries: '' >> + category: 'Collections-Sequenceable'! >> + >> + !FloatCollection commentStamp: 'cmm 1/28/2013 19:49' prior: 0! >> + FloatCollctions store 32bit IEEE floating point numbers.! >> >> Item was added: >> + ----- Method: FloatCollection class>>arrayType (in category 'overriding') ----- >> + arrayType >> + ^ FloatArray! >> >> Item was added: >> + ----- Method: FloatCollection>>addLast: (in category 'as yet unclassified') ----- >> + addLast: aFloat >> + aFloat isNumber ifFalse: [ self error: 'This collection can only store Floats.' ]. >> + ^ super addLast: aFloat! >> >> > > |
In reply to this post by commits-2
On 29 January 2013 02:19, <[hidden email]> wrote:
> Chris Muller uploaded a new version of Collections to project The Trunk: > http://source.squeak.org/trunk/Collections-cmm.499.mcz > > ==================== Summary ==================== > > Name: Collections-cmm.499 > Author: cmm > Time: 28 January 2013, 8:19:08.858 pm > UUID: 9af9bd27-3342-4203-88e5-22c85c57d5ae > Ancestors: Collections-bf.498 > > FloatCollection inherits the convenient add:/remove: API of OrderedCollection, but using an internal FloatArray for better efficiency. > > =============== Diff against Collections-bf.498 =============== > > Item was added: > + OrderedCollection subclass: #FloatCollection > + instanceVariableNames: '' > + classVariableNames: '' > + poolDictionaries: '' > + category: 'Collections-Sequenceable'! > + > + !FloatCollection commentStamp: 'cmm 1/28/2013 19:49' prior: 0! > + FloatCollctions store 32bit IEEE floating point numbers.! > > Item was added: > + ----- Method: FloatCollection class>>arrayType (in category 'overriding') ----- > + arrayType > + ^ FloatArray! > > Item was added: > + ----- Method: FloatCollection>>addLast: (in category 'as yet unclassified') ----- > + addLast: aFloat > + aFloat isNumber ifFalse: [ self error: 'This collection can only store Floats.' ]. > + ^ super addLast: aFloat! I just noticed that CI says you're wrong: http://build.squeak.org/job/SqueakTrunk/lastBuild/testReport/junit/CollectionsTests.Sequenceable/FloatCollectionTest/testInternalArray/ Regressions: FloatCollectionTest>>testInternalArray FloatCollectionTest(ClassTestCase)>>testUnCategorizedMethods (Well, I say "you're wrong" but this is just the most recent commit to FloatCollection. You might be exposing a deficiency in the tests.) frank |
Free forum by Nabble | Edit this page |