CPUtils (Fixpoint v0.8.27)
Summary
Functions
Link to this function
mat_at(m, i, j)
mat_at(m,i,j)
Returns the value (i
,j
) of the 2d matrix mat
.
##Examples##
iex> [[1,2,3],[4,5,6],[7,8,9]] |> mat_at(1,2)
6
Link to this function
timeit(fun)
timeit(fun)
From https://stackoverflow.com/questions/29668635/how-can-we-easily-time-function-calls-in-elixir
A more elaborate timing function. Prints
- Name of the function
- Result
- Time in seconds
##Examples##
> timeit(&test1/0)
Link to this function
timeit_simple(fun)
timeit_simple(fun)
A simple timing function, returns the time in seconds (as a string).
##Examples##
> Util.timeit_simple(&Test1.main/0)
> Util.timeit_simple(fn () -> Test1.main() end)
Link to this function
transpose(m)
transpose(m)
Returns a transposed version of m
.
##Example##
iex> [[1,2,3],[4,5,6],[7,8,9]] |> transpose
[[1, 4, 7], [2, 5, 8], [3, 6, 9]]