Guest User

Untitled

a guest
Jun 29th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.26 KB | None | 0 0
  1. let least_square_matrix h w x size =
  2.   let rec aux i j sol = function
  3.     | s when s = A.length x -> sol
  4.     | n -> aux i j (sol +. (h i x.(n)) *. (h j x.(n)) *. (w x.(n))) (n + 1)
  5.   in
  6.  
  7.   M.create (A.init size (fun i -> A.init size (fun j -> aux i j 0. 0)))
  8. ;;
Add Comment
Please, Sign In to add comment