Mercurial > octave
diff liboctave/numeric/lo-mappers.h @ 22117:9b832e9caae6
define forwarding functions for octave_int<T> xmin and xmax (bug #48139)
* lo-mappers.h (min, max): Define forwarding functions for
octave_int<T> types.
* MArray.cc (MArray<T>::idx_min, MArray<T>::idx_max): Use
octave::math::min and max as template parameters instead of xmin and
xmax.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 15 Jul 2016 10:43:48 -0400 |
parents | e0dbd81fd9b1 |
children | edcad35c364f |
line wrap: on
line diff
--- a/liboctave/numeric/lo-mappers.h Fri Jul 15 10:40:58 2016 -0400 +++ b/liboctave/numeric/lo-mappers.h Fri Jul 15 10:43:48 2016 -0400 @@ -29,6 +29,7 @@ #include <limits> #include "oct-cmplx.h" +#include "oct-inttypes-fwd.h" #include "lo-math.h" #include "lo-ieee.h" @@ -409,6 +410,20 @@ return abs (x) >= abs (y) ? x : (isnan (x) ? x : y); } + template <typename T> + inline octave_int<T> + min (const octave_int<T>& x, const octave_int<T>& y) + { + return xmin (x, y); + } + + template <typename T> + inline octave_int<T> + max (const octave_int<T>& x, const octave_int<T>& y) + { + return xmax (x, y); + } + // These map reals to Complex. extern OCTAVE_API Complex rc_acos (double);