JeffreySarnoff/SortingNetworks.jl

ExchangeSort is exported and documented but not implemented.

LilithHafner opened this issue · 0 comments

The title says it all. This is how I found the issue:

julia> names(SortingNetworks)
3-element Vector{Symbol}:
 :ExchangeSort
 :SortingNetworks
 :swapsort

help?> ExchangeSort
search: ExchangeSort

  No documentation found.

  SortingNetworks.ExchangeSort is of type SortingNetworks.ExchangeSortAlg.

  Summary
  ≡≡≡≡≡≡≡≡≡

  struct SortingNetworks.ExchangeSortAlg

  Supertype Hierarchy
  ≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

  SortingNetworks.ExchangeSortAlg <: Base.Sort.Algorithm <: Any

help?> SortingNetworks.ExchangeSortAlg
  ExchangeSort

  Indicate that a sorting function should use the exchange sort algorithm. Exchange sort orders elements pairwise, over groups that are accessible in parallel. At the
  conclusion of the application of the relevant sorting network, each element is positioned in its correct, sorted postion in the output. Characteristics:

    •  stable: preserves the ordering of elements which compare equal (e.g. "a" and "A" in a sort of letters which ignores case).

    •  in-place in memory.

    •  quadratic performance in the number of elements to be sorted: it is well-suited to small collections but should not be used for large ones.

julia> sort!([3,1,2]; alg=ExchangeSort)
ERROR: MethodError: no method matching sort!(::Vector{Int64}, ::Int64, ::Int64, ::SortingNetworks.ExchangeSortAlg, ::Base.Order.ForwardOrdering)
Closest candidates are:
  sort!(::AbstractVector, ::Integer, ::Integer, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) at sort.jl:498
  sort!(::AbstractVector, ::Integer, ::Integer, ::Base.Sort.QuickSortAlg, ::Base.Order.Ordering) at sort.jl:569
  sort!(::AbstractVector, ::Integer, ::Integer, ::Base.Sort.MergeSortAlg, ::Base.Order.Ordering) at sort.jl:587
  ...
Stacktrace:
 [1] sort!(v::Vector{Int64}, alg::SortingNetworks.ExchangeSortAlg, order::Base.Order.ForwardOrdering)
   @ Base.Sort ./sort.jl:661
 [2] sort!(v::Vector{Int64}; alg::SortingNetworks.ExchangeSortAlg, lt::Function, by::Function, rev::Nothing, order::Base.Order.ForwardOrdering)
   @ Base.Sort ./sort.jl:722
 [3] top-level scope
   @ REPL[8]:1