Skip to content

Instantly share code, notes, and snippets.

@bmarcot
Created April 29, 2013 14:50
Show Gist options
  • Save bmarcot/5482083 to your computer and use it in GitHub Desktop.
Save bmarcot/5482083 to your computer and use it in GitHub Desktop.
def ScalarProduct(xs: List[Double], ys: List[Double]): Double =
(for ((x, y) <- xs zip ys) yield x * y).sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment