Un Clúster con SLURM, uso y configuración
View more presentations from miguelolivan
Como su propio nombre indica, aún otro weblog de programación más
Of course it is physically possible to pick up a basketball and run with it. It is also possible you will get away with it during a game. However, it is against the rules; good players won’t do it and bad players won’t get away with it for long.Como se puede leer es uno de esos temas que conviene saber (y muy bien) si se pretende hacer código portable. Así que, para leer con detenimiento.
If there are fewer initializers than there are array elements, each element not explicitly initialized shall be
zero-initialized
If there are fewer initializers in the list than there are members in the aggregate, then each member not explicitly initialized shall be default-initialized (8.5)
[Example:
struct S { int a; char* b; int c; };
S ss = { 1, "asdf" };
initializes ss.a with 1, ss.b with "asdf", and ss.c with the value of an expression of the form
int(), that is, 0. ]
If there are fewer initializer-clauses in the list than there are members in the aggregate, then each member
not explicitly initialized shall be initialized from an empty initializer list (8.5.4)
RooRealVar a("a","a",3.);
RooRealVar b("b","b",7.);
RooFormulaVar plus(“aplusb”,”a+b”,RooArgSet(a,b));
//10
cout << plus.getVal() << endl;
TClonesArray tca("RooRealVar",2)
RooRealVar *var1 = new (tca[1]) RooRealVar("var1","var2",0);
RooRealVar *var2 = new (tca[0]) RooRealVar("var2","var2",0);
RooFormulaVar opor("var1orvar2","var1&var2",RooArgSet(tca));
var1->setVal(2.);
var2->setVal(7.);
//2
cout << opor.getVal() << endl;
var1->setVal(5.);
var2->setVal(1.);
//1
cout << opor.getVal() << endl;
var1->setVal(8.);
var2->setVal(1.);
//0
cout << opor.getVal() << endl;
TClonesArray tca("RooRealVar",2)
RooRealVar *var1 = new (tca[1]) RooRealVar("var1","var2",0);
RooRealVar *var2 = new (tca[0]) RooRealVar("var2","var2",0);
RooFormulaVar cond("var1littvar2big","var1<1 || var2>10",RooArgSet(tca));
var1->setVal(0.);
var2->setVal(17.);
//true
cout << cond.getVal() << endl;
var1->setVal(3.);
var2->setVal(11.);
//true
cout << cond.getVal() << endl;
var1->setVal(8.);
var2->setVal(1.);
//false
cout << cond.getVal() << endl;
RooRealVar a("a","a",3.);
RooRealVar b("b","b",7.);
RooFormulaVar plus(“aplusb”,”a+b”,RooArgSet(a,b));
//10
cout << plus.getVal() << endl;
TClonesArray tca("RooRealVar",2)
RooRealVar *var1 = new (tca[1]) RooRealVar("var1","var2",0);
RooRealVar *var2 = new (tca[0]) RooRealVar("var2","var2",0);
RooFormulaVar opor("var1orvar2","var1&var2",RooArgSet(tca));
var1->setVal(2.);
var2->setVal(7.);
//2
cout << opor.getVal() << endl;
var1->setVal(5.);
var2->setVal(1.);
//1
cout << opor.getVal() << endl;
var1->setVal(8.);
var2->setVal(1.);
//0
cout << opor.getVal() << endl;
TClonesArray tca("RooRealVar",2)
RooRealVar *var1 = new (tca[1]) RooRealVar("var1","var2",0);
RooRealVar *var2 = new (tca[0]) RooRealVar("var2","var2",0);
RooFormulaVar cond("var1littvar2big","var1<1 || var2>10",RooArgSet(tca));
var1->setVal(0.);
var2->setVal(17.);
//true
cout << cond.getVal() << endl;
var1->setVal(3.);
var2->setVal(11.);
//true
cout << cond.getVal() << endl;
var1->setVal(8.);
var2->setVal(1.);
//false
cout << cond.getVal() << endl;