I want to build a dictionary that corresponds to an lower triangular array (i.e., a[i,j] only exists if i>j). How can I write a dictionary comprehension that achieves this?
I tried
Dict( (i,j) => f(i,j) for j in i+1:N, i in 1:N )
and
Dict( (i,j) => f(i,j) for i in 1:N, j in i+1:N )
but they both fail with the same error:
ERROR: UndefVarError: i not defined
Stacktrace:
[1] top-level scope at none:0