madlib/madlib — pull request #287 by walkingsparrow (2012-12-08 01:50:53+00:00)
Title: kmeans: Fixed the dist_angle metric to return values when norm is 0

Jira MADlib-768

When distance metric 'madlib.dist_angle' is used, which is defined
as the angle between two vectors, Inf is obtained when either of the two
norms is 0. The angle is not defined mathematically. Just let the metric
return \pi under such circumstances to avoid error. This should not
affect the qulity of the result.