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

Selection algorithms #500

Merged
merged 53 commits into from
Dec 1, 2021
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ba00ab7
change name to match discussion
Aug 27, 2021
040fbcf
adding tests
Aug 27, 2021
5a0bc69
whitespace
Aug 27, 2021
20b6323
add specs
Aug 27, 2021
4f8221f
add in selection tests
Aug 27, 2021
5ebea04
whitespace
Aug 27, 2021
a5a4005
fix whitespace
Aug 27, 2021
d7d1a0b
typo
Aug 27, 2021
5305443
use error stop
Aug 27, 2021
054d7ee
make tests faster
Aug 27, 2021
5ac0033
fix example programs
Aug 27, 2021
55ecacb
get rid of precision conversion warnings
Aug 27, 2021
1128444
specs
Aug 28, 2021
f029976
fix doc
Aug 28, 2021
103b9e9
fix doc
Aug 28, 2021
648a384
fix doc
Aug 28, 2021
0c2140a
fix reference to subroutine
Aug 28, 2021
7970636
Apply some suggestions from code review by jvdp1
gareth-nx Sep 19, 2021
487c973
change "a" to "array" in documentation as suggested by jvdp1
gareth-nx Sep 19, 2021
2ffc60b
fix some remaining references to "a" by converting to "array"
gareth-nx Sep 19, 2021
3fca4ee
clearer statement of partial sorting in code doc
gareth-nx Sep 19, 2021
3195ae7
move this part of the documentation as suggested by jvdp1
gareth-nx Oct 2, 2021
0c0e020
move to coretran-style implementation to prevent any licence issues
gareth-nx Oct 2, 2021
1b0f5db
remove some warnings
gareth-nx Oct 3, 2021
af025d1
fix for out of bounds error
gareth-nx Oct 3, 2021
943a111
Changes suggested by Leon Folks
gareth-nx Oct 3, 2021
8cc6129
fix unused variable
gareth-nx Oct 3, 2021
73010e2
Apply suggestions from code review
gareth-nx Oct 3, 2021
ddec12c
Apply suggestions from code review by jvdp1
gareth-nx Oct 3, 2021
1ad6725
Further changes suggested by jvdp1
gareth-nx Oct 3, 2021
1730985
consistent use of k-th smallest as suggested by jvdp1
gareth-nx Oct 7, 2021
0be3505
update specs links and title
gareth-nx Oct 7, 2021
a6ecffa
change pth-smallest to p-th smallest, as suggested by jvdp1
gareth-nx Oct 7, 2021
533ea51
merge with master
gareth-nx Oct 7, 2021
4ab5fcf
Apply suggestions from code review by jvdp1
gareth-nx Oct 15, 2021
49d4a95
Merge branch 'master' into qsmerge
gareth-nx Nov 19, 2021
73595b3
make selection work with up-to-date stdlib
gareth-nx Nov 19, 2021
5df1b74
get the test-suite running with testdrive
gareth-nx Nov 20, 2021
f4a4dac
remove line causing bug in cmake builds
gareth-nx Nov 20, 2021
854fe4c
make dependency on stdlib_kinds clear
gareth-nx Nov 20, 2021
8a803e9
spaces not tabs
gareth-nx Nov 20, 2021
573dbfa
avoid a single logical treating many tests
gareth-nx Nov 20, 2021
c32ce17
add in the missing intent of argument k in specs. Also add real(xdp) …
gareth-nx Nov 20, 2021
b6a40e8
remove indent in specs code examples
gareth-nx Nov 24, 2021
78fa5a6
Remove Licencing section, and put acknowledgement of Leon Foks in the…
gareth-nx Nov 24, 2021
069a111
slight rewording
gareth-nx Nov 24, 2021
57500c1
Apply the more straightforward suggestions from code review
gareth-nx Nov 25, 2021
44d9804
avoid overflow in computing mid index
gareth-nx Nov 25, 2021
52f8694
add test that can catch overflow with naive mid index calculation
gareth-nx Nov 25, 2021
4b0d880
remove redundant while(.true.)
gareth-nx Nov 25, 2021
817ee30
add comment that arg_sort is not a stable sort
gareth-nx Nov 25, 2021
f486148
add statement that NaN entries in array are not supported
gareth-nx Nov 25, 2021
0f4e635
add loop labels
gareth-nx Nov 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix doc
  • Loading branch information
gareth authored and gareth committed Aug 28, 2021
commit 103b9e998d86bc655b888d76be757153f6f0f016
3 changes: 2 additions & 1 deletion doc/specs/stdlib_selection.md
Original file line number Diff line number Diff line change
@@ -217,7 +217,8 @@ where we need to search.

`arg_select` does not modify `a`, unlike `select`.

While it is essential that that `indx` contains the integers 1:size(a), the code does not check for this.
While it is essential that that `indx` contains the integers 1:size(a) (in any
order), the code does not check for this.

Selection of a single value should have runtime of O(`size(a)`), so it is asymptotically faster
than sorting `a` entirely.