1 #ifndef __fpa__Base__Functors__Inverse__hxx__
2 #define __fpa__Base__Functors__Inverse__hxx__
4 // -------------------------------------------------------------------------
5 template< class _TInput, class _TOutput >
6 typename fpa::Base::Functors::Inverse< _TInput, _TOutput >::
7 TOutput fpa::Base::Functors::Inverse< _TInput, _TOutput >::
8 Evaluate( const TInput& x ) const
10 TInput sign = TInput( ( x < TInput( 0 ) )? -1: 1 );
11 TOutput y = TOutput( 1 ) / ( TOutput( 1 ) + TOutput( x * sign ) );
12 if( sign < TInput( 0 ) )
13 return( y * this->m_NegativeValue );
18 // -------------------------------------------------------------------------
19 template< class _TInput, class _TOutput >
20 fpa::Base::Functors::Inverse< _TInput, _TOutput >::
23 m_NegativeValue( _TOutput( -1 ) )
27 // -------------------------------------------------------------------------
28 template< class _TInput, class _TOutput >
29 fpa::Base::Functors::Inverse< _TInput, _TOutput >::
34 #endif // __fpa__Base__Functors__Inverse__hxx__