SDDSlib
|
Provides functions to find minimum and maximum values in arrays. More...
#include "mdb.h"
Go to the source code of this file.
Functions | |
int | find_min_max (double *min, double *max, double *list, int64_t n) |
Finds the minimum and maximum values in a list of doubles. | |
int | update_min_max (double *min, double *max, double *list, int64_t n, int32_t reset) |
Updates the minimum and maximum values based on a list of doubles. | |
int | index_min_max (int64_t *imin, int64_t *imax, double *list, int64_t n) |
Finds the indices of the minimum and maximum values in a list of doubles. | |
int | index_min_max_long (int64_t *imin, int64_t *imax, long *list, int64_t n) |
Finds the indices of the minimum and maximum values in a list of longs. | |
int | assign_min_max (double *min, double *max, double val) |
int | find_min_max_2d (double *min, double *max, double **value, long n1, long n2) |
int | find_min_max_2d_float (float *min, float *max, float **value, long n1, long n2) |
int | find_min (double *min, double *loc, double *c1, double *c2, long n) |
int | find_max (double *max, double *loc, double *c1, double *c2, long n) |
double | max_in_array (double *array, long n) |
Finds the maximum value in an array of doubles. | |
double | min_in_array (double *array, long n) |
Finds the minimum value in an array of doubles. | |
Provides functions to find minimum and maximum values in arrays.
This file contains functions to find the minimum and maximum values in one-dimensional and two-dimensional arrays, as well as functions to find the indices of these values and perform assignments based on comparisons.
Definition in file findMinMax.c.
int assign_min_max | ( | double * | min, |
double * | max, | ||
double | val ) |
Definition at line 197 of file findMinMax.c.
int find_max | ( | double * | max, |
double * | loc, | ||
double * | c1, | ||
double * | c2, | ||
long | n ) |
Definition at line 291 of file findMinMax.c.
int find_min | ( | double * | min, |
double * | loc, | ||
double * | c1, | ||
double * | c2, | ||
long | n ) |
Definition at line 272 of file findMinMax.c.
int find_min_max | ( | double * | min, |
double * | max, | ||
double * | list, | ||
int64_t | n ) |
Finds the minimum and maximum values in a list of doubles.
This function iterates through the provided list of doubles to determine the minimum and maximum values. The results are stored in the provided pointers if they are not NULL.
min | Pointer to store the minimum value found. Can be NULL if not needed. |
max | Pointer to store the maximum value found. Can be NULL if not needed. |
list | Pointer to the array of doubles to search. |
n | Number of elements in the list. |
Definition at line 33 of file findMinMax.c.
int find_min_max_2d | ( | double * | min, |
double * | max, | ||
double ** | value, | ||
long | n1, | ||
long | n2 ) |
Definition at line 219 of file findMinMax.c.
int find_min_max_2d_float | ( | float * | min, |
float * | max, | ||
float ** | value, | ||
long | n1, | ||
long | n2 ) |
Definition at line 247 of file findMinMax.c.
int index_min_max | ( | int64_t * | imin, |
int64_t * | imax, | ||
double * | list, | ||
int64_t | n ) |
Finds the indices of the minimum and maximum values in a list of doubles.
This function iterates through the provided list of doubles to determine the indices of the minimum and maximum values. The indices are stored in the provided pointers if they are not NULL.
imin | Pointer to store the index of the minimum value. Can be NULL if not needed. |
imax | Pointer to store the index of the maximum value. Can be NULL if not needed. |
list | Pointer to the array of doubles to search. |
n | Number of elements in the list. |
Definition at line 116 of file findMinMax.c.
int index_min_max_long | ( | int64_t * | imin, |
int64_t * | imax, | ||
long * | list, | ||
int64_t | n ) |
Finds the indices of the minimum and maximum values in a list of longs.
This function iterates through the provided list of longs to determine the indices of the minimum and maximum values. The indices are stored in the provided pointers if they are not NULL.
imin | Pointer to store the index of the minimum value. Can be NULL if not needed. |
imax | Pointer to store the index of the maximum value. Can be NULL if not needed. |
list | Pointer to the array of longs to search. |
n | Number of elements in the list. |
Definition at line 160 of file findMinMax.c.
double max_in_array | ( | double * | array, |
long | n ) |
Finds the maximum value in an array of doubles.
This function iterates through the provided array of doubles to determine the maximum value.
array | Pointer to the array of doubles to search. |
n | Number of elements in the array. |
Definition at line 318 of file findMinMax.c.
double min_in_array | ( | double * | array, |
long | n ) |
Finds the minimum value in an array of doubles.
This function iterates through the provided array of doubles to determine the minimum value.
array | Pointer to the array of doubles to search. |
n | Number of elements in the array. |
Definition at line 336 of file findMinMax.c.
int update_min_max | ( | double * | min, |
double * | max, | ||
double * | list, | ||
int64_t | n, | ||
int32_t | reset ) |
Updates the minimum and maximum values based on a list of doubles.
This function iterates through the provided list of doubles to update the minimum and maximum values. If the 'reset' flag is non-zero, the function resets the current min and max before processing the list.
min | Pointer to the current minimum value. If 'reset' is non-zero, this will be set to the new minimum. |
max | Pointer to the current maximum value. If 'reset' is non-zero, this will be set to the new maximum. |
list | Pointer to the array of doubles to process. |
n | Number of elements in the list. |
reset | Flag indicating whether to reset the current min and max before updating. Non-zero to reset. |
Definition at line 72 of file findMinMax.c.