Given an array M:[sps]
over a sps = sparse subdomain(dom)
where dom: domain(n)
, I know I can iterate densely over the kβthββ dimension with for j in M.domain.dim(k) {...}
. How would I define an analogous loop that visits only populated locations in k such that if M.domain.dim(k) = {1..N}
, but there are only m populated indices in k, the loop only formally generates m iterations rather than N?
Would the way to do this be to iterate over the whole sparse domain with an iterand that only references one index? (i.e. for (i,j) in spsDom { var idx = i }
)