Mercurial > octave
changeset 21812:9c3a3d252e80
* lo-mappers.h (arg, conj, imag, real): Delete double and float
overloads in octave::math namespace.
(conj): In deprecated functions that accept real arguments and return
real values, simply return argument.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 02 Jun 2016 11:31:10 -0400 |
parents | 25c8d554af32 |
children | 2ba69be3f3e8 |
files | liboctave/numeric/lo-mappers.h |
diffstat | 1 files changed, 6 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/numeric/lo-mappers.h Thu Jun 02 14:59:13 2016 -0700 +++ b/liboctave/numeric/lo-mappers.h Thu Jun 02 11:31:10 2016 -0400 @@ -60,24 +60,14 @@ using std::atan; - inline double arg (double x) { return atan2 (0.0, x); } - inline float arg (float x) { return atan2f (0.0f, x); } + // C++ now provides versions of the following funtions for + // arguments of type std::complex<T> and T so we no longer need to + // provide our own wrappers for real-valued arguments. Import + // them to the octave::math namespace for convenience. using std::arg; - - inline double conj (double x) { return x; } - inline float conj (float x) { return x; } - using std::conj; - - inline double imag (double) { return 0.0; } - inline float imag (float) { return 0.0f; } - using std::imag; - - inline double real (double x) { return x; } - inline float real (float x) { return x; } - using std::real; extern OCTAVE_API double log2 (double x); @@ -481,9 +471,9 @@ inline float arg (float x) { return octave::math::arg (x); } OCTAVE_DEPRECATED ("use 'octave::math::conj' instead") -inline double conj (double x) { return octave::math::conj (x); } +inline double conj (double x) { return x; } OCTAVE_DEPRECATED ("use 'octave::math::conj' instead") -inline float conj (float x) { return octave::math::conj (x); } +inline float conj (float x) { return x; } OCTAVE_DEPRECATED ("use 'octave::math::imag' instead") inline double imag (double x) { return octave::math::imag (x); }