weibozhao commented on a change in pull request #24:
URL: https://github.com/apache/flink-ml/pull/24#discussion_r762975880



##########
File path: 
flink-ml-lib/src/main/java/org/apache/flink/ml/classification/knn/FastDistance.java
##########
@@ -0,0 +1,192 @@
+package org.apache.flink.ml.classification.knn;
+
+import org.apache.flink.api.java.tuple.Tuple2;
+import org.apache.flink.ml.linalg.DenseMatrix;
+import org.apache.flink.ml.linalg.DenseVector;
+import org.apache.flink.types.Row;
+import org.apache.flink.util.Preconditions;
+
+import org.apache.flink.shaded.curator4.com.google.common.collect.Iterables;
+
+import dev.ludovic.netlib.blas.F2jBLAS;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * FastDistance is an accelerated distance calculating method. It use matrix 
vector operation to
+ * improve speed of distance calculating.
+ *
+ * <p>The distance type in this class is euclidean distance:
+ *
+ * <p>https://en.wikipedia.org/wiki/Euclidean_distance
+ */
+public class FastDistance implements Serializable {
+    /** Label size. */
+    private static final int LABEL_SIZE = 1;
+
+    /** Maximum size of a matrix. */
+    private static final int SIZE = 5 * 1024 * 1024;
+
+    private static final int MAX_ROW_NUMBER = (int) Math.sqrt(200 * 1024 * 
1024 / 8.0);
+
+    /** The blas used to accelerating speed. */
+    private static final dev.ludovic.netlib.blas.F2jBLAS NATIVE_BLAS =
+            (F2jBLAS) F2jBLAS.getInstance();
+
+    /**
+     * Prepare the FastDistanceData, the output is a list of 
FastDistanceMatrixData. As the size of

Review comment:
       This class has been deleted.




-- 
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