gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] GNU Go 3.1.32 - VC inconsistencies


From: Arend Bayer
Subject: Re: [gnugo-devel] GNU Go 3.1.32 - VC inconsistencies
Date: Thu, 18 Apr 2002 22:16:10 +0200 (CEST)

On Thu, 18 Apr 2002, Gunnar Farneback wrote:

> In mkpat.c we have some code to optimize the anchor point:
> 
>     mi = ((float)maxi - 1.0) / 2.0;
>     mj = ((float)maxj - 1.0) / 2.0 - 0.01;
>     for (k = 0; k != el; k++)
>       if (elements[k].att < 3 && (elements[k].att & anchor) != 0) {
>       d = gg_abs((float)elements[k].x - mi)
>         + gg_abs((float)elements[k].y - mj);
>       if (d < min_d) {
>         min_k = k;
>         min_d = d;
>       }
>       }
> 
> Due to the 0.01 offset the numbers become inexactly represented and we
> get the platform dependency potential. The patch below fixes this with
> a gg_normalize_float() call, but the real question is why we have this
> offset at all.

I assume this is because the DFA spiral is not symmetric (it starts by
going SOUTH then going EAST), and so the optimal anchor point may e.g.
be preferred to be one element to the left than on element to the right
of the center (both to reduce the size of the DFA and the pattern matching
runtime). The databases contribute a non-negligeable asymmetry as well, e.g.
most patterns in owl_*.db that have a border have it on the SOUTH edge.

(Note that only one of the eight orientations of the spiral is used when
the DFA is built.)

Arend





reply via email to

[Prev in Thread] Current Thread [Next in Thread]