Remove flawed Point.Equal function

This commit is contained in:
Christian Muehlhaeuser
2018-05-29 04:19:04 +02:00
parent 731515890f
commit eaeb5a110c
2 changed files with 0 additions and 23 deletions

View File

@@ -26,18 +26,6 @@ func (c Clusters) Nearest(point Point) int {
return ci
}
// removePoint removes a point's assignment to this cluster
func (c *Cluster) removePoint(p Point) {
var pp Points
for _, v := range c.Points {
if !v.Equal(p) {
pp = append(pp, p)
}
}
c.Points = pp
}
// recenter recenters a cluster
func (c *Cluster) recenter() {
center, err := c.Points.Mean()

View File

@@ -20,17 +20,6 @@ func (p Point) Distance(p2 Point) float64 {
return r
}
// Equal returns true if the two points have equal values
func (p Point) Equal(p2 Point) bool {
for i := range p {
if p[i] != p2[i] {
return false
}
}
return true
}
// Mean returns the mean point of p
func (p Points) Mean() (Point, error) {
var l = len(p)