Mercurial > jwe > octave
diff liboctave/oct-inttypes.h @ 9743:26abff55f6fe
optimize bsxfun for common built-in operations
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 20 Oct 2009 10:47:22 +0200 |
parents | 11844593875a |
children | 4c0cdbe0acca |
line wrap: on
line diff
--- a/liboctave/oct-inttypes.h Mon Oct 19 19:17:49 2009 -0700 +++ b/liboctave/oct-inttypes.h Tue Oct 20 10:47:22 2009 +0200 @@ -1090,6 +1090,22 @@ #undef OCTAVE_INT_FLOAT_CMP_OP +template <class T> +octave_int<T> +xmax (const octave_int<T>& x, const octave_int<T>& y) +{ + const T xv = x.value (), yv = y.value (); + return octave_int<T> (xv >= yv ? xv : yv); +} + +template <class T> +octave_int<T> +xmin (const octave_int<T>& x, const octave_int<T>& y) +{ + const T xv = x.value (), yv = y.value (); + return octave_int<T> (xv <= yv ? xv : yv); +} + #endif /*