A faster (that is, O(2^.n)) method obtains through repeated squaring: A=: >1 2; 3 4 mp=: +/ .* mp/ 10 # ,: A 4783807 6972050 10458075 15241882 A&mp^:10 =i.#A 4783807 6972050 10458075 15241882 mpow=: 4 : 'mp/ mp~^:(I.|.#:y) x' A mpow 10 4783807 6972050 10458075 15241882
See in the J Wiki: http://www.jsoftware.com/jwiki/Essays/Repeated_Squaring ----- Original Message ----- From: June Kim <[EMAIL PROTECTED]> Date: Monday, August 7, 2006 7:01 pm Subject: [Jprogramming] conventional way of matrix power? > A=: >1 2;3 4 > (+/ . *)/ 10 2$A NB. A^10 > 4783807 6972050 > 10458075 15241882 > > Is this conventional in J? (I guess not) ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
