From a8c2a4c55d840340645475e2e7d4e110cf9d5a35 Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Sun, 7 Sep 2014 09:58:09 +0200 Subject: [PATCH] Simplified code. Add/substract min value when interleaving. BigMin still broken. --- common/coords.go | 32 +++++++++++++------------------- common/coords_test.go | 18 ++++++++++++++++-- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/common/coords.go b/common/coords.go index a3b2318..719073c 100644 --- a/common/coords.go +++ b/common/coords.go @@ -14,6 +14,8 @@ const ( numBitsPerComponent = 12 modulo = 1 << numBitsPerComponent maxPositive = modulo / 2 + minValue = -1 << numBitsPerComponent + maxValue = 1<>= 1 } - if x >= 1<= 1<= 1< zmax { + t.Errorf("zmin > zmax: %d > %d\n", zmin, zmax) + } + errors, success := 0, 0 for zcode := range outsiders(zmin, zmax) { nbm := NaiveBigMin(zmin, zmax, zcode) @@ -214,8 +227,9 @@ func TestBigMin(t *testing.T) { } if errors > 0 { cub := Cuboid{P1: c1, P2: c2} - t.Errorf("BigMin: %s %d errors out of %d (%f)\n", + t.Errorf("BigMin: %s (%d %d) %d errors out of %d (%f)\n", cub, + zmin, zmax, errors, errors+success, float64(errors)/float64(errors+success)) }