I think IterTools.subsets will do what you’re looking for. Something like:
for (i,j) in IterTools.subsets(1:length(a), Val{2}())
# do something
end
This essentially returns the indices of an upper triangular matrix.
I think IterTools.subsets will do what you’re looking for. Something like:
for (i,j) in IterTools.subsets(1:length(a), Val{2}())
# do something
end
This essentially returns the indices of an upper triangular matrix.