gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] use fixed point arithmetics in accumulat_influence


From: Gunnar Farneback
Subject: Re: [gnugo-devel] use fixed point arithmetics in accumulat_influence
Date: Sat, 30 Nov 2002 17:38:29 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

Arend wrote:
> Well at least permeability I'd prefer to store in fixed point (because
> this is used so often in the inner loop in accumulate_influence()).
> Everything else could be stored in float, yes.

Maybe you misunderstood me somewhat. I was thinking of something that
would roughly look like

static void
compute_influence(struct influence_data *q, int color, int pos,
                  char no_influence[BOARDMAX], char saved_stones[BOARDMAX])
{
  [...]

  [Convert needed variables from float to fixed point.]

  for (ii = BOARDMIN; ii < BOARDMAX; ii++)
    if (ON_BOARD(ii)) {
      if (q->white_strength[ii] > 0.0)
        accumulate_influence(q, ii, WHITE);
      if (q->black_strength[ii] > 0.0)
        accumulate_influence(q, ii, BLACK);
    }

  [Convert fixed point values back to float.]

  [...]
}

This should minimize the impact of the fixed point arithmetics. The
question is whether it would be efficient enough.

/Gunnar




reply via email to

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