comparison xtract/xtract_scalar.h @ 192:bb60691d9570

Make xtract_lowest_value() return XTRACT_NO_RESULT if all values in the input data are below or equal to threshold value. Fixes #46 If XTRACT_NO_RESULT is returned, *result will be set to DBL_MAX
author Jamie Bullock <jamie@jamiebullock.com>
date Tue, 11 Feb 2014 16:39:41 +0000
parents 63ec44da1666
children 02b7b3f96713
comparison
equal deleted inserted replaced
191:e1d65ec5fde3 192:bb60691d9570
351 351
352 /** \brief Extract the value of the lowest value in an input vector 352 /** \brief Extract the value of the lowest value in an input vector
353 * 353 *
354 * \param *data: a pointer to the first element in an array of doubles 354 * \param *data: a pointer to the first element in an array of doubles
355 * \param N: the number of elements to be considered 355 * \param N: the number of elements to be considered
356 * \param *argv: a pointer to a double representing the lower limit for the search. i.e. (*result > *argv) returns 1. 356 * \param *argv: a pointer to a double representing the lower limit for the search. All values in the array pointed to by *data that are below or equal to this threshold will be ignored.
357 * \param *result: a pointer to a value representing the lowest component in *data that falls above a given threshold. 357 * \param *result: a pointer to a value representing the lowest component in *data that falls above a given threshold.
358 *
359 * \return XTRACT_SUCCESS is a lowest value was found or XTRACT_NO_VALUE if all values
360 * in the array pointed to by *data are below or equal to the threshold set with *argv
361 *
362 * \note If XTRACT_NO_VALUE is returned, *result will be set to DBL_MAX
358 * 363 *
359 */ 364 */
360 int xtract_lowest_value(const double *data, const int N, const void *argv, double *result); 365 int xtract_lowest_value(const double *data, const int N, const void *argv, double *result);
361 366
362 /** \brief Extract the value of the highest value in an input vector 367 /** \brief Extract the value of the highest value in an input vector