Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let least_square_matrix h w x size =
- let rec aux i j sol = function
- | s when s = A.length x -> sol
- | n -> aux i j (sol +. (h i x.(n)) *. (h j x.(n)) *. (w x.(n))) (n + 1)
- in
- M.create (A.init size (fun i -> A.init size (fun j -> aux i j 0. 0)))
- ;;
Add Comment
Please, Sign In to add comment