MobilityDB 1.1

◆ set_find_value()

bool set_find_value ( const Set s,
Datum  d,
int *  loc 
)

General functions for set values composed of an ordered list of distinct values.

Return the location of a value in a set using binary search.

If the value is found, the index of the value is returned in the output parameter. Otherwise, return a number encoding whether it is before, between two values, or after the set. For example, given a set composed of 3 values and a parameter value, the result of the function is as follows:

0 1 2
| | |
1) d^ => loc = 0
2) d^ => loc = 0
3) d^ => loc = 1
4) d^ => loc = 2
5) d^ => loc = 3
Parameters
[in]sSet
[in]dValue
[out]locLocation
Returns
Return true if the value is contained in the set