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
For some applications, it can be helpful to include in the set of partitions of a vector, the option of taking nothing, i.e., to include empty-partitions. Currently, however, partitions(s::AbstractVector, m::Int) will only consider non-empty partitions. I think it would be nice to allow the former as well, enabled e.g., by a keyword argument (e.g., allow_empty).
By example, this would turn the two following examples from:
NB: This can currently be "simulated" by appending some token element, e.g., 0, onto the input vector m-1 times, and then considering token-elements as empty. I.e., partitions(vcat(s, fill(0, m-1)), m). But this seems inelegant and generates redundant possibilities that need to be filtered out subsequently.
The text was updated successfully, but these errors were encountered:
For some applications, it can be helpful to include in the set of partitions of a vector, the option of taking nothing, i.e., to include empty-partitions. Currently, however,
partitions(s::AbstractVector, m::Int)
will only consider non-empty partitions. I think it would be nice to allow the former as well, enabled e.g., by a keyword argument (e.g.,allow_empty
).By example, this would turn the two following examples from:
to:
NB: This can currently be "simulated" by appending some token element, e.g.,
0
, onto the input vectorm-1
times, and then considering token-elements as empty. I.e.,partitions(vcat(s, fill(0, m-1)), m)
. But this seems inelegant and generates redundant possibilities that need to be filtered out subsequently.The text was updated successfully, but these errors were encountered: