From a551235cd3cbd618493e30811d84ab120e77c8f0 Mon Sep 17 00:00:00 2001 From: pedromxavier Date: Fri, 27 Oct 2023 12:02:49 -0400 Subject: [PATCH] Fix sorting on print + Bump Version --- Project.toml | 2 +- src/library/function/abstract.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 0f9a0a2..a22c860 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PseudoBooleanOptimization" uuid = "c8fa9a04-bc42-452d-8558-dc51757be744" authors = ["pedromxavier "] -version = "0.2.0" +version = "0.2.1" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/library/function/abstract.jl b/src/library/function/abstract.jl index d764ee1..49c2b47 100644 --- a/src/library/function/abstract.jl +++ b/src/library/function/abstract.jl @@ -75,7 +75,7 @@ function Base.show(io::IO, ::MIME"text/plain", f::AbstractPBF{V,T}) where {V,T} return nothing end - terms = sort!(map(((ω, c)::Pair) -> (sort!(collect(ω)) => c), pairs(f)); by=first, lt=varlt) + terms = sort!(map(((ω, c)::Pair) -> (sort!(collect(ω); alg=InsertionSort, lt=varlt) => c), pairs(f)); by=first, lt=varlt) for (i, (ω, c)) in enumerate(terms) if i > 1