Hi,

I tried to find element-wise multiplication for arrays. Does SciDB support element-wise operations such as element-wise multiplication, division, etc?

Hi,

I tried to find element-wise multiplication for arrays. Does SciDB support element-wise operations such as element-wise multiplication, division, etc?

Yes, by using join and apply instead of a native operator like matrix multiply. Here is an example:

iquery -aq "store(build(<x:double>[i=1:10,10,0,j=1:10,10,0],i+j),U)"

iquery -aq “store(build(<x:double>[i=1:10,10,0,j=1:10,10,0],i-j),V)”

iquery -aq “store(project(apply(join(U,V), y, U.x * V.x), y), W)”

Hi, I just found this thread after searching quite a bit for point-wise operations on two or more arrays in SciDB.

This seems really inefficient and requires more computation than usual. Is there a more optimized function or query to able to achieve this primitive? Maybe for operations such as element-wise addition or subtraction?

For those wondering, constructing a n+1 dimension array and then flattening it using an aggregation operation is approx ~10x faster than doing joins on individual arrays.