scheinerman / Permutations.jl

Permutations class for Julia.
Other
51 stars 14 forks source link

Use invperm and AbstractPermutation #28

Closed LilithHafner closed 2 years ago

LilithHafner commented 2 years ago

I noticed that I implemented invperm for CompiledPermutation while this package implements inv for Permutations. I think that invperm should be the fundamental definition that each permutation should implement because it is specifically for inverting permutations. inv is more general, but if we know that we're inv-ing a permutation than inv really means invperm, which I express as inv(p::AbstractPermutation) = invperm(p). Similarly, I extend support for adjoint notation to all AbstractPermutations rather than support it explicitly for each. These changes make it easier to define a new permutation (e.g. CompiledPermutation) and only implement a few methods for it, yet get support for many for free.

codecov[bot] commented 2 years ago

Codecov Report

Merging #28 (f07b758) into master (7e2a8d5) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #28   +/-   ##
=======================================
  Coverage   81.23%   81.23%           
=======================================
  Files           4        4           
  Lines         357      357           
=======================================
  Hits          290      290           
  Misses         67       67           
Impacted Files Coverage Δ
src/Permutations.jl 81.04% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7e2a8d5...f07b758. Read the comment docs.