Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class int_vec dim =
- object(self)
- val mutable coords = Array.create dim 0
- method dot (x:int_vec) =
- let rec innerdot sum count =
- if count >= Array.length coords then sum
- else innerdot (sum + coords.(count) * x#coords.(count)) (count + 1)
- in innerdot 0 0
- method len = sqrt(dot self)
- method coords = coords
- end
- ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement