24 #if ! defined (octave_lo_mappers_h) 25 #define octave_lo_mappers_h 1 27 #include "octave-config.h" 41 extern OCTAVE_API
bool isna (
double x);
42 OCTAVE_DEPRECATED (4.4,
"use 'math::isna' instead")
45 extern OCTAVE_API
bool isna (
float x);
46 OCTAVE_DEPRECATED (4.4,
"use 'math::isna' instead")
50 OCTAVE_DEPRECATED (4.4,
"use 'math::isna' instead")
54 OCTAVE_DEPRECATED (4.4,
"use 'math::isna' instead")
61 inline float copysign (
float x,
float y) {
return std::copysignf (
x,
y); }
85 inline double conj (
double x) {
return x; }
86 inline float conj (
float x) {
return x; }
96 inline float log2 (
float x) {
return std::log2f (
x); }
101 extern OCTAVE_API
double log2 (
double x,
int& exp);
102 extern OCTAVE_API
float log2 (
float x,
int& exp);
108 inline float exp2 (
float x) {
return std::exp2f (
x); }
110 template <
typename T>
118 template <
typename T>
130 template <
typename T>
137 template <
typename T>
146 inline float round (
float x) {
return std::roundf (
x); }
148 template <
typename T>
160 if (fabs (
x -
t) == 0.5)
171 if (fabsf (
x -
t) == 0.5
f)
177 template <
typename T>
184 extern OCTAVE_API
double frexp (
double x,
int *expptr);
185 extern OCTAVE_API
float frexp (
float x,
int *expptr);
187 inline bool isnan (
bool) {
return false; }
188 inline bool isnan (
char) {
return false; }
194 template <
typename T>
205 template <
typename T>
212 OCTAVE_DEPRECATED (4.4,
"use 'math::isfinite' instead")
214 OCTAVE_DEPRECATED (4.4,
"use 'math::isfinite' instead")
217 template <
typename T>
218 OCTAVE_DEPRECATED (4.4,
"use 'math::isfinite' instead")
229 template <
typename T>
269 template <
typename T>
275 return tmp == 0 ? 0.0 :
x /
tmp;
282 template <
typename T>
304 extern OCTAVE_API
int nint (
double x);
305 extern OCTAVE_API
int nint (
float x);
307 template <
typename T>
321 < std::numeric_limits<T>::epsilon ()))
328 volatile T
tmp =
y * n;
334 if (
x !=
y &&
y != 0)
340 template <
typename T>
354 < std::numeric_limits<T>::epsilon ()))
361 volatile T
tmp =
y * n;
367 if (
x !=
y &&
y != 0)
374 template <
typename T>
378 return x <=
y ?
x :
y;
381 template <
typename T>
385 return x >=
y ?
x :
y;
416 inline std::complex<double>
417 min (
const std::complex<double>&
x,
const std::complex<double>&
y)
422 inline std::complex<float>
423 min (
const std::complex<float>&
x,
const std::complex<float>&
y)
428 inline std::complex<double>
429 max (
const std::complex<double>&
x,
const std::complex<double>&
y)
434 inline std::complex<float>
435 max (
const std::complex<float>&
x,
const std::complex<float>&
y)
440 template <
typename T>
447 template <
typename T>
482 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) 484 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isna' instead")
486 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isna' instead")
488 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isna' instead")
490 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isna' instead")
496 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::acos' instead")
498 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::acos' instead")
504 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::asin' instead")
506 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::asin' instead")
512 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::atan' instead")
514 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::atan' instead")
520 OCTAVE_DEPRECATED (4.2,
"use 'std::arg' instead")
522 OCTAVE_DEPRECATED (4.2,
"use 'std::arg' instead")
525 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::conj' instead")
526 inline
double conj (
double x) {
return x; }
527 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::conj' instead")
528 inline
float conj (
float x) {
return x; }
530 OCTAVE_DEPRECATED (4.2,
"use 'std::imag' instead")
532 OCTAVE_DEPRECATED (4.2,
"use 'std::imag' instead")
535 OCTAVE_DEPRECATED (4.2,
"use 'std::real' instead")
537 OCTAVE_DEPRECATED (4.2,
"use 'std::real' instead")
540 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::log2' instead")
542 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::log2' instead")
545 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::log2' instead")
547 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::log2' instead")
553 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::log2' instead")
554 inline
double xlog2 (
double x,
int& exp)
558 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::log2' instead")
561 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::log2' instead")
566 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::log2' instead")
572 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::exp2' instead")
574 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::exp2' instead")
577 OCTAVE_DEPRECATED (4.2,
"use 'std::ceil' instead")
578 inline
double xceil (
double x) {
return std::ceil (
x); }
579 OCTAVE_DEPRECATED (4.2,
"use 'std::ceil' instead")
580 inline
float xceil (
float x) {
return std::ceil (
x); }
582 template <
typename T>
583 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::ceil' instead")
590 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::copysign' instead")
591 inline
double xcopysign (
double x,
double y)
595 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::copysign' instead")
596 inline
float xcopysign (
float x,
float y)
601 template <
typename T>
602 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::signbit' instead")
609 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::negative_sign' instead")
610 inline
bool xnegative_sign (
double x)
614 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::negative_sign' instead")
615 inline
bool xnegative_sign (
float x)
620 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::positive_sign' instead")
621 inline
bool xpositive_sign (
double x)
625 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::positive_sign' instead")
626 inline
bool xpositive_sign (
float x)
631 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::signum' instead")
633 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::signum' instead")
636 template <
typename T>
637 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::signum' instead")
644 OCTAVE_DEPRECATED (4.2,
"use 'std::trunc' instead")
645 inline
double xtrunc (
double x) {
return std::trunc (
x); }
646 OCTAVE_DEPRECATED (4.2,
"use 'std::trunc' instead")
647 inline
float xtrunc (
float x) {
return std::trunc (
x); }
649 template <
typename T>
650 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::trunc' instead")
652 xtrunc (const
std::complex<T>&
x)
657 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::fix' instead")
659 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::fix' instead")
662 template <
typename T>
663 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::fix' instead")
670 OCTAVE_DEPRECATED (4.2,
"use 'std::floor' instead")
671 inline
double xfloor (
double x) {
return std::floor (
x); }
672 OCTAVE_DEPRECATED (4.2,
"use 'std::floor' instead")
673 inline
float xfloor (
float x) {
return std::floor (
x); }
675 template <
typename T>
676 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::floor' instead")
683 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::round' instead")
685 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::round' instead")
688 template <
typename T>
689 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::round' instead")
691 xround (const
std::complex<T>&
x)
696 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::roundb' instead")
698 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::roundb' instead")
701 template <
typename T>
702 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::roundb' instead")
704 xroundb (const
std::complex<T>&
x)
709 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isnan' instead")
711 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isnan' instead")
713 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isnan' instead")
715 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isnan' instead")
718 template <
typename T>
719 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isnan' instead")
721 xisnan (const
std::complex<T>&
x)
726 OCTAVE_DEPRECATED (4.4,
"use 'octave::math::isfinite' instead")
728 OCTAVE_DEPRECATED (4.4,
"use 'octave::math::isfinite' instead")
731 template <
typename T>
732 OCTAVE_DEPRECATED (4.4,
"use 'octave::math::isfinite' instead")
734 xfinite (const
std::complex<T>&
x)
739 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isinf' instead")
741 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isinf' instead")
744 template <
typename T>
745 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isinf' instead")
747 xisinf (const
std::complex<T>&
x)
755 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isinteger' instead")
757 xisinteger (
double x)
762 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::isinteger' instead")
769 template <
typename T>
770 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::x_nint' instead")
777 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::x_nint (x)' instead")
779 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::x_nint (x)' instead")
782 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::nint_big' instead")
784 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::nint_big' instead")
787 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::nint' instead")
789 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::nint' instead")
792 template <
typename T>
793 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::mod' instead")
800 template <
typename T>
801 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rem' instead")
808 template <
typename T>
809 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::min' instead")
816 template <
typename T>
817 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::max' instead")
824 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::min' instead")
831 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::max' instead")
838 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::min' instead")
845 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::max' instead")
852 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::min' instead")
859 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::max' instead")
866 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::min' instead")
873 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::max' instead")
880 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_acos' instead")
882 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_acos' instead")
885 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_acosh' instead")
887 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_acosh' instead")
890 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_asin' instead")
892 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_asin' instead")
895 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_atanh' instead")
897 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_atanh' instead")
900 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_log' instead")
902 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_log' instead")
905 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_log2' instead")
907 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_log2' instead")
910 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_log10' instead")
912 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_log10' instead")
915 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_sqrt' instead")
917 OCTAVE_DEPRECATED (4.2,
"use 'octave::math::rc_sqrt' instead")
FloatComplex atan(const FloatComplex &x)
Complex rc_log10(double x)
octave_int< T > xmax(const octave_int< T > &x, const octave_int< T > &y)
Complex rc_acosh(double x)
Complex rc_sqrt(double x)
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE * f
std::complex< T > ceil(const std::complex< T > &x)
std::complex< T > floor(const std::complex< T > &x)
std::complex< T > round(const std::complex< T > &x)
bool isinf(const std::complex< T > &x)
Complex acos(const Complex &x)
Complex atan(const Complex &x)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
bool positive_sign(double x)
Complex asin(const Complex &x)
double frexp(double x, int *expptr)
Complex log2(const Complex &x)
std::complex< T > signum(const std::complex< T > &x)
Complex rc_atanh(double x)
float copysign(float x, float y)
Complex rc_log2(double x)
std::complex< T > trunc(const std::complex< T > &x)
std::complex< T > conj(const std::complex< T > &x)
bool isfinite(const std::complex< T > &x)
Complex rc_acos(double x)
octave_int< T > xmin(const octave_int< T > &x, const octave_int< T > &y)
bool is_NaN_or_NA(const Complex &x)
octave_idx_type nint_big(double x)
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol NaN(Not a Number). NaN is the result of operations which do not produce a well defined 0 result. Common operations which produce a NaN are arithmetic with infinity ex($\infty - \infty$)
bool negative_sign(double x)
bool isnan(const std::complex< T > &x)
Complex rc_asin(double x)
the element is set to zero In other the statement xample y
ColumnVector imag(const ComplexColumnVector &a)
std::complex< T > fix(const std::complex< T > &x)
std::complex< float > FloatComplex
std::complex< double > Complex
ColumnVector real(const ComplexColumnVector &a)
double copysign(double x, double y)
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE * x