33 ~ProcNormalize()
override {}
35 void configure(ConfIterator iter,
unsigned int n)
override;
36 void eval(ValueIterator iter,
unsigned int n)
const override;
37 std::vector<double> deriv(ValueIterator iter,
unsigned int n)
const override;
50 void findMap(ValueIterator iter,
52 std::vector<Map>::const_iterator &begin,
53 std::vector<Map>::const_iterator &end)
const;
55 std::vector<Map> maps;
65 categoryIdx(
calib->categoryIdx),
68 void ProcNormalize::configure(ConfIterator iter,
unsigned int n) {
69 if (categoryIdx >= 0) {
70 if ((
int)
n < categoryIdx + 1)
75 }
else if (
n != maps.size())
80 if (categoryIdx ==
i++)
81 iter++(Variable::FLAG_NONE);
83 iter << iter++(Variable::FLAG_ALL);
87 void ProcNormalize::findMap(ValueIterator iter,
89 std::vector<Map>::const_iterator &begin,
90 std::vector<Map>::const_iterator &
end)
const {
91 if (categoryIdx >= 0) {
92 ValueIterator iter2 = iter;
93 for (
int i = 0;
i < categoryIdx;
i++)
106 begin = maps.begin();
111 void ProcNormalize::eval(ValueIterator iter,
unsigned int n)
const {
112 std::vector<Map>::const_iterator
map,
last;
115 for (
int i = 0;
map !=
last; ++iter,
i++) {
116 if (
i == categoryIdx)
129 std::vector<double> ProcNormalize::deriv(ValueIterator iter,
unsigned int n)
const {
130 std::vector<Map>::const_iterator
map,
last;
133 unsigned int size = 0;
134 for (ValueIterator iter2 = iter; iter2; ++iter2)
135 size += iter2.size();
140 for (
int i = 0;
map !=
last; ++iter,
i++) {
141 if (
i == categoryIdx) {
149 val =
map->spline.eval(
val) * (
map->spline.numberOfEntries() - 1) / (
map->width *
map->spline.getArea());