(* param 1 = taille des matrices au depart param 2 = incrementation param 3 = taille des matrices ŕ l'arrive param 4 = nombre d'itérations *) open Bsmllib open Bsmlcomm let multiplication n zero add mul a b c = let tmp=ref zero in for i=0 to n-1 do for j=0 to n-1 do tmp:=zero; (* let rec loop tmp k = if k=n then tmp else loop (add tmp (mul b.(k*n+j) a.(i*n+k))) (k+1) in c.(i*n+j)<-loop zero 0 *) for k=0 to n-1 do tmp:= add (!tmp) (mul b.(k*n+j) a.(i*n+k)) done; c.(i*n+j)<-(!tmp) done done let random_complex n = {Complex.re=Random.float n; im=Random.float n} let matrixRandom n = Array.init (n*n) (fun _ -> random_complex 1000.) let _ = Bsmllib.initialize(); Random.self_init(); let i = ref (int_of_string (argv()).(1)) and pas=(int_of_string (argv()).(2)) and maxi=(int_of_string (argv()).(3)) and iter=(int_of_string (argv()).(4)) in while !i ignore(multiplication (!i) Complex.zero Complex.add Complex.mul a b c)) iter); i:=!i+pas; done