Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-03 Thread Enrico Sirola
I respond myself: Enrico Sirola ha scritto: [...] seems to work). The problem for the code above is that it doesn't work for vectors longer than 1000 elements or so (try it with 2000 and it doesn't work). I guess I should manage the "toasting" machinery in some ways - any suggestion is appre

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-03 Thread Enrico Sirola
Hi Webb, Webb Sprague ha scritto: I'm quite proud, this is my first C extension function ;-) I'd gladly post the code if it's ok for the list users. It's more or less 100 lines of code. This approach seems promising... I would definitely like to see it. here it goes: ---

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-02 Thread Webb Sprague
> I'm quite proud, this is my first C extension function ;-) > I'd gladly post the code if it's ok for the list users. It's more or > less 100 lines of code. This approach seems promising... I would definitely like to see it. > By the way, Webb: I took a look at GSL and it seems to me that, from

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-02 Thread Enrico Sirola
Hi Webb, Joe, Martijn Webb Sprague ha scritto: On Feb 1, 2008 2:31 AM, Enrico Sirola <[EMAIL PROTECTED]> wrote: Hello, I'd like to perform linear algebra operations on float4/8 arrays Having avoided a bunch of real work wondering about linear algebra and PG, did you consider the Gnu Scientifi

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Ron Mayer
Ted Byers wrote: > --- Webb Sprague <[EMAIL PROTECTED]> wrote: >>> ...linear algebra ... >> ... matrices and vectors . > ...Especially if some GIST or similar index >> could efficiently search > for vectors "close" to other vectors... > > I see a potential problem here, in terms of

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Webb Sprague
On Feb 1, 2008 2:31 AM, Enrico Sirola <[EMAIL PROTECTED]> wrote: > Hello, > I'd like to perform linear algebra operations on float4/8 arrays Having avoided a bunch of real work wondering about linear algebra and PG, did you consider the Gnu Scientific Library ? We would still need to hook everyth

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Ted Byers
--- Webb Sprague <[EMAIL PROTECTED]> wrote: > > ...linear algebra ... > > >>> ... matrices and vectors . > > >> ...Especially if some GIST or similar index > could efficiently search > > >> for vectors "close" to other vectors... > > > I see a potential problem here, in terms of how one define

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Webb Sprague
> ...linear algebra ... > >>> ... matrices and vectors . > >> ...Especially if some GIST or similar index could efficiently search > >> for vectors "close" to other vectors... > > > > Hmm. If I get some more interest on this list (I need just one LAPACK > > / BLAS hacker...), I will apply for

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Ron Mayer
Webb Sprague wrote: > On Feb 1, 2008 12:19 PM, Ron Mayer <[EMAIL PROTECTED]> wrote: >> Webb Sprague wrote: >>> On Feb 1, 2008 2:31 AM, Enrico Sirola <[EMAIL PROTECTED]> wrote: ...linear algebra ... >>> ... matrices and vectors . >> ...Especially if some GIST or similar index could efficiently

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Enrico Sirola
Hi Joe, I don't know if the speed will meet your needs, but you might test to see if PL/R will work for you: http://www.joeconway.com/plr/ You could use pg.spi.exec() from within the R procedure to grab the arrays, do all of your processing inside R (which uses whatever BLAS you've set

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Joe Conway
Enrico Sirola wrote: typically, arrays contain 1000 elements, and an operation is either multiply it by a scalar or multiply it element-by-element with another array. The time to rescale 1000 arrays, multiply it for another array and at the end sum all the 1000 resulting arrays should be enough

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Webb Sprague
(I had meant also to add that a linear algebra package would help Postgres to be the mediator for real-time data, from things like temprature sensors, etc, and their relationship to not-so-scientific data, say in a manufacturing environment). On Feb 1, 2008 12:19 PM, Ron Mayer <[EMAIL PROTECTED]

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Ron Mayer
Webb Sprague wrote: > On Feb 1, 2008 2:31 AM, Enrico Sirola <[EMAIL PROTECTED]> wrote: >> I'd like to perform linear algebra operations on float4/8 arrays... > > If there were a coherently designed, simple, and fast LAPACK/ MATLAB > style library and set of datatypes for matrices and vectors in >

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Webb Sprague
On Feb 1, 2008 2:31 AM, Enrico Sirola <[EMAIL PROTECTED]> wrote: > Hello, > I'd like to perform linear algebra operations on float4/8 arrays. > These tasks are tipically carried on using ad hoc optimized libraries > (e.g. BLAS). If there were a coherently designed, simple, and fast LAPACK/ MATLAB

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Enrico Sirola
Hi Colin, Il giorno 01/feb/08, alle ore 15:22, Colin Wetherbee ha scritto: I'm not sure about the internals of PostgreSQL (eg. the Datum object(?) you mention), but if you're just scaling vectors, consecutive memory addresses shouldn't be absolutely necessary. Add and multiply operations

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Martijn van Oosterhout
On Fri, Feb 01, 2008 at 11:31:37AM +0100, Enrico Sirola wrote: > Hello, > I'd like to perform linear algebra operations on float4/8 arrays. > These tasks are tipically carried on using ad hoc optimized libraries > (e.g. BLAS). In order to do this, I studied a bit how arrays are > stored inter

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Colin Wetherbee
Enrico Sirola wrote: Hello, I'd like to perform linear algebra operations on float4/8 arrays. These tasks are tipically carried on using ad hoc optimized libraries (e.g. BLAS). In order to do this, I studied a bit how arrays are stored internally by the DB: from what I understood, arrays are b

[GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Enrico Sirola
Hello, I'd like to perform linear algebra operations on float4/8 arrays. These tasks are tipically carried on using ad hoc optimized libraries (e.g. BLAS). In order to do this, I studied a bit how arrays are stored internally by the DB: from what I understood, arrays are basically a vector