1
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
ArrayedCollection variableDoubleSubclass:#DoubleArray
|
|
14 |
instanceVariableNames:''
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Collections-Indexed'
|
|
18 |
!
|
|
19 |
|
|
20 |
DoubleArray comment:'
|
|
21 |
|
|
22 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
|
23 |
All Rights Reserved
|
|
24 |
|
|
25 |
DoubleArrays store double floats (and nothing else).
|
|
26 |
They have been added to support heavy duty number crunching somewhat
|
|
27 |
more than other smalltalks do. Storing Floats & Doubles in these
|
|
28 |
objects many benefits:
|
|
29 |
|
|
30 |
1) since the values are stored directly (instead of pointers to them)
|
|
31 |
both access overhead and garbage collect overhead is minimized.
|
|
32 |
|
|
33 |
2) they can be much faster passed to c functions (such as graphics
|
|
34 |
libraries or heavy duty math packages)
|
|
35 |
|
|
36 |
3) they could (in theory) be much more easily be processed by things like
|
|
37 |
vector and array processors
|
|
38 |
|
|
39 |
Be aware however, that Float- and DoubleArrays are not supported in other
|
|
40 |
smalltalks - your program will thus become somewhat less portable.
|
|
41 |
(since their protocol is the same as normal arrays filled with floats,
|
|
42 |
they can of course be easily simulated - a bit slower)
|
|
43 |
|
|
44 |
See an example use in the GLX interface.
|
|
45 |
|
|
46 |
%W% %E%
|
|
47 |
|
|
48 |
written june 93 by claus
|
|
49 |
'!
|