Print

Print


At 23:01 on 14 January, Yasuki Arasaki wrote:

 > Of course the usual answer is that modern control structures
 > are better at doing what the computed goto was used for, but
 > you show a particular problem that seems not to be the case.

That is my point.

 > So what particular *kind* of problem is it? Can you give us a
 > rough idea as to what the code is doing?

It is accumulating contributions to multipole moments. Each set of
contributions is known to be zero above a maximum rank, evaluated for
each set and specified by "index" in the code. Although the
higher-rank contributions are known to be zero, one doesn't want
to execute the code for them, not only because it wastes cpu time but
because intermediate values used in the calculation have been
evaluated only for the non-zero ranks.

--
Anthony Stone                           http://www-stone.ch.cam.ac.uk/
University Chemical Laboratory,         Email:   [log in to unmask]
Lensfield Road,                         Phone:  +44 1223 336375
Cambridge CB2 1EW                       Fax:    +44 1223 336362