Skip to content

Commit

Permalink
sort using absolute values (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
dartsushi authored Feb 12, 2025
1 parent 0c03469 commit fccdcab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utility/cft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function cft_data(scheme::TNRScheme; v=1, unitcell=1, is_real=true)
end
end

data = filter(x -> real(x) > 0, data)
data = sort(data; by=x -> real(x), rev=true)
data = filter(x -> abs(x) > 1e-12, data)
data = sort(data; by=x -> abs(x), rev=true)
if is_real
data = real(data)
end
Expand Down Expand Up @@ -52,8 +52,8 @@ function cft_data(scheme::BTRG; v=1, unitcell=1, is_real=true)
i += 1
end
end
data = filter(x -> real(x) > 0, data)
data = sort(data; by=x -> real(x), rev=true)
data = filter(x -> abs(x) > 1e-12, data)
data = sort(data; by=x -> abs(x), rev=true)
if is_real
data = real(data)
end
Expand Down

0 comments on commit fccdcab

Please sign in to comment.