Codebase list golang-github-beorn7-perks / c83a37f
make defaultEpsilon a const in newStream Blake Mizerany 10 years ago
1 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
5151 f := func(s *stream, r float64) float64 {
5252 return 2 * s.epsilon * r
5353 }
54 return newStream(0.01, f)
54 return newStream(f)
5555 }
5656
5757 // NewTargeted returns an initialized Stream concerned with a particular set of
7272 }
7373 return m
7474 }
75 return newStream(0.01, f)
75 return newStream(f)
7676 }
7777
7878 // Stream calculates quantiles for a stream of float64s.
8181 b Samples
8282 }
8383
84 func newStream(epsilon float64, ƒ invariant) *Stream {
85 x := &stream{epsilon: epsilon, ƒ: ƒ, l: list.New()}
84 func newStream(ƒ invariant) *Stream {
85 const defaultEpsilon = 0.01
86 x := &stream{epsilon: defaultEpsilon, ƒ: ƒ, l: list.New()}
8687 return &Stream{x, make(Samples, 0, 500)}
8788 }
8889