std::vector<double> *v8 = &_v8;
std::vector<double> *v9 = &_v9;
- double minTmp;
- double maxTmp;
+ double minTmp;
+ double maxTmp;
if (firsttime==true)
{
bbSetOutputOut( resultVec );
} // Type 21
+
+ if (bbGetInputType()==22)
+ {
+ double resultX=0;
+ double resultY=0;
+ double resultZ=0;
+ double resultMassTotal=0;
+ for (i=0;i<sizeVec;i++)
+ {
+ resultX = resultX + g(v0,i,0)*g(v3,i,1);
+ resultY = resultY + g(v1,i,0)*g(v3,i,1);
+ resultZ = resultZ + g(v2,i,0)*g(v3,i,1);
+ resultMassTotal = resultMassTotal + g(v3,i,1);
+ } // for i
+ if (resultMassTotal!=0)
+ {
+ resultVec.push_back( resultX / resultMassTotal );
+ resultVec.push_back( resultY / resultMassTotal );
+ resultVec.push_back( resultZ / resultMassTotal );
+ } // if resultMassTotal
+ bbSetOutputOut( resultVec );
+ } // if Type 22
+
+
+
}
//=====
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] , 20 lessThan In0[i]<In1[i], 21 greaterThan In0[i]>In1[i] " ,int,"");
+ 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] , 20 lessThan In0[i]<In1[i], 21 greaterThan In0[i]>In1[i], 22 Centre of Mass In0=lstX In1=lstY In2=lstZ In3=lstValues " ,int,"");
BBTK_OUTPUT(MathOperationVector,Out,"Output vector",std::vector<double>,"");