Skip to content

Commit

Permalink
Added missing sqrt and simplified notation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ramesesz committed Dec 17, 2023
1 parent 11e11b4 commit daf25e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/builtin/dist.dml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

m_dist = function(Matrix[Double] X) return (Matrix[Double] Y) {
n = nrow(X)
s = rowSums(X * X)
Y = - 2*X %*% t(X) + s + t(s)
s = rowSums(X^2)
Y = sqrt(-2 * X %*% t(X) + s + t(s))
Y = replace(target = Y, pattern=NaN, replacement = 0);
}

0 comments on commit daf25e2

Please sign in to comment.