]> Creatis software - bbtk.git/blobdiff - packages/std/src/bbstdMathOperation.cxx
#2808, #2807, #2806, #2805, #2804 BBTK Feature New Normal Add new functionality MathO...
[bbtk.git] / packages / std / src / bbstdMathOperation.cxx
index be243d7d09b54bd7801a8eadfe4a47825f8b51df..a4b7272d6d25dcee9c5216cf9efa8fe5193b13ae 100644 (file)
@@ -46,7 +46,7 @@ void MathOperation::Process()
 
     if (bbGetInputType()==3)
     {
-                        if (bbGetInputIn2()!=0)  bbSetOutputOut( bbGetInputIn1() /  bbGetInputIn2() );
+                       if (bbGetInputIn2()!=0)  bbSetOutputOut( bbGetInputIn1() /  bbGetInputIn2() );
               else  bbSetOutputOut( 99999999 );
     }
 
@@ -54,7 +54,7 @@ void MathOperation::Process()
 
     if (bbGetInputType()==5)
         {
-                                if (bbGetInputIn2()>0)  bbSetOutputOut( log( bbGetInputIn1() ) );
+               if (bbGetInputIn1()>0)  bbSetOutputOut( log( bbGetInputIn1() ) );
               else  bbSetOutputOut( -99999999 );
         }
 
@@ -66,14 +66,17 @@ void MathOperation::Process()
                 acum++;
        if (acum>bbGetInputIn2()) acum=bbGetInputIn1();
         }
-    if (bbGetInputType()==8) bbSetOutputOut( rand() %  (int) (bbGetInputIn2()-bbGetInputIn1()) +  bbGetInputIn1() );
-    if (bbGetInputType()==9) bbSetOutputOut( sin( bbGetInputIn1() ) );
+    if (bbGetInputType()==8 ) bbSetOutputOut( rand() %  (int) (bbGetInputIn2()-bbGetInputIn1()) +  bbGetInputIn1() );
+    if (bbGetInputType()==9 ) bbSetOutputOut( sin( bbGetInputIn1() ) );
     if (bbGetInputType()==10) bbSetOutputOut( cos( bbGetInputIn1() ) );
     if (bbGetInputType()==11) bbSetOutputOut( tan( bbGetInputIn1() ) );
     if (bbGetInputType()==12) bbSetOutputOut( asin( bbGetInputIn1() ) );
     if (bbGetInputType()==13) bbSetOutputOut( acos( bbGetInputIn1() ) );
     if (bbGetInputType()==14) bbSetOutputOut( atan( bbGetInputIn1() ) );
     if (bbGetInputType()==15) bbSetOutputOut( atan2( bbGetInputIn1(),bbGetInputIn2() ) );
+    if (bbGetInputType()==16) bbSetOutputOut( fmin( bbGetInputIn1(),bbGetInputIn2() )  );
+    if (bbGetInputType()==17) bbSetOutputOut( fmax( bbGetInputIn1(),bbGetInputIn2() )  );
+    if (bbGetInputType()==18) bbSetOutputOut( fabs( bbGetInputIn1() ) );
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
@@ -90,6 +93,7 @@ void MathOperation::bbUserSetDefaultValues()
    firsttime=true;
    acum=0;
 }
+
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
@@ -100,22 +104,19 @@ void MathOperation::bbUserInitializeProcessing()
 //    Here does nothing 
 //    but this is where you should allocate the internal/output pointers 
 //    if any 
-
-  
 }
+
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 void MathOperation::bbUserFinalizeProcessing()
 {
-
 //  THE FINALIZATION METHOD BODY :
 //    Here does nothing 
 //    but this is where you should desallocate the internal/output pointers 
-//    if any
-  
-}
+//    if any  
 }
-// EO namespace bbstd
+
+}// EO namespace bbstd