24 #ifndef _ELEMENTWISE_UBLAS_HPP_ 25 #define _ELEMENTWISE_UBLAS_HPP_ 28 #include <boost/numeric/ublas/vector.hpp> 39 template <
class v1,
class v2>
42 typedef typename v1::value_type D;
44 std::transform(a.begin(),a.end(),b.begin(),c.begin(),std::multiplies<D>());
52 template <
class v1,
class v2>
55 typedef typename v1::value_type D;
57 std::transform(a.begin(),a.end(),b.begin(),c.begin(),std::divides<D>());
Namespace of the library interface.
v1 ublas_elementwise_prod(const v1 &a, const v2 &b)
Computes the elementwise product of two vectors or matrices.
v1 ublas_elementwise_div(const v1 &a, const v2 &b)
Computes the elementwise division of two vectors or matrices.