Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-inceasing order bug #47

Closed
kunyuan opened this issue Aug 12, 2023 · 0 comments · Fixed by #48
Closed

non-inceasing order bug #47

kunyuan opened this issue Aug 12, 2023 · 0 comments · Fixed by #48
Assignees
Labels
bug Something isn't working

Comments

@kunyuan
Copy link
Member

kunyuan commented Aug 12, 2023

The following code produces non-increasing order:

julia> function find_non_increasing(vec::Vector{T}) where T
           for i in 2:length(vec)
               if vec[i] <= vec[i-1]
                   # Print the neighbors
                   if i == 2
                       println("Non-increasing point: ", vec[i], " with left neighbor: ", vec[i-1])
                   elseif i == length(vec)
                       println("Non-increasing point: ", vec[i-1], " with right neighbor: ", vec[i])
                   else
                       println("Non-increasing point: ", vec[i-1], " with neighbors: ", vec[i-2], " and ", vec[i])
                   end
               end
           end
       end

julia> kF = 1.9191582926775128
1.9191582926775128

julia> Λgrid = CompositeGrid.LogDensedGrid(:uniform, [1.0 * kF, 100 * kF], [kF,], 8, 0.1 * kF, 8);

julia> find_non_increasing(Λgrid.grid)
Non-increasing point: 62.10210652892028 with neighbors: 56.227888901955346 and 62.102106528920274

The generated grids are the following:

1.9191582926775128
1.946574839715763
1.9739913867540133
2.001407933792263
2.0288244808305134
2.0562410278687633
2.0836575749070136
2.111074121945264
2.1702112054545135
2.229348288963763
2.2884853724730125
2.347622455982262
2.4067595394915116
2.465896623000761

38.60523602106057
44.4794536480255
50.353671274990425
56.227888901955346
62.10210652892028
62.102106528920274
80.646924063039
99.19174159715772
117.73655913127644
136.28137666539516
154.82619419951385
173.37101173363257
191.9158292677513

@kunyuan kunyuan added the bug Something isn't working label Aug 12, 2023
@iintSjds iintSjds linked a pull request Aug 12, 2023 that will close this issue
iintSjds added a commit that referenced this issue Aug 13, 2023
fixed bug for issue #47; renamed some test files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants