#ifndef __fpa__Base__Functors__Inverse__hxx__ #define __fpa__Base__Functors__Inverse__hxx__ // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > typename fpa::Base::Functors::Inverse< _TInput, _TOutput >:: TOutput fpa::Base::Functors::Inverse< _TInput, _TOutput >:: Evaluate( const TInput& x ) const { TInput sign = TInput( ( x < TInput( 0 ) )? -1: 1 ); TOutput y = TOutput( 1 ) / ( TOutput( 1 ) + TOutput( x * sign ) ); if( sign < TInput( 0 ) ) return( y * this->m_NegativeValue ); else return( y ); } // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > fpa::Base::Functors::Inverse< _TInput, _TOutput >:: Inverse( ) : Superclass( ), m_NegativeValue( _TOutput( -1 ) ) { } // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > fpa::Base::Functors::Inverse< _TInput, _TOutput >:: ~Inverse( ) { } #endif // __fpa__Base__Functors__Inverse__hxx__ // eof - $RCSfile$