2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -0,0 +1,11 @@
|
|||
def mult(m1, m2) do
|
||||
Enum.map m1, fn (x) -> Enum.map t(m2), fn (y) -> Enum.zip(x, y)
|
||||
|> Enum.map(fn {x, y} -> x * y end)
|
||||
|> Enum.sum
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def t(m) do # transpose
|
||||
List.zip(m) |> Enum.map(&Tuple.to_list(&1))
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue