let init_matrix sx sy init = let res = Array.create sx [||] in for x = 0 to pred sx do Array.unsafe_set res x (Array.init sy (init x)) done; res