Perform a binary search. See m_searching for more information on how to use this interface
Search for the value i in an integer vector Assumes this is sorted!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i32) | :: | this(:) | Vector to search within |
|||
integer(kind=i32) | :: | v | Number to find in the vector |
|||
integer(kind=i32) | :: | imin | Left integer |
|||
integer(kind=i32) | :: | imax | Right integer |
Location of i in this. Returns -1 if not present
Search for the value i in an integer vector Assumes this is sorted!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i64) | :: | this(:) | Vector to search within |
|||
integer(kind=i64) | :: | v | Number to find in the vector |
|||
integer(kind=i32) | :: | imin | Left integer |
|||
integer(kind=i32) | :: | imax | Right integer |
Location of i in this. Returns -1 if not present
Search for the value i in an integer vector Assumes this is sorted!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r32) | :: | this(:) | Vector to search within |
|||
real(kind=r32) | :: | v | Number to find in the vector |
|||
integer(kind=i32) | :: | imin | Left integer |
|||
integer(kind=i32) | :: | imax | Right integer |
Location of i in this. Returns -1 if not present
Search for the value i in an integer vector Assumes this is sorted!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64) | :: | this(:) | Vector to search within |
|||
real(kind=r64) | :: | v | Number to find in the vector |
|||
integer(kind=i32) | :: | imin | Left integer |
|||
integer(kind=i32) | :: | imax | Right integer |
Location of i in this. Returns -1 if not present