The following give times of some matrix products using two forms.

The first example uses integers.

The remainder give reproducible results with a range of floating point numbers. All matrices are of the same shape. What is the reason for the 30 to 1 ratio of times depending on the values of the floating point numbers for the matrix form, and 7 to 1 ratio for the table form?

Was I wrong to be surprised by these differences?

  loadd 'd:\j\j601w\temp\1.ijs'
  ts =: 6!:2 , 7!:2


  a =:  ?. >:200 200 $200
  f =: (+/ @: *    )"1 1
  ts 'a +/ . * |: a'
0.0302508 1.05024e6
  ts 'f /~a'
0.0853203 531008

  a =:% ?. >:200 200 $200
  ts 'a +/ . * |: a'
0.625971 1.05024e6
  ts 'f /~a'
0.721225 1.06029e6

  a =:% ?. >:200 200 $2000
  ts 'a +/ . * |: a'
0.0839973 1.05024e6
  ts 'f /~a'
0.165096 1.06029e6

  a =:% ?. >:200 200 $20000
  ts 'a +/ . * |: a'
0.0277373 1.05024e6
  ts 'f /~a'
0.106258 1.06029e6

  a =:% ?. >:200 200 $200000
  ts 'a +/ . * |: a'
0.0211127 1.05024e6
  ts 'f /~a'
0.0991123 1.06029e6


  9!:14''
j601/beta/2006-08-23/07:45
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to