Re: efficient math vector operations on arrays - Mailing list pgsql-general

From Jim Nasby
Subject Re: efficient math vector operations on arrays
Date
Msg-id 56832215.5030501@BlueTreble.com
Whole thread Raw
In response to Re: efficient math vector operations on arrays  (Jony Cohen <jony.cohenjo@gmail.com>)
Responses Re: efficient math vector operations on arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 12/27/15 2:00 AM, Jony Cohen wrote:
> Hi, Don't know if it's exactly what you're looking for but the MADLib
> package has utility function for matrix and vector operations.
> see: http://doc.madlib.net/latest/group__grp__array.html

Apply an operator to al elements on an array or pair of arrays:
http://theplateisbad.blogspot.com/2015/12/the-arraymath-extension-vs-plpgsql.html,
https://github.com/pramsey/pgsql-arraymath.

See also
http://theplateisbad.blogspot.com/2015/12/more-fortran-90-like-vector-operations.html.

BTW, if you want to simply apply a function to all elements in an array
there is an internal C function array_map that can do it. There's no SQL
interface to it, but it shouldn't be hard to add one.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


pgsql-general by date:

Previous
From: Jim Nasby
Date:
Subject: Re: cannot get stable function to use index
Next
From: Tom Lane
Date:
Subject: Re: cannot get stable function to use index