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

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: arrays of floating point numbers / linear algebra operations into the DB
Дата
Msg-id 20080201145342.GC14265@svana.org
обсуждение исходный текст
Ответ на arrays of floating point numbers / linear algebra operations into the DB  (Enrico Sirola <enrico.sirola@gmail.com>)
Список pgsql-general
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 internally by the DB: from what I understood, arrays are
> basically a vector of Datum, and floating point numbers are stored by
> reference into Datums.

Well, arrays are not vectors of Datum, they are a vector of the objects
they contain. When passed to a function floats, arrays and other by-ref
types as passed by reference, but the array object itself does not
contain references, it contains the actual objects.

That doesn't necessarily make it the same as a C array though, the
alignment considerations may be different. But at first glance
certainly seems like an array would be in the right format for what
you're doing.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Stefan Schwarzer
Дата:
Сообщение: pg_restore fails for postgis data dump
Следующее
От: Tom Lane
Дата:
Сообщение: Re: problem with ORDER BY