Branch: Tag:

2007-12-15

2007-12-15 17:19:49 by Marcus Comstedt <marcus@mc.pp.se>

Backported from 7.7: Minor optimization. Avoid infinities...

Rev: lib/modules/Tools.pmod/Shoot.pmod/MatrixMult.pike:1.4

7:      array(array(float)) mkmatrix(int rows, int cols)   { -  return map(enumerate(rows*cols,1,1), -  lambda(int f) +  return map(enumerate(rows*cols,1,0), +  lambda(int f, float den)    { -  return ((float)f)/(rows*cols); -  })/cols; +  if (f & 1) +  return -((float)f)/den; +  return ((float)f)/den; +  }, (float)rows*cols)/cols;   }      void test(int n)