]> Creatis software - bbtk.git/blobdiff - packages/std/src/bbstdMathOperationVector.h
#3120 BBTK Bug New Normal - merge branch changestoITK3and4 FROM master
[bbtk.git] / packages / std / src / bbstdMathOperationVector.h
diff --git a/packages/std/src/bbstdMathOperationVector.h b/packages/std/src/bbstdMathOperationVector.h
new file mode 100644 (file)
index 0000000..7801557
--- /dev/null
@@ -0,0 +1,78 @@
+//===== 
+// 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)
+//===== 
+#ifndef __bbstdMathOperationVector_h_INCLUDED__
+#define __bbstdMathOperationVector_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT MathOperationVector
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(MathOperationVector,bbtk::AtomicBlackBox);
+//===== 
+// 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)
+//===== 
+  BBTK_DECLARE_INPUT(In0,std::vector <double>);
+  BBTK_DECLARE_INPUT(In1,std::vector <double>);
+  BBTK_DECLARE_INPUT(In2,std::vector <double>);
+  BBTK_DECLARE_INPUT(In3,std::vector <double>);
+  BBTK_DECLARE_INPUT(In4,std::vector <double>);
+  BBTK_DECLARE_INPUT(In5,std::vector <double>);
+  BBTK_DECLARE_INPUT(In6,std::vector <double>);
+  BBTK_DECLARE_INPUT(In7,std::vector <double>);
+  BBTK_DECLARE_INPUT(In8,std::vector <double>);
+  BBTK_DECLARE_INPUT(In9,std::vector <double>);
+  BBTK_DECLARE_INPUT(Type,int);
+  BBTK_DECLARE_OUTPUT(Out,std::vector <double>);
+  BBTK_PROCESS(Process);
+  void Process();
+
+  bool firsttime;
+  std::vector<double> acum;
+
+  double       g(std::vector<double>*v,unsigned int i,double defValue );
+  void                 SumVector(std::vector<double> *v,std::vector<double> *vr);
+  void                 MinVector(std::vector<double> *v,std::vector<double> *vr);
+  void                 MaxVector(std::vector<double> *v,std::vector<double> *vr);
+
+
+//===== 
+// 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)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(MathOperationVector,bbtk::AtomicBlackBox);
+  BBTK_NAME("MathOperationVector");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("Out[i] = In0[i] <operation> In1[i]  <operation> In2[i] ... In8[i] <operation> In9[i]");
+  BBTK_CATEGORY("empty");
+
+  BBTK_INPUT(MathOperationVector,In0,"Input vector 0",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In1,"Input vector 1",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In2,"Input vector 2",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In3,"Input vector 3",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In4,"Input vector 4",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In5,"Input vector 5",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In6,"Input vector 6",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In7,"Input vector 7",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In8,"Input vector 8",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In9,"Input vector 9",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,Type,"Type (defalult 0): 0  adition (default) In0[i]+In1[i]+..+In9[i], -99 adition In0[i] In1[i] ... In[9], 1 sustraction In0[i]-In1[i]-..-In9[i], 2 multiplication In0[i]*In2[i]*...*In9[i], 3 division In0/In1/.../In9, 4 sqrt In1, 5 log10 In1, 6 exp In1, 7 incremental int [In0..In1], 8 random int [In0..In1], 9 (rad) sin In0, 10 (rad) cos In0, 11 tan (rad) In0, 12 asin In0, 13 acos In0, 14 atan In0, 15 atan2 In0 In1 , 16 min (In0[i],In1[i]..In9[i]), -16 min(In0) min(In1) ... min(In9) , 17 max (In0[i],In1[i]..In9[i]), -17 max(In0) max(In1) ... max(In9) , 18 abs In0 , 19 module In0[i]%In1[i]  " ,int,"");
+
+  BBTK_OUTPUT(MathOperationVector,Out,"Output vector",std::vector<double>,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(MathOperationVector);
+//===== 
+// 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)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdMathOperationVector_h_INCLUDED__
+