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

Re: computer-go: Sharing Go modules



That's not really true.    I don't think  my   program does a   single
multiply operation to find a neighbor intersection.

In principle you are  right, but there  are many tricks to avoid this.
For instance the  8 neigbor points can  be a  simple table lookup,  or
simple constant offsets in your program.

However with  modern processors,  I'm not sure  2D arrays  are so bad,
certainly not as bad as a few years  ago.  Also, compilers are good at
avoiding a  direct  multiply instruction if  it's  faster.  However  I
don't see that 2D arrays are any kind  of simplification, because that
implies more complicated loop structures to "look around."

Don




   Date: Wed, 16 May 2001 22:47:30 -0700

   A one dimensional array doesn't avoid the multiply. You are doing the
   multiply yourself to convert x,y to index. I think modern day optimized
   compiler is more efficient than calculating the address yourself.

   Man Lung Li