Closed adamryczkowski closed 6 years ago
Adam, I'm not understanding what you'd like. This package only does permutations of finite sets of the form {1,2,...,n}.
I am asking, whether the length of the permutation can be accessed at the compile time. I guess it cannot - it seems to be only a runtime feature because the Permutation itself is implemented as an Array of size length
, and length of the Arrays are runtime (as opposed to the dimensionality of them).
I can wrap your Permutation with a parametric type like this
struct MyPermutation{N}
p::Permutations.AbstractPermutation
end
...but after a second thought, I am not sure this is worth the trouble. The code that I am implementing does not need to be fast and I can break my function into multiple definitions like this: Break functions into multiple definitions
I would like to have a specilized functions for different permutation sizes (I work with axes permutations, and I would like to treat 2D and 3D case specifically).
Is it possible to write an equivalent of
That would allow having a similar interface to
AbstractArray{T, N}
.