Go through lists

How can I go through a list list? I created two matrices but now I want to know how to make the transposition of b and multiply it with the matrix a

1 Like

Sounds like you are using Elixir’s built-in lists. Maybe you should switch to a library like this one ?

1 Like

Hi all,

Transpose a list of lists using list comprehension


Found it on the other thread. You can give this a go:

iex> Enum.zip [[1,2],[3,4],[5,6]]
[{1, 3, 5}, {2, 4, 6}]

or if you need list of lists:

iex> Enum.zip([[1,2],[3,4],[5,6]]) |> Enum.map(&Tuple.to_list/1)
[[1, 3, 5], [2, 4, 6]]

For large matrices, I’d use C and OpenMP - SSE/AVX - MPI.


GNU Octave is another option.