zhipeng93 commented on a change in pull request #73:
URL: https://github.com/apache/flink-ml/pull/73#discussion_r836088275



##########
File path: flink-ml-core/src/main/java/org/apache/flink/ml/linalg/BLAS.java
##########
@@ -32,9 +32,31 @@ public static double asum(DenseVector x) {
     }
 
     /** y += a * x . */
-    public static void axpy(double a, DenseVector x, DenseVector y) {
+    public static void axpy(double a, Vector x, DenseVector y) {
         Preconditions.checkArgument(x.size() == y.size(), "Vector size 
mismatched.");
-        JAVA_BLAS.daxpy(x.size(), a, x.values, 1, y.values, 1);
+        if (x instanceof SparseVector) {
+            axpy(a, (SparseVector) x, y);
+        } else {
+            axpy(a, (DenseVector) x, y);
+        }
+    }
+
+    /** Computes the hadamard product of the two vectors (y = y \hdot x). */
+    public static void hDot(Vector x, Vector y) {

Review comment:
       With some offline discussion, Weibo is fine with the change and also 
thinks it is better to keep the code consistent.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to