24 #if ! defined (octave_lo_mappers_h)
25 #define octave_lo_mappers_h 1
27 #include "octave-config.h"
40 extern OCTAVE_API
bool is_NA (
double x);
41 extern OCTAVE_API
bool is_NA (
float x);
49 extern OCTAVE_API
double copysign (
double x,
double y);
50 extern OCTAVE_API
float copysign (
float x,
float y);
52 extern OCTAVE_API
double signbit (
double x);
53 extern OCTAVE_API
float signbit (
float x);
83 inline double arg (
double x) {
return signbit (x) ? M_PI : 0; }
88 arg (
const std::complex<T>&
x)
93 inline double conj (
double x) {
return x; }
94 inline float conj (
float x) {
return x; }
103 inline double imag (
double) {
return 0; }
104 inline float imag (
float) {
return 0; }
106 template <
typename T>
113 inline double real (
double x) {
return x; }
114 inline float real (
float x) {
return x; }
116 template <
typename T>
123 extern OCTAVE_API
double log2 (
double x);
124 extern OCTAVE_API
float log2 (
float x);
129 extern OCTAVE_API
double log2 (
double x,
int& exp);
130 extern OCTAVE_API
float log2 (
float x,
int& exp);
135 extern OCTAVE_API
double exp2 (
double x);
136 extern OCTAVE_API
float exp2 (
float x);
139 inline float ceil (
float x) { return ::ceilf (x); }
141 template <
typename T>
148 extern OCTAVE_API
double trunc (
double x);
149 extern OCTAVE_API
float trunc (
float x);
151 template <
typename T>
161 template <
typename T>
168 extern OCTAVE_API
double floor (
double x);
169 extern OCTAVE_API
float floor (
float x);
171 template <
typename T>
178 extern OCTAVE_API
double round (
double x);
179 extern OCTAVE_API
float round (
float x);
181 template <
typename T>
193 if (fabs (x - t) == 0.5)
194 t = 2 *
trunc (0.5 * t);
204 if (fabsf (x - t) == 0.5
f)
210 template <
typename T>
217 extern OCTAVE_API
double frexp (
double x,
int *expptr);
218 extern OCTAVE_API
float frexp (
float x,
int *expptr);
220 inline bool isnan (
bool) {
return false; }
221 inline bool isnan (
char) {
return false; }
222 extern OCTAVE_API
bool isnan (
double x);
223 extern OCTAVE_API
bool isnan (
float x);
225 template <
typename T>
232 extern OCTAVE_API
bool finite (
double x);
233 extern OCTAVE_API
bool finite (
float x);
235 template <
typename T>
242 extern OCTAVE_API
bool isinf (
double x);
243 extern OCTAVE_API
bool isinf (
float x);
245 template <
typename T>
284 template <
typename T>
290 return tmp == 0 ? 0.0 : x /
tmp;
297 template <
typename T>
312 extern OCTAVE_API
int nint (
double x);
313 extern OCTAVE_API
int nint (
float x);
315 template <
typename T>
329 < std::numeric_limits<T>::epsilon ()))
336 volatile T
tmp = y * n;
342 if (x != y && y != 0)
348 template <
typename T>
362 < std::numeric_limits<T>::epsilon ()))
369 volatile T
tmp = y * n;
375 if (x != y && y != 0)
382 template <
typename T>
386 return x <= y ? x :
y;
389 template <
typename T>
393 return x >= y ? x :
y;
403 return isnan (y) ? x : (x <= y ? x :
y);
409 return isnan (y) ? x : (x >= y ? x :
y);
415 return isnan (y) ? x : (x <= y ? x :
y);
421 return isnan (y) ? x : (x >= y ? x :
y);
424 inline std::complex<double>
425 min (
const std::complex<double>&
x,
const std::complex<double>&
y)
430 inline std::complex<float>
431 min (
const std::complex<float>&
x,
const std::complex<float>&
y)
436 inline std::complex<double>
437 max (
const std::complex<double>&
x,
const std::complex<double>&
y)
442 inline std::complex<float>
443 max (
const std::complex<float>&
x,
const std::complex<float>&
y)
448 template <
typename T>
455 template <
typename T>
490 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
492 OCTAVE_DEPRECATED (
"use 'octave::math::is_NA' instead")
494 OCTAVE_DEPRECATED (
"use 'octave::math::is_NA' instead")
496 OCTAVE_DEPRECATED (
"use 'octave::math::is_NA' instead")
498 OCTAVE_DEPRECATED (
"use 'octave::math::is_NA' instead")
501 OCTAVE_DEPRECATED (
"use 'octave::math::is_NaN_or_NA' instead")
503 OCTAVE_DEPRECATED (
"use 'octave::math::is_NaN_or_NA' instead")
506 OCTAVE_DEPRECATED (
"use 'octave::math::acos' instead")
508 OCTAVE_DEPRECATED (
"use 'octave::math::acos' instead")
511 OCTAVE_DEPRECATED (
"use 'octave::math::asin' instead")
513 OCTAVE_DEPRECATED (
"use 'octave::math::asin' instead")
516 OCTAVE_DEPRECATED (
"use 'octave::math::atan' instead")
518 OCTAVE_DEPRECATED (
"use 'octave::math::atan' instead")
521 OCTAVE_DEPRECATED (
"use 'octave::math::arg' instead")
523 OCTAVE_DEPRECATED (
"use 'octave::math::arg' instead")
526 OCTAVE_DEPRECATED (
"use 'octave::math::conj' instead")
527 inline
double conj (
double x) {
return x; }
528 OCTAVE_DEPRECATED (
"use 'octave::math::conj' instead")
529 inline
float conj (
float x) {
return x; }
531 OCTAVE_DEPRECATED (
"use 'octave::math::imag' instead")
533 OCTAVE_DEPRECATED (
"use 'octave::math::imag' instead")
536 OCTAVE_DEPRECATED (
"use 'octave::math::real' instead")
538 OCTAVE_DEPRECATED (
"use 'octave::math::real' instead")
541 OCTAVE_DEPRECATED (
"use 'octave::math::log2' instead")
543 OCTAVE_DEPRECATED (
"use 'octave::math::log2' instead")
546 OCTAVE_DEPRECATED (
"use 'octave::math::log2' instead")
548 OCTAVE_DEPRECATED (
"use 'octave::math::log2' instead")
551 OCTAVE_DEPRECATED (
"use 'octave::math::log2' instead")
553 OCTAVE_DEPRECATED (
"use 'octave::math::log2' instead")
556 OCTAVE_DEPRECATED (
"use 'octave::math::log2' instead")
558 OCTAVE_DEPRECATED (
"use 'octave::math::log2' instead")
561 OCTAVE_DEPRECATED (
"use 'octave::math::exp2' instead")
563 OCTAVE_DEPRECATED (
"use 'octave::math::exp2' instead")
566 OCTAVE_DEPRECATED (
"use 'octave::math::ceil' instead")
568 OCTAVE_DEPRECATED (
"use 'octave::math::ceil' instead")
571 template <
typename T>
572 OCTAVE_DEPRECATED (
"use 'octave::math::ceil' instead")
579 OCTAVE_DEPRECATED (
"use 'octave::math::copysign' instead")
581 OCTAVE_DEPRECATED (
"use 'octave::math::copysign' instead")
584 template <
typename T>
585 OCTAVE_DEPRECATED (
"use 'octave::math::signbit' instead")
592 OCTAVE_DEPRECATED (
"use 'octave::math::negative_sign' instead")
594 OCTAVE_DEPRECATED (
"use 'octave::math::negative_sign' instead")
597 OCTAVE_DEPRECATED (
"use 'octave::math::positive_sign' instead")
599 OCTAVE_DEPRECATED (
"use 'octave::math::positive_sign' instead")
602 OCTAVE_DEPRECATED (
"use 'octave::math::signum' instead")
604 OCTAVE_DEPRECATED (
"use 'octave::math::signum' instead")
607 template <
typename T>
608 OCTAVE_DEPRECATED (
"use 'octave::math::signum' instead")
615 OCTAVE_DEPRECATED (
"use 'octave::math::trunc' instead")
617 OCTAVE_DEPRECATED (
"use 'octave::math::trunc' instead")
620 template <
typename T>
621 OCTAVE_DEPRECATED (
"use 'octave::math::trunc' instead")
623 xtrunc (const
std::complex<T>&
x)
628 OCTAVE_DEPRECATED (
"use 'octave::math::fix' instead")
630 OCTAVE_DEPRECATED (
"use 'octave::math::fix' instead")
633 template <
typename T>
634 OCTAVE_DEPRECATED (
"use 'octave::math::fix' instead")
641 OCTAVE_DEPRECATED (
"use 'octave::math::floor' instead")
643 OCTAVE_DEPRECATED (
"use 'octave::math::floor' instead")
646 template <
typename T>
647 OCTAVE_DEPRECATED (
"use 'octave::math::floor' instead")
654 OCTAVE_DEPRECATED (
"use 'octave::math::round' instead")
656 OCTAVE_DEPRECATED (
"use 'octave::math::round' instead")
659 template <
typename T>
660 OCTAVE_DEPRECATED (
"use 'octave::math::round' instead")
662 xround (const
std::complex<T>&
x)
667 OCTAVE_DEPRECATED (
"use 'octave::math::roundb' instead")
669 OCTAVE_DEPRECATED (
"use 'octave::math::roundb' instead")
672 template <
typename T>
673 OCTAVE_DEPRECATED (
"use 'octave::math::roundb' instead")
675 xroundb (const
std::complex<T>&
x)
680 OCTAVE_DEPRECATED (
"use 'octave::math::isnan' instead")
682 OCTAVE_DEPRECATED (
"use 'octave::math::isnan' instead")
684 OCTAVE_DEPRECATED (
"use 'octave::math::isnan' instead")
686 OCTAVE_DEPRECATED (
"use 'octave::math::isnan' instead")
689 template <
typename T>
690 OCTAVE_DEPRECATED (
"use 'octave::math::isnan' instead")
692 xisnan (const
std::complex<T>&
x)
697 OCTAVE_DEPRECATED (
"use 'octave::math::finite' instead")
699 OCTAVE_DEPRECATED (
"use 'octave::math::finite' instead")
702 template <
typename T>
703 OCTAVE_DEPRECATED (
"use 'octave::math::finite' instead")
705 xfinite (const
std::complex<T>&
x)
710 OCTAVE_DEPRECATED (
"use 'octave::math::isinf' instead")
712 OCTAVE_DEPRECATED (
"use 'octave::math::isinf' instead")
715 template <
typename T>
716 OCTAVE_DEPRECATED (
"use 'octave::math::isinf' instead")
718 xisinf (const
std::complex<T>&
x)
726 OCTAVE_DEPRECATED (
"use 'octave::math::isinteger' instead")
728 xisinteger (
double x)
733 OCTAVE_DEPRECATED (
"use 'octave::math::isinteger' instead")
740 template <
typename T>
741 OCTAVE_DEPRECATED (
"use 'octave::math::x_nint' instead")
748 OCTAVE_DEPRECATED (
"use 'octave::math::x_nint (x)' instead")
750 OCTAVE_DEPRECATED (
"use 'octave::math::x_nint (x)' instead")
753 OCTAVE_DEPRECATED (
"use 'octave::math::nint_big' instead")
755 OCTAVE_DEPRECATED (
"use 'octave::math::nint_big' instead")
758 OCTAVE_DEPRECATED (
"use 'octave::math::nint' instead")
760 OCTAVE_DEPRECATED (
"use 'octave::math::nint' instead")
763 template <
typename T>
764 OCTAVE_DEPRECATED (
"use 'octave::math::mod' instead")
771 template <
typename T>
772 OCTAVE_DEPRECATED (
"use 'octave::math::rem' instead")
779 template <
typename T>
780 OCTAVE_DEPRECATED (
"use 'octave::math::min' instead")
787 template <
typename T>
788 OCTAVE_DEPRECATED (
"use 'octave::math::max' instead")
795 OCTAVE_DEPRECATED (
"use 'octave::math::min' instead")
802 OCTAVE_DEPRECATED (
"use 'octave::math::max' instead")
809 OCTAVE_DEPRECATED (
"use 'octave::math::min' instead")
816 OCTAVE_DEPRECATED (
"use 'octave::math::max' instead")
823 OCTAVE_DEPRECATED (
"use 'octave::math::min' instead")
830 OCTAVE_DEPRECATED (
"use 'octave::math::max' instead")
837 OCTAVE_DEPRECATED (
"use 'octave::math::min' instead")
844 OCTAVE_DEPRECATED (
"use 'octave::math::max' instead")
851 OCTAVE_DEPRECATED (
"use 'octave::math::rc_acos' instead")
853 OCTAVE_DEPRECATED (
"use 'octave::math::rc_acos' instead")
856 OCTAVE_DEPRECATED (
"use 'octave::math::rc_acosh' instead")
858 OCTAVE_DEPRECATED (
"use 'octave::math::rc_acosh' instead")
861 OCTAVE_DEPRECATED (
"use 'octave::math::rc_asin' instead")
863 OCTAVE_DEPRECATED (
"use 'octave::math::rc_asin' instead")
866 OCTAVE_DEPRECATED (
"use 'octave::math::rc_atanh' instead")
868 OCTAVE_DEPRECATED (
"use 'octave::math::rc_atanh' instead")
871 OCTAVE_DEPRECATED (
"use 'octave::math::rc_log' instead")
873 OCTAVE_DEPRECATED (
"use 'octave::math::rc_log' instead")
876 OCTAVE_DEPRECATED (
"use 'octave::math::rc_log2' instead")
878 OCTAVE_DEPRECATED (
"use 'octave::math::rc_log2' instead")
881 OCTAVE_DEPRECATED (
"use 'octave::math::rc_log10' instead")
883 OCTAVE_DEPRECATED (
"use 'octave::math::rc_log10' instead")
886 OCTAVE_DEPRECATED (
"use 'octave::math::rc_sqrt' instead")
888 OCTAVE_DEPRECATED (
"use 'octave::math::rc_sqrt' instead")
Octave interface to the compression and uncompression libraries.
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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
T real(const std::complex< T > &x)
T imag(const std::complex< T > &x)
std::complex< T > ceil(const std::complex< T > &x)
std::complex< T > floor(const std::complex< T > &x)
T arg(const std::complex< T > &x)
Complex acos(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)
std::complex< T > signum(const std::complex< T > &x)
Complex rc_atanh(double x)
Complex atan(const Complex &x)
double copysign(double x, double y)
Complex rc_log2(double x)
std::complex< T > conj(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 return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
bool negative_sign(double x)
Complex rc_asin(double x)
the element is set to zero In other the statement xample y
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 $)
std::complex< T > fix(const std::complex< T > &x)
std::complex< float > FloatComplex
std::complex< double > Complex
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x