76 #ifndef SLIP_MACROS_HPP
77 #define SLIP_MACROS_HPP
98 template<
typename T1,
typename T2>
struct un_real :
public std::unary_function<T1,T2>
112 template<
typename T1,
typename T2>
struct un_imag :
public std::unary_function<T1,T2>
127 template<
typename T1,
typename T2>
128 struct un_abs :
public std::unary_function<T1,T2>
147 struct less_abs :
public std::binary_function<_Tp, _Tp, bool>
194 struct mini :
public std::binary_function<_Tp, _Tp, _Tp>
214 struct maxi :
public std::binary_function<_Tp, _Tp, _Tp>
240 template <
typename T,
typename R>
241 struct Sign :
public std::unary_function<R,T>
247 R s = (x > T(0) ? R(1) : R(-1));
257 template <
typename Complex>
264 Complex r = Complex(1);
287 template <
typename Real>
294 return(absx *
std::sqrt(1.0+(absy/absx)*(absy/absx)));
298 return(absy == 0.0 ? 0.0 : absy *
std::sqrt(1.0+(absx/absy)*(absx/absy)));
306 template<
typename Iterator>
318 template<
typename Iterator>
340 template <
int N,
typename T>
345 for(
int i = 1; i < N; ++i)
366 template <
typename T,
typename Integer>
375 for(Integer i = 1; i < N; ++i)
398 template<
typename _Tp>
402 static _Tp
pi() throw()
403 {
return static_cast<_Tp
>(3.1415926535897932384626433832795029L); }
406 {
return static_cast<_Tp
>(1.5707963267948966192313216916397514L); }
409 {
return static_cast<_Tp
>(1.0471975511965977461542144610931676L); }
412 {
return static_cast<_Tp
>(0.7853981633974483096156608458198757L); }
415 {
return static_cast<_Tp
>(0.3183098861837906715377675267450287L); }
418 {
return static_cast<_Tp
>(1.1283791670955125738961589031215452L); }
421 {
return static_cast<_Tp
>(1.0L); }
424 {
return static_cast<_Tp
>(2.0L); }
427 {
return static_cast<_Tp
>(0.5L); }
430 {
return static_cast<_Tp
>(1.4142135623730950488016887242096981L); }
433 {
return static_cast<_Tp
>(1.7320508075688772935274463415058723L); }
436 {
return static_cast<_Tp
>(1.2533141373155002512078826424055226L); }
439 {
return static_cast<_Tp
>(0.7071067811865475244008443621048490L); }
442 {
return static_cast<_Tp
>(1.1447298858494001741434273513530587L); }
445 {
return static_cast<_Tp
>(0.5772156649015328606065120900824024L); }
448 {
return static_cast<_Tp
>(2.7182818284590452353602874713526625L); }
453 #endif //SLIP_MACROS_HPP
T2 operator()(const T1 &x)
T sign(T a)
Computes the sign of a.
Computes the maximum value between two values.
static _Tp _1_pi()
Constant .
T power(T x, Integer N)
function to compute.
T2 operator()(const T1 &x)
static _Tp sqrtpi_2()
Constant .
A structure for numeric constants.
T & min(const GrayscaleImage< T > &M1)
Returns the min element of a GrayscaleImage.
static _Tp sqrt1_2()
Constant .
slip::lin_alg_traits< T >::value_type epsilon()
Returns the epsilon value of a real or a complex.
bool operator()(Iterator s1, Iterator s2) const
bool operator()(const _Tp &__x, const _Tp &__y) const
_Tp operator()(const _Tp &__x, const _Tp &__y) const
Real functor. Return the real part of x.
static _Tp two()
Constant .
Computes the minimum value between two values.
HyperVolume< T > abs(const HyperVolume< T > &M)
static _Tp pi()
Constant .
static _Tp sqrt2()
Constant .
T nth_power(T x)
Computes the nth power of an element .
Real pythagore(const Real &x, const Real &y)
Computes without destructive underflow or overflow.
static _Tp lnpi()
Constant .
static _Tp pi_4()
Constant .
static _Tp half()
Constant .
static _Tp pi_2()
Constant .
Complex operator()(const Complex &x)
static _Tp sqrt3()
Constant .
Imag functor. Return the imaginary part of x.
HyperVolume< T > sqrt(const HyperVolume< T > &M)
Compare two element according to their absolute value. Return true if std::abs(__x) > std::abs( __y)...
Compare two element according to their absolute value. Return true if std::abs(__x) < std::abs( __y)...
static _Tp pi_3()
Constant .
static _Tp one()
Constant .
T2 operator()(const T1 &x)
_Tp operator()(const _Tp &__x, const _Tp &__y) const
Abs functor. Return the absolute value of x.
static _Tp _2_sqrtpi()
Constant .
bool operator()(Iterator s1, Iterator s2) const
static _Tp euler()
Constant Euler-Mascheroni .
static _Tp gamma_e()
Constant Euler's constant .
T & max(const GrayscaleImage< T > &M1)
Returns the max element of a GrayscaleImage.
bool operator()(const _Tp &__x, const _Tp &__y) const