// Converts a result from the ckmeans.1d.dp algorithm to a Beat.
Converts a result from the ckmeans.1d.dp algorithm to a Beat.
// Converts a result from the ckmeans . 1d . dp algorithm to a Beat .
func makeBeat(at float64, cluster ckmeans.Cluster) Beat {
	taps := make([]time.Duration, len(cluster.Values))
	for i, v := range cluster.Values {
		taps[i] = Seconds(v)
	}
	return Beat{
		At:       Seconds(at),
		Mean:     Seconds(cluster.Center),
		Variance: Seconds(cluster.Variance),
		Taps:     taps,
	}
}
func makeBeat ( at float64 , cluster ckmeans . Cluster ) Beat { taps := make ( [ ] time . Duration , len ( cluster . Values ) ) for i , v := range cluster . Values { taps [ i ] = Seconds ( v ) } return Beat { At : Seconds ( at ) , Mean : Seconds ( cluster . Center ) , Variance : Seconds ( cluster . Variance ) , Taps : taps , } }
Converts a result from the ckmeans.1d.dp algorithm to a Beat.
Converts a result from the ckmeans . 1d . dp algorithm to a Beat .
//	sort.SliceStable(taps, func(i, j int) bool { return taps[i] < taps[j] })