Codebase list golang-github-beorn7-perks / 6dabc69
;) Blake Mizerany 11 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
4949 // higher ranks of the data distribution.
5050 // See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error properties.
5151 func NewBiased() *Stream {
52 f := func(s *stream, r float64) float64 {
52 ƒ := func(s *stream, r float64) float64 {
5353 return 2 * s.epsilon * r
5454 }
55 return newStream(f)
55 return newStream(ƒ)
5656 }
5757
5858 // NewTargeted returns an initialized Stream concerned with a particular set of
6060 // space and computation time.
6161 // See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error properties.
6262 func NewTargeted(quantiles ...float64) *Stream {
63 f := func(s *stream, r float64) float64 {
63 ƒ := func(s *stream, r float64) float64 {
6464 var m float64 = math.MaxFloat64
6565 var f float64
6666 for _, q := range quantiles {
7373 }
7474 return m
7575 }
76 return newStream(f)
76 return newStream(ƒ)
7777 }
7878
7979 // Stream computes quantiles for a stream of float64s. It is not thread-safe.