Example #1
0
func NewCentroidWeighted(data []float64, weight int64) *Centroid {
	return &Centroid{
		Vec:   data,
		Ids:   utils.NewHash64Set(),
		Count: weight,
		Id:    0,
	}
}
Example #2
0
func NewCentroidSimple(dim int, lsh int64) *Centroid {
	data := make([]float64, dim)
	Ids := utils.NewHash64Set()
	Ids.Add(lsh)
	return &Centroid{
		Vec:   data,
		Ids:   Ids,
		Count: 0,
		Id:    lsh,
	}
}