libpgplotxx.a (C++ interface to PGPLOT)

◆ find_series_range()

template<class S >
Trange pgplot::find_series_range ( const S &  series)

find range in series

Find the range of the values in a series. The series may be any series class the provides

  1. BrowserT the type of an appropriate browser

The browser must provide

  1. hot() true if pointing to valid element

Definition at line 642 of file xpgplotxx.h.

References pgplot::Trange::max, and pgplot::Trange::min.

643  {
644  typename S::BrowserT iter=series;
645  float value(*iter);
646  Trange result(value,value);
647  while (iter.hot())
648  {
649  value=(*iter);
650  result.min=(result.min > value ? value : result.min);
651  result.max=(result.max < value ? value : result.max);
652  ++iter;
653  }
654  return(result);
655  }