## File: Finding-maximum-and-minimum-elements-of-vectors.html

package info (click to toggle)
gsl-ref-html 2.3-1
• area: non-free
• in suites: bullseye, buster, sid
• size: 6,876 kB
• ctags: 4,574
• sloc: makefile: 35
 file content (117 lines) | stat: -rw-r--r-- 5,849 bytes parent folder | download
 `123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117` `````` GNU Scientific Library – Reference Manual: Finding maximum and minimum elements of vectors

Next: , Previous: Vector operations, Up: Vectors   [Index]

8.3.9 Finding maximum and minimum elements of vectors

The following operations are only defined for real vectors.

Function: double gsl_vector_max (const gsl_vector * v)

This function returns the maximum value in the vector v.

Function: double gsl_vector_min (const gsl_vector * v)

This function returns the minimum value in the vector v.

Function: void gsl_vector_minmax (const gsl_vector * v, double * min_out, double * max_out)

This function returns the minimum and maximum values in the vector v, storing them in min_out and max_out.

Function: size_t gsl_vector_max_index (const gsl_vector * v)

This function returns the index of the maximum value in the vector v. When there are several equal maximum elements then the lowest index is returned.

Function: size_t gsl_vector_min_index (const gsl_vector * v)

This function returns the index of the minimum value in the vector v. When there are several equal minimum elements then the lowest index is returned.

Function: void gsl_vector_minmax_index (const gsl_vector * v, size_t * imin, size_t * imax)

This function returns the indices of the minimum and maximum values in the vector v, storing them in imin and imax. When there are several equal minimum or maximum elements then the lowest indices are returned.

``````