Boost logo

Ublas :

Subject: [ublas] question regarding elementwise matrix product
From: Kaveh Kohan (kaveh.kohan_at_[hidden])
Date: 2009-05-22 17:47:12


Hi everybody,

Would you please somebody tell me what is the most efficient way to do element-wise matrix multiplication or division? I guess using the iterator is the most efficient way but is there any cache issue or something like that? This kind of matrix product is Hadamard matrix product. Some blas vendors like sgi has optimized version of blas in which Hadamard product is implemented:

http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/p_man/cat3/SCSL/DHAD.z

I was wondering can ublas interface with those of course with some scarification on performance or it is not possible? If it is not possible what is the best approach to perform Hadamard product or element-wise matrix product.

Regards,
Kaveh