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

From: Enrico Sirola <enrico(dot)sirola(at)gmail(dot)com>
To: Webb Sprague <webb(dot)sprague(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: arrays of floating point numbers / linear algebra operations into the DB
Date: 2008-02-03 16:35:35
Message-ID: 47A5ED57.8070606@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 appreciated

wrong. it was just that I forgot to add ARR_OVERHEAD_NONULLS(ndims1) to
the mem allocation for rv:

rv = (ArrayType *) palloc(nbytes);

becomes

rv = (ArrayType *) palloc(nbytes) + ARR_OVERHEAD_NONULLS(ndims1);

and now it seems to work :)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shane Ambler 2008-02-03 17:00:25 Re: [OT] "advanced" database design (long)
Previous Message Adrian Klaver 2008-02-03 15:34:38 Re: temp sequence