You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This generates all unique permutations of arrays of three integers summing to ten. Ideally, I would like to have the Unique() inside the MapCat because after Cat()ing all the permutations, there are a lot of elements because of which the buffer for checking uniqueness becomes larger than what fits into memory (for larger values than 10 and 3). Therefore, b() only works for small problems. On the other hand, using the unique function instead of the Unique() transducer allocates and collects, which is also suboptimal. Thus, I'd also like to avoid b().
The versions with Unique() inside the MapCat() throw a MethodError, though. Specifically,
ERROR: MethodError: no method matching unwrap(::Transducers.Reduction{Unique{…}, Transducers.Reduction{…}}, ::BangBang.SafeCollector{Empty{…}})
The function `unwrap` exists, but no method is defined for this combination of argument types.
The text was updated successfully, but these errors were encountered:
How can I concatenate nested transducers generated by
Map()
s?Consider the following example code.
This generates all unique permutations of arrays of three integers summing to ten. Ideally, I would like to have the
Unique()
inside theMapCat
because afterCat()
ing all the permutations, there are a lot of elements because of which the buffer for checking uniqueness becomes larger than what fits into memory (for larger values than 10 and 3). Therefore,b()
only works for small problems. On the other hand, using theunique
function instead of theUnique()
transducer allocates and collects, which is also suboptimal. Thus, I'd also like to avoidb()
.The versions with
Unique()
inside theMapCat()
throw a MethodError, though. Specifically,The text was updated successfully, but these errors were encountered: