binarySearch
|
The binarySearch function performs a binary search for the key
value in the specified Object. If a matching value is found, the index
of the matching value is returned; otherwise false is returned. Usage When a Vector has been previously sorted in ascending order, the binarySearch function is an
efficient way to determine if a specific value exists in the Vector and if exists,
what location in the Vector it exists.
When a structure has been previously sorted, the binarySearch function is an
efficient way to determine if a specific key exists in the structure and if exists,
what location in the structure it exists.
When a Dictionary has been previously sorted, the binarySearch function is an
efficient way to determine if a specific key exists in the Dictionary and if exists,
what location in the Dictionary it exists.
Note: Returns an error message if the Matrix is not of rank one. When a Matrix has been previously sorted in ascending order, the binarySearch function is an
efficient way to determine if a specific value exists in the Matrix and if exists,
what location in the Matrix it exists.
Note: Returns an error message if the Matrix is not of rank one. When a NumMatrix has been previously sorted in ascending order, the binarySearch function is an
efficient way to determine if a specific value exists in the NumMatrix and if exists,
what location in the NumMatrix it exists.
Structure
Dictionary
Matrix
NumMatrix
(binarySearch vector searchValue) Returns a Boolean value false if not found. Otherwise returns a integer index
of the location in the Vector where the value was found.
(binarySearch struct searchkey) Returns the Boolean value false if not found.
Otherwise returns a integer index of the location in the
structure where the key was found.
(binarySearch struct searchkey idsOnly) Returns the Boolean value false if not found.
Otherwise returns a integer index of the location in the
structure where the key was found.
(binarySearch dict searchkey) Returns the Boolean value false if not found.
Otherwise returns a integer index of the location in the
dictionary where the key was found.
(binarySearch dict searchkey idsOnly) Returns the Boolean value false if not found.
Otherwise returns a integer index of the location in the
dictionary where the key was found.
(binarySearch matrix searchValue) Returns a Boolean value false if not found. Otherwise returns a integer index
of the location in the Matrix where the value was found.
(binarySearch nummatrix searchValue) Returns a Boolean value false if not found. Otherwise returns a integer index
of the location in the Vector where the value was found.
Expression:
Arguments
Name
Type
Description Argument: vector Vector FltVector IntVector NumVector ObjVector ShortVector
A predefined Vector variable or constant. Argument: searchValue String Text Integer
value to be searched
Returns:
Expression:
Arguments
Name
Type
Description Argument: struct Structure
A predefined Structure variable or constant. Argument: searchKey String or Text
A symbolic key which you want to find in the Structure.
Returns:
Expression:
Arguments
Name
Type
Description Argument: struct Structure
A predefined Structure variable or constant. Argument: searchKey Symbol
A symbolic key which you want to find in the Structure. Argument: idsOnly Boolean
Value is set to false if the key comparison is to be made on object ids only (faster)
Returns:
Expression:
Arguments
Name
Type
Description Argument: dict Dictionary
A predefined Dictionary variable or constant. Argument: searchKey Symbol
A symbolic key which you want to find in the Dictionary.
Returns:
Expression:
Arguments
Name
Type
Description Argument: dict Dictionary
A predefined Dictionary variable or constant. Argument: searchKey Symbol
A symbolic key which you want to find in the Dictionary. Argument: idsOnly Boolean
Value is set to false if the key comparison is to be made on object ids only (faster)
Returns:
Expression:
Arguments
Name
Type
Description Argument: matrix Matrix
A previously sorted Matrix. Argument: searchValue String Text Integer
value to be searched
Returns:
Expression:
Arguments
Name
Type
Description Argument: nummatrix NumMatrix
A previously sorted NumMatrix. Argument: searchValue String Text Integer
value to be searched
Returns:
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Here are the links to the data types of the function arguments.
Vector | Matrix | String | Text |
Symbol | Integer | Boolean | FltVector |
IntVector | NumVector | ShortVector | ObjVector |
Here are also a number of links to functions having arguments with any of these data types.
Analytic Information Server (AIS)AIS Component Systems
|