]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Functors/InvertCostFunction.h
Minor bugs
[FrontAlgorithms.git] / lib / fpa / Base / Functors / InvertCostFunction.h
index faf4fb2dbea2027c58874f75d77f9ff2df8fbb73..fa04ed4841625428bb0d84e4988e59040d5d8c68 100644 (file)
@@ -29,7 +29,10 @@ namespace fpa
       public:
         virtual C Evaluate( const C& input ) const
           {
-            return( C( 1 ) / ( C( 1 ) + C( input ) ) );
+            if( input < C( 0 ) )
+              return( C( -1 ) / ( C( 1 ) + C( input ) ) );
+            else
+              return( C( 1 ) / ( C( 1 ) + C( input ) ) );
           }
 
       protected: