25 using namespace PhysicsTools;
34 ProcMultiply(
const char *
name,
37 virtual ~ProcMultiply() {}
39 virtual void configure(ConfIterator iter,
unsigned int n);
40 virtual void eval(ValueIterator iter,
unsigned int n)
const;
41 virtual std::vector<double> deriv(
42 ValueIterator iter,
unsigned int n)
const;
45 typedef std::vector<unsigned int> Config;
48 std::vector<Config>
out;
53 ProcMultiply::ProcMultiply(
const char *
name,
60 std::back_inserter(
out));
63 void ProcMultiply::configure(ConfIterator iter,
unsigned int n)
68 for(
unsigned int i = 0;
i <
in;
i++)
71 for(
unsigned int i = 0;
i <
out.size();
i++)
75 void ProcMultiply::eval(ValueIterator iter,
unsigned int n)
const
77 double *
values = (
double*)alloca(in *
sizeof(
double));
78 for(
double *
pos = values; iter; iter++,
pos++) {
81 <<
"Special input variable encountered "
87 for(std::vector<Config>::const_iterator
config =
out.begin();
90 for(std::vector<unsigned int>::const_iterator var =
92 var !=
config->end(); var++)
93 product *= values[*var];
99 std::vector<double> ProcMultiply::deriv(
100 ValueIterator iter,
unsigned int n)
const
102 std::vector<double>
values;
103 std::vector<unsigned int> offsets;
104 unsigned int size = 0;
106 offsets.push_back(size);
108 values.push_back(*iter++);
113 for(std::vector<Config>::const_iterator
config =
out.begin();
115 for(
unsigned int i = 0;
i <
config->size();
i++) {
116 double product = 1.0;
117 for(
unsigned int j = 0;
j <
config->size();
j++)
119 product *= values[(*config)[
j]];
121 result[k * size + offsets[
i]] = product;
detail::ThreadSafeRegistry< ParameterSetID, ParameterSet, ProcessParameterSetIDCache > Registry
MVATrainerComputer * calib
tuple size
Write out results.