andrioni / Catalan.jl

Catalan: a combinatorics library for Julia
Other
10 stars 5 forks source link

Optional dependency on GSL? #5

Open jiahao opened 11 years ago

jiahao commented 11 years ago

libgsl provides some functionality for generating permutations which are currently wrapped in GSL.jl (although not terribly cleanly at the moment). I'm toying with the idea of providing a Permutation type in GSL.jl that would abstract the low-level GSL calls, or whether that should live in Catalan.jl. Thoughts?

andrioni commented 11 years ago

I'm not completely comfortable on depending on the GSL (the library, not the package), as I'd like Catalan.jl to be free from any outside library requirements, but at the same time I'd love to have more efficient permutations than using vectors and the randperm() function from Base. (I have some code written to deal with vectors/matrices as permutations, but they aren't versatile enough to put them here, and I want something general enough to satisfy my needs after having written code to deal with permutations in Haskell, Ruby and Python).

I have to think a bit more about this, but if we could define a common interface (and an abstract type), then we could have native julian permutations coexisting with GSL permutations (and Catalan choosing them as an optional dependency).