KDATA_XMAX(3)

NAME
kdata_xmax, kdata_ymax, - find maxima in a data source

LIBRARY
libkplot

SYNOPSIS
#include <cairo.h>
#include <kplot.h>
ssize_t
kdata_xmax(const struct kdata *data, struct kpair *kp);
ssize_t
kdata_ymax(const struct kdata *data, struct kpair *kp);

DESCRIPTION
The kdata_xmax and kdata_ymax functions find the maximum point in a data source, filling in kp if it is not NULL. The maximum point is the first maximum: thus, if multiple minima exist of the same value, the first will be returned.

RETURN VALUES
If the data source has zero entries, kdata_xmax and kdata_ymax return -1. Otherwise, they return the index of the maximum.

SEE ALSO
kdata_xmin(3), kdata_ymin(3), kplot(3)