Re: [GENERAL] efficient math vector operations on arrays

2015-12-29 Thread Jim Nasby
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:

Re: [GENERAL] efficient math vector operations on arrays

2015-12-29 Thread Tom Lane
Jim Nasby writes: > 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. That wouldn't be useful for the example given

Re: [GENERAL] efficient math vector operations on arrays

2015-12-29 Thread Jim Nasby
On 12/29/15 6:50 PM, Tom Lane wrote: Jim Nasby writes: >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. That

Re: [GENERAL] efficient math vector operations on arrays

2015-12-27 Thread Jony Cohen
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 Regards, - Jony On Fri, Dec 25, 2015 at 9:58 PM, Jim Nasby wrote: > On

Re: [GENERAL] efficient math vector operations on arrays

2015-12-25 Thread Jim Nasby
On 12/24/15 1:56 AM, Pavel Stehule wrote: I don't know any extension that calculate euclid distance, but it should be trivial in C - if you don't need to use generic types and generic operations. Before messing around with that, I'd recommend trying either pl/r or pl/pythonu. -- Jim Nasby,

Re: [GENERAL] efficient math vector operations on arrays

2015-12-23 Thread Pavel Stehule
2015-12-24 8:34 GMT+01:00 Marcus Engene : > On 24/12/15 07:13, Pavel Stehule wrote: > > Hi > > 2015-12-24 8:05 GMT+01:00 Marcus Engene : > >> Hi, >> >> Are there highly efficient C extensions out there for math operations on >> arrays? Dot product and

[GENERAL] efficient math vector operations on arrays

2015-12-23 Thread Marcus Engene
Hi, Are there highly efficient C extensions out there for math operations on arrays? Dot product and whatnot. Example usecase: sort an item by euclid distance. Kind regards, Marcus -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] efficient math vector operations on arrays

2015-12-23 Thread Pavel Stehule
Hi 2015-12-24 8:05 GMT+01:00 Marcus Engene : > Hi, > > Are there highly efficient C extensions out there for math operations on > arrays? Dot product and whatnot. > what you mean "highly efficient" ? PostgreSQL executor is interpret - so in almost all cases the special

Re: [GENERAL] efficient math vector operations on arrays

2015-12-23 Thread Marcus Engene
On 24/12/15 07:13, Pavel Stehule wrote: Hi 2015-12-24 8:05 GMT+01:00 Marcus Engene >: Hi, Are there highly efficient C extensions out there for math operations on arrays? Dot product and whatnot. what you mean "highly efficient" ?