Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: OCaml | Size: 0.22 KB | Hits: 136 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. let ( *- ) a b = List.fold_left2 (fun x a b -> x +. a *. b) 0.0
  2.  
  3. let mult matrix vector = match matrix with
  4.   | [r; s; t; u] ->
  5.     [r *- vector; s *- vector; t *- vector; u *- vector]
  6.   | _ -> failwith "wrong no of arg"