18 #ifndef __itkFunctors_h 19 #define __itkFunctors_h 21 #include "vnl/vnl_math.h" 22 #include "vnl/vnl_erf.h" 23 #include "itkNumericTraits.h" 34 #define __FunctorOneArgumentRight(Name, Op) \ 35 template< class TInput, class TArgument=TInput, class TOutput=TInput > \ 39 bool operator!=(const Name & other) const \ 40 { return m_Argument!=other.m_Argument; } \ 41 bool operator==(const Name & other) const \ 42 { return !( *this != other ); } \ 43 inline TOutput operator()( const TInput & A ) const \ 45 return static_cast<TOutput>( A Op this->m_Argument ); \ 47 void SetArgument( TArgument arg ){ this->m_Argument = arg; } \ 48 TArgument GetArgument( ) const { return this->m_Argument; } \ 50 TArgument m_Argument; \ 55 #define __FunctorOneArgumentLeft(Name, Op) \ 56 template< class TInput, class TArgument=TInput, class TOutput=TInput > \ 60 bool operator!=(const Name &) const \ 61 { return m_Argument!=other.m_Argument; } \ 62 bool operator==(const Name & other) const \ 63 { return !( *this != other ); } \ 64 inline TOutput operator()( const TInput & A ) const \ 66 return static_cast<TOutput>( this->m_Argument Op A ); \ 68 void SetArgument( TArgument arg ){ this->m_Argument = arg; }; \ 69 TArgument GetArgument( ) const { return this->m_Argument; } \ 71 TArgument m_Argument; \ 84 template< class TInput, class TArgument=TInput, class TOutput=TInput >
91 {
return !( *
this != other ); }
94 return static_cast<TOutput
>( vcl_log( static_cast<double>( A ) ) / vcl_log( static_cast<double>( this->m_Argument ) ) );
106 template<
class TInput,
class TArgument=TInput,
class TOutput=TInput >
113 {
return !( *
this != other ); }
116 return static_cast<TOutput
>( vcl_pow( static_cast<double>( A ), static_cast<double>( this->
m_Argument ) ) );
124 template<
class TInput,
class TArgument=TInput,
class TOutput=TInput >
131 {
return !( *
this != other ); }
134 return static_cast<TOutput
>( vcl_pow( static_cast<double>( this->
m_Argument ), static_cast<double>( A ) ) );
210 template<
class TInput,
class TArgument=TInput,
class TOutput=TInput >
217 {
return !( *
this != other ); }
220 return static_cast<TOutput
>( this->m_Argument1 * A + this->m_Argument2 );
240 #endif //#ifndef __itkFunctors_h
bool operator!=(const NLOG &other) const
bool operator==(const RPOWER &other) const
bool operator==(const LINEAR &other) const
bool operator==(const NLOG &other) const
TArgument GetArgument() const
TOutput operator()(const TInput &A) const
void SetArgument2(TArgument arg)
bool operator==(const LPOWER &other) const
TArgument GetArgument2() const
void SetArgument(TArgument arg)
TArgument GetArgument1() const
void SetArgument(TArgument arg)
TOutput operator()(const TInput &A) const
TOutput operator()(const TInput &A) const
bool operator!=(const RPOWER &other) const
void SetArgument(TArgument arg)
TArgument GetArgument() const
bool operator!=(const LINEAR &other) const
bool operator!=(const LPOWER &other) const
TArgument GetArgument() const
#define __FunctorOneArgumentRight(Name, Op)
TOutput operator()(const TInput &A) const
void SetArgument1(TArgument arg)