scalanlp / breeze

Breeze is/was a numerical processing library for Scala.
https://www.scalanlp.org
Apache License 2.0
3.45k stars 693 forks source link

How to run element-wise product between DenseMatrix and DenseVector like numpy? #790

Closed liulfy closed 4 years ago

liulfy commented 4 years ago

in numpy, we can procedure element-wise product between 2darray and 1darray like this:

import numpy as np a = np.array([[1,2],[3,4]]) b = np.array([5,6]) a*b

array([[ 5, 12], [15, 24]])

So how to achieve the same effect in breeze?

liulfy commented 4 years ago

my machine cannot compile (::, *), and how to achieve this?

liulfy commented 4 years ago

need import breeze.linalg.*