[squeak-dev] Re: Scientific Squeak

Danny Chan chan_dhf at yahoo.de
Sat Apr 19 14:47:26 UTC 2008


Am Samstag, 19. April 2008 12:20:39 schrieb nice:
> Matthew Fulmer wrote:
> > On Fri, Apr 18, 2008 at 10:39:27PM +0200, Danny Chan wrote:
> >> Hi!  Lately I have been playing with approaches to implement
> >> multi dimensional arrays  in squeak with functionality similar
> >> to python's numpy library.
> >>
> >> <snip>
> >>
> >> And finally, does something better already exist?
> >
> > SmalLapack already kinda exists:
> > http://ncellier.ifrance.com/Smallapack/
>
> Yes, that's a first attempt toward a scientific library.
> Unfortunately, if all tests pass on Dolphin and VW (not 100% covergae
> though), that's not the case of the Squeak version. Still bleding edge
> with image blocking (win32) or crashing (linux).
>
> I also have an unpublished link to FFTW in VW.
>
> Nicolas

Sounds interesting. There are two things I need in a matrix package, I would 
be interested if this can be done with Smallapack:

I need the ability to generate views into a data set like it is possible in 
python or Matlab. For example, in python I can do something like this to raw 
image data in a 2 dimensional matrix:

# selects a sub matrix containing every second pixel in each dimension
redChannel = image[::2, ::2]               
# selects a square of 50 pixels in the top left of the image
topLeft = redChannel[0:50, 0:50]

Each of the sub matrices is a view into the data and does not copy values.

Another thing I need quite often is the ability to change the interpretaion of 
the matrix data buffer on the fly. In python:

# charData is an array with n elements of type char
charData.dtype = dtype('int16')
# now charData is an array with n/2 elements of type short, interpreting the 
sequence of two bytes as one short


If this is not possible, what would be needed to make Smallapack support this? 

Danny




More information about the Squeak-dev mailing list