public double calcKMeansCosts ( double [ ] center , double [ ] point ) { assert ( this . sumPoints . length == center . length && this . sumPoints . length == point . length ) ; return ( this . sumSquaredLength + Metric . distanceSquared ( point ) ) - 2 * Metric . dotProductWithAddition ( this . sumPoints , point , center ) + ( this . numPoints + 1 ) * Metric . dotProduct ( center ) ; }
Calculates the k - means costs of the ClusteringFeature and a point too a center .