Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class int_vec dim = object (self:'self)
- val mutable _coords = Array.create dim 0
- method dot (x:'self) =
- 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 (float (self#dot self))
- method coords = _coords
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement