1
(* For comparison: a non-clustered multiplication *)
8
m.(j).(k) <- Random.float 1.0
13
let test lrows rcols rrows =
15
let lmatrix = Array.make_matrix lrows lcols 0.0 in
16
let rmatrix = Array.make_matrix rrows rcols 0.0 in
17
fill lmatrix lrows lcols;
18
fill rmatrix rrows rcols;
19
let res = Array.make_matrix rrows lcols 0.0 in
21
for row = 0 to rrows-1 do
22
for col = 0 to lcols - 1 do
24
for j = 0 to lrows-1 do
25
s := !s +. lmatrix.(j).(col) *. rmatrix.(row).(j)
35
let lrows = ref 1000 in
36
let rcols = ref 1000 in
37
let rrows = ref 1000 in
39
[ "-size", Arg.Tuple [ Arg.Set_int lrows;
43
"<P> <Q> <R> Size of test: Multiply a PxR with a RxQ matrix"
45
(fun arg -> raise(Arg.Bad("Bad argument: " ^ arg)))
46
(sprintf "usage: %s <options>" Sys.argv.(0));
48
test !lrows !rcols !rrows