Baunsgaard commented on code in PR #1959:
URL: https://github.com/apache/systemds/pull/1959#discussion_r1423014807


##########
scripts/builtin/dist.dml:
##########
@@ -32,7 +32,8 @@
 # 
-----------------------------------------------------------------------------------------------
 
 m_dist = function(Matrix[Double] X) return (Matrix[Double] Y) {
-  G = X %*% t(X);
-  Y = sqrt(-2 * G + outer(diag(G), t(diag(G)), "+"));
+  n = nrow(X)
+  s = rowSums(X * X)
+  Y = - 2*X %*% t(X) + s + t(s)

Review Comment:
   
   
   1. missing sqrt
   2. rowSums could be of X^2 (it recompile it but just to simplify.)



-- 
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: dev-unsubscr...@systemds.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to