Combinatorics.jl icon indicating copy to clipboard operation
Combinatorics.jl copied to clipboard

A combinatorics library for Julia

Results 72 Combinatorics.jl issues
Sort by recently updated
recently updated
newest added

It seems iterating Combinations allocates. Am I measuring this correctly? Is there a way to eliminate the allocations? ``` using Combinatorics function test1(combs) x = 0 for c in combs...

`integer_partitions(0)` returns the empty list, while there is a partition of 0, namely `Int[]`. The error is in src/partitions.c:459, which should return `Vector{Int}[[]]` or `[Int[]]`. There is also a problem...

This PR provides functionality for generating compositions, specifically two different types of compositions: - (strong) compositions of n into k parts, i.e., all the arrays of k positive integers that...

feature

Dear contributors of the Combinatorics.jl package, Would you please know where I could find an implementation of (the evaluation) of the incomplete Bell polynomials? https://en.wikipedia.org/wiki/Bell_polynomials#Definitions#Exponential%20Bell%20polynomials Thank you!

[By convention](https://en.wikipedia.org/wiki/Partition_function_(number_theory)#Definition_and_examples), there is a single partition of 0: the empty partition. However, `integer_partitions(0)` returns `[]`. It should instead return `[[]]` so that `length(integer_partitions(0)) == 1` in accordance with https://oeis.org/A000041...

I would expect the function `levicivita` to take the permutations iterator as an input, so that something like this ``` Using Combinatorics vectors = [[1],[2],[2]] perms = permutations(vectors) lvtensor =...

`collect` called on `MultiExponents` is type-unstable because `MultiExponents` has no defined `eltype`. This PR adds a method for `Base.eltype()` so that `collect` returns a `Vector{Vector{Int64}}` rather than a `Vector{Any}`. Before:...

https://github.com/JuliaMath/Combinatorics.jl/blob/d1b633bffd1ed7ff3301e38f71cf37f415f19d1d/src/multinomials.jl#L18-L23 It appears that the size of the array is constant across iterations. Can the allocation of the array be moved to the constructor? Allocating an array every iteration is...

Feel free to ignore and close this PR without explanation. The basic idea here is to test the Julia version against the [python itertools](https://docs.python.org/3/library/itertools.html). Assumptions: python's `itertools` library is correct....

It'd be great to have a function that's (conceptually) the same as `multiset_permute(partition(x))`, iterating over tuples.