DoubleArray.st
author Claus Gittinger <cg@exept.de>
Thu, 23 Nov 1995 17:59:58 +0100
changeset 627 0a9e18feab08
parent 565 4f64b1faa6e2
child 1263 92c1db6b0776
permissions -rw-r--r--
checkin from browser

"
 COPYRIGHT (c) 1993 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

ArrayedCollection variableDoubleSubclass:#DoubleArray
	 instanceVariableNames:''
	 classVariableNames:''
	 poolDictionaries:''
	 category:'Collections-Arrayed'
!

!DoubleArray class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1993 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    DoubleArrays store doubleFloats values (and nothing else).
    They have been added to support heavy duty number crunching somewhat
    better than other smalltalks do. 
    Storing Floats & Doubles in these objects (instead of Arrays)
    has some benefits:

    1) since the values are stored directly (instead of pointers to them)
       both access overhead and garbage collect overhead is minimized.

    2) they can be much faster passed to c functions (such as graphics 
       libraries or heavy duty math packages), since the double values
       come packed and can be used in C by using a (double *) or double[].
       There is no need to loop over the array extracting doubles.      

    3) they could (in theory) be much more easily be processed by things like
       vector and array processors

    Be aware however, that Float- and DoubleArrays are not supported in other
    smalltalks - your program will thus become somewhat less portable.
    (since their protocol is the same as normal arrays filled with floats,
     they can of course be easily simulated - a bit slower though)

    Also, they could be simulated by a ByteArray, using doubleAt: and 
    doubleAtPut: messages to access the elements, but that seems a bit
    clumsy and unelegant. Also, the stc-compiler may learn how to deal
    with Float- and DoubleArrays, making accesses very fast in the future.

    Of course, DoubleArray can be subclasses and named instance variables
    be added.

    See example uses in the GLX interface and GLDemos.
"
! !

!DoubleArray class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic/DoubleArray.st,v 1.13 1995-11-23 16:59:58 cg Exp $'
! !