0d03312003-08-24Martin Nilsson #pike __REAL_VERSION__
df98272002-12-06Mirar (Pontus Hagland) inherit Tools.Shoot.Test; constant name="Matrix multiplication"; int size = 100;
ecea9d2003-03-09Henrik Grubbström (Grubba) array(array(float)) mkmatrix(int rows, int cols)
df98272002-12-06Mirar (Pontus Hagland) {
9a0a3c2007-12-15Marcus Comstedt  return map(enumerate(rows*cols,1,0), lambda(int f, float den)
df98272002-12-06Mirar (Pontus Hagland)  {
9a0a3c2007-12-15Marcus Comstedt  if (f & 1) return -((float)f)/den; return ((float)f)/den; }, (float)rows*cols)/cols;
df98272002-12-06Mirar (Pontus Hagland) } void test(int n) { Math.Matrix m1 = Math.Matrix(mkmatrix(size, size)); Math.Matrix m2 = Math.Matrix(mkmatrix(size, size)); while (n--) m1=m1*m2; array q = (array(array(int)))(array)m1; } void perform() { test(100); }