mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-17 15:48:17 +01:00
Simplified code for naiv BigMin implementation.
This commit is contained in:
parent
c096b8bbf1
commit
85741f3b0e
@ -229,15 +229,17 @@ func TranscodeInterleavedToPlain(key []byte) ([]byte, error) {
|
||||
|
||||
// For correctness checks only.
|
||||
func NaiveBigMin(minz, maxz, zcode int64) int64 {
|
||||
c1, c2 := InterleavedToCoord(minz), InterleavedToCoord(maxz)
|
||||
var (
|
||||
c1 = InterleavedToCoord(minz)
|
||||
c2 = InterleavedToCoord(maxz)
|
||||
cand = minz
|
||||
c Coord
|
||||
)
|
||||
|
||||
cand := minz
|
||||
|
||||
for x := c1.X; x <= c2.X; x++ {
|
||||
for y := c1.Y; y <= c2.Y; y++ {
|
||||
for z := c1.Z; z <= c2.Z; z++ {
|
||||
z := CoordToInterleaved(Coord{X: x, Y: y, Z: z})
|
||||
if z > zcode && z < cand {
|
||||
for c.X = c1.X; c.X <= c2.X; c.X++ {
|
||||
for c.Y = c1.Y; c.Y <= c2.Y; c.Y++ {
|
||||
for c.Z = c1.Z; c.Z <= c2.Z; c.Z++ {
|
||||
if z := CoordToInterleaved(c); z > zcode && z < cand {
|
||||
cand = z
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user