28 ProcOptional(
const char *
name,
31 ~ProcOptional()
override {}
33 void configure(ConfIterator iter,
unsigned int n)
override;
34 void eval(ValueIterator iter,
unsigned int n)
const override;
35 std::vector<double> deriv(
36 ValueIterator iter,
unsigned int n)
const override;
39 std::vector<double> neutralPos;
44 ProcOptional::ProcOptional(
const char *
name,
48 neutralPos(calib->neutralPos)
52 void ProcOptional::configure(ConfIterator iter,
unsigned int n)
54 if (n != neutralPos.size())
58 iter++(Variable::FLAG_OPTIONAL) << Variable::FLAG_NONE;
61 void ProcOptional::eval(ValueIterator iter,
unsigned int n)
const 63 for(std::vector<double>::const_iterator
pos = neutralPos.begin();
64 pos != neutralPos.end();
pos++, ++iter) {
74 <<
"Multiple input variables encountered." 80 std::vector<double> ProcOptional::deriv(
81 ValueIterator iter,
unsigned int n)
const 83 unsigned int size = 0;
84 for(ValueIterator iter2 = iter; iter2; ++iter2)
87 std::vector<double>
result;
89 unsigned int column = 0;
90 for(std::vector<double>::const_iterator
pos = neutralPos.begin();
91 pos != neutralPos.end();
pos++, ++iter) {
92 unsigned int row = result.size();
93 result.resize(row + size);
98 result[row + column++] = 1.0;
102 <<
"Multiple input variables encountered."