Revision 58f79619ba0abac7a8e8156903741fcdf73ae54f authored by Tamas K. Papp on 28 December 2017, 16:36:55 UTC, committed by Fredrik Ekre on 28 December 2017, 16:36:55 UTC
* Update docstring of bkfact and related getindex.

To be compatible with 88e7fbcd002c21e6a03fe18643d83838cdbb31f7.

Also include the actual decomposition format. Fix missing permutation
matrix in the `getindex` docstring.

* Removed transpose from second permutation matrix.

Also mention properties of permutation matrix in docstring.
1 parent 1238bad
Raw File
bubblesort.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

import Base.Sort
struct BubbleSortAlg <: Sort.Algorithm end
const BubbleSort = BubbleSortAlg()

function Base.sort!(v::AbstractVector, lo::Int, hi::Int, ::BubbleSortAlg, o::Sort.Ordering)
    while true
        clean = true
        for i = lo:hi-1
            if Sort.lt(o, v[i+1], v[i])
                v[i+1], v[i] = v[i], v[i+1]
                clean = false
            end
        end
        clean && break
    end
    return v
end
back to top