You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/SortingAlgorithms.jl
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -686,7 +686,7 @@ end
686
686
687
687
# merge v[lo:hiA] and v[hiA+1:hi] ([A;B]) using buffer t[1:1 + hi-lo]
688
688
# this is faster than merge! but requires twice as much auxiliary memory.
689
-
functiontwoended_merge!(v::AbstractVector{T}, t::AbstractVector{T}, lo::Integer, hiA::Integer, hi::Integer, o::Ordering) where T
689
+
functiontwoended_merge!(v::AbstractVector{T}, lo::Integer, hiA::Integer, hi::Integer, o::Ordering, t::AbstractVector{T}) where T
690
690
@assert lo <= hiA <= hi
691
691
loA = lo
692
692
loB = hiA +1
@@ -757,7 +757,7 @@ end
757
757
758
758
# merge v[lo:lo+lenA-1] and v[lo+lenA:hi] using buffer t[1:lenA]
759
759
# based on Base.Sort MergeSort
760
-
functionmerge!(v::AbstractVector{T}, t::AbstractVector{T}, lo::Integer, hi::Integer, lenA::Integer, o::Ordering) where T
760
+
functionmerge!(v::AbstractVector{T}, lo::Integer, hi::Integer, lenA::Integer, o::Ordering, t::AbstractVector{T}) where T
761
761
@inboundsbegin
762
762
i =1
763
763
j = lo
@@ -805,7 +805,7 @@ macro getNextBlock!()
805
805
end
806
806
807
807
# merge v[lo:hiA] and v[hiA+1:hi] using buffer buf in O(sqrt(n)) space
808
-
functionpagedMerge!(v::AbstractVector{T}, buf::AbstractVector{T}, lo::Integer, hiA::Integer, hi::Integer, blockLocation::AbstractVector{<:Integer}, o::Ordering) where T
808
+
functionpagedMerge!(v::AbstractVector{T}, lo::Integer, hiA::Integer, hi::Integer, o::Ordering, buf::AbstractVector{T}, blockLocation::AbstractVector{<:Integer}) where T
809
809
@assert lo < hiA < hi
810
810
iA = lo
811
811
iB = hiA +1
@@ -815,7 +815,7 @@ function pagedMerge!(v::AbstractVector{T}, buf::AbstractVector{T}, lo::Integer,
815
815
816
816
# regular merge if buffer is big enough
817
817
if lenA <=length(buf)
818
-
merge!(v, buf, lo, hi, lenA, o)
818
+
merge!(v, lo, hi, lenA, o, buf)
819
819
return
820
820
elseif lenB <=length(buf)
821
821
#TODO ?
@@ -998,18 +998,18 @@ end
998
998
# -> redefine for compatibility with earlier versions
999
999
midpoint(lo::Integer, hi::Integer) = lo + ((hi - lo) >>>0x01)
1000
1000
1001
-
functionpagedmergesort!(v::AbstractVector{T}, lo::Integer, hi::Integer, buf::AbstractVector{T}, blockLocation, o=Base.Order.Forward) where T
1001
+
functionpagedmergesort!(v::AbstractVector{T}, lo::Integer, hi::Integer, o::Ordering, buf::AbstractVector{T}, blockLocation) where T
0 commit comments