Git Product home page Git Product logo

Comments (5)

thofma avatar thofma commented on May 31, 2024

Such a function is welcome, but we try to have no dependency on external packages.

But maybe we can throw something together with the things @kalmarek did.

from abstractalgebra.jl.

heiderich avatar heiderich commented on May 31, 2024

Could you be more specific? Maybe one could use AllParts. Unfortunately it seems not to be documented.

from abstractalgebra.jl.

thofma avatar thofma commented on May 31, 2024

I don't know myself. I was hoping that @kalmarek would tell us if it is possible.

from abstractalgebra.jl.

heiderich avatar heiderich commented on May 31, 2024

Forget my last comment concerning AllParts. See pull request #123 instead. It is self-contained.

from abstractalgebra.jl.

kalmarek avatar kalmarek commented on May 31, 2024

The documentation of AllParts (and much more) is just around the corner (already written, but not yet committed)

doc"""
    AllParts(n::Int)
> Return an iterator over all integer `Partition`s of `n`.
> Partitions are produced in ascending order according to RuleAsc (Algorithm 3.1) from
>
> Jerome Kelleher and Barry O’Sullivan,
> *Generating All Partitions: A Comparison Of Two Encodings*
> ArXiv:0909.2331
>
> See also `Combinatorics.partitions(1:n)`.

# Examples
``jldoctest
julia> ap = AllParts(5);

julia> collect(ap)
7-element Array{AbstractAlgebra.Generic.Partition,1}:
 1₅
 2₁1₃
 3₁1₂
 2₂1₁
 4₁1₁
 3₁2₁
 5₁
``
"""
struct AllParts
    n::Int
    part::Vector{Int}
    AllParts(n::Integer) = new(n, zeros(Int,n))
end

from abstractalgebra.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.