Re: Arrays and FFTW

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alessandro Baretta <alex(at)baretta(dot)com>
Cc: PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Arrays and FFTW
Date: 2002-07-19 20:52:35
Message-ID: 15230.1027111955@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alessandro Baretta <alex(at)baretta(dot)com> writes:
> If I have to write the code myself, I would need to create a
> database function calling code from a C module. Such code
> would have to operate on real and complex float arrays. I
> understand how I could use a pl/pgsql function to create a
> new table where each signal is stored as a (signal_id,
> double array) tuple, but how am I supposed to pass such
> arrays to a C function? How are postgres arrays actually
> implemented in memory? In short, I need someone to get me
> started on writing an FFTW binding for pgsql, in none is
> already available.

You're intending to store each complete signal as a big array in one
row? That could get a bit ugly if the signals are very large (many
megabytes). But if you want to do it that way, I think the coding
would be pretty straightforward. See src/backend/utils/adt/float.c
for some examples of C functions that process arrays of floats ---
the "FLOAT AGGREGATE OPERATORS" section is relevant.
src/include/utils/array.h is relevant reading as well.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2002-07-19 21:05:40 Re: preserving statistics settings
Previous Message Tom Lane 2002-07-19 20:32:54 Re: prepareable statements