Function t8_shmem_array_binary_search(t8_shmem_array_t, const t8_gloidx_t, const int, int(*)(t8_shmem_array_t, const int, const t8_gloidx_t))

Function Documentation

int t8_shmem_array_binary_search(t8_shmem_array_t array, const t8_gloidx_t value, const int size, int (*compare)(t8_shmem_array_t, const int, const t8_gloidx_t))

Perform a binary search in a t8_shmem_array.

Parameters:
  • array[in] The t8_shmem_array to search in.

  • value[in] The value to search for.

  • size[in] The number of elements in the array.

  • compare[in] A function that compares an element of the array with the value.

Returns:

The index of the element in array that matches value.