Re: [pure-lang-users] case
Status: Beta
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2008-08-29 20:41:28
|
Eddie Rucker wrote: > Using the method GSL uses internally for vectors and matrices seems > reasonable and would probably allow for fast routines and make it easy > for interfacing to other libraries and/or hardware. To avoid having Pure depend on GSL, I can hopefully just replicate the memory allocation and view functionality from GSL and massage them for my needs (I probably need to add a reference counter to the gsl_matrix and vector structs in order to support contiguous slices in an efficient way). I'll also expose the interface to the Pure matrix and vector data in the public runtime API, so that you have easy access to it from C, too. I still have some other stuff on my TODO list right now (specifically, I want to add a basic stream implementation a la SICP to the library), but I can hopefully start working on the vector/matrix stuff some time next week. > I think that maybe some of the primitive operations like addition, > subtraction, multiplication, and a reciprocal function might be handled > best internally in Pure though. Before you say no too quickly, let me > point out that GSL_BLAS has a bunch of steps involved just to multiply > two matrices. If we want to replicate this kind of functionality, it can be done just as well in the Pure GSL wrapper. I really think that all linear algebra functionality belongs there, so that we have a clear cut between the interpreter's basic matrix/vector container support and the GSL wrapper's more advanced functionality. Otherwise we'll just end up duplicating stuff. So in the Pure vector/matrix support, I want to concentrate on the basic container functionality, including efficient element access and slicing. Pure programmers will then be able to do basic vector/matrix stuff using these operations and the array comprehensions, or they can fire up the GSL wrapper once it's available, to do more advanced stuff and take advantage of the speedy C implementation. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |