(vars []float64, q, ε float64)
| 408 | } |
| 409 | |
| 410 | func getBounds(vars []float64, q, ε float64) (minBound, maxBound float64) { |
| 411 | // TODO(beorn7): This currently tolerates an error of up to 2*ε. The |
| 412 | // error must be at most ε, but for some reason, it's sometimes slightly |
| 413 | // higher. That's a bug. |
| 414 | n := float64(len(vars)) |
| 415 | lower := int((q - 2*ε) * n) |
| 416 | upper := int(math.Ceil((q + 2*ε) * n)) |
| 417 | minBound = vars[0] |
| 418 | if lower > 1 { |
| 419 | minBound = vars[lower-1] |
| 420 | } |
| 421 | maxBound = vars[len(vars)-1] |
| 422 | if upper < len(vars) { |
| 423 | maxBound = vars[upper-1] |
| 424 | } |
| 425 | return |
| 426 | } |
| 427 | |
| 428 | func TestSummaryVecCreatedTimestampWithDeletes(t *testing.T) { |
| 429 | for _, tcase := range []struct { |
no outgoing calls
no test coverage detected