]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/Functors/Inverse.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / Functors / Inverse.hxx
1 #ifndef __fpa__Base__Functors__Inverse__hxx__
2 #define __fpa__Base__Functors__Inverse__hxx__
3
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
9 {
10   TInput sign = TInput( ( x < TInput( 0 ) )? -1: 1 );
11   TOutput y = TOutput( 1 ) / ( TOutput( 1 ) + TOutput( x * sign ) );
12   return( y * TOutput( sign ) );
13 }
14
15 // -------------------------------------------------------------------------
16 template< class _TInput, class _TOutput >
17 fpa::Base::Functors::Inverse< _TInput, _TOutput >::
18 Inverse( )
19   : Superclass( )
20 {
21 }
22
23 // -------------------------------------------------------------------------
24 template< class _TInput, class _TOutput >
25 fpa::Base::Functors::Inverse< _TInput, _TOutput >::
26 ~Inverse( )
27 {
28 }
29
30 #endif // __fpa__Base__Functors__Inverse__hxx__
31
32 // eof - $RCSfile$