summaryrefslogtreecommitdiff
path: root/tools/dataProvider.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/dataProvider.h')
-rw-r--r--tools/dataProvider.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/tools/dataProvider.h b/tools/dataProvider.h
index 390432e..07f1989 100644
--- a/tools/dataProvider.h
+++ b/tools/dataProvider.h
@@ -144,13 +144,18 @@ public:
b=x%q;
double res = 0;
Eigen::VectorXd *id,*oth;
- id = &(uniq[a]->feature);
if (single)
+ {
+ id = &(uniq[a]->feature);
oth = &(other[b]->feature);
- else if (b<a)
- oth = &(all[b]->feature);
- else
- oth = &(all[b+1]->feature);
+ }
+ else {
+ id = &(all[a]->feature);
+ if (b<a)
+ oth = &(all[b]->feature);
+ else
+ oth = &(all[b+1]->feature);
+ }
for (int i=0;i<n;++i)
res += fabs((*id)[i] - (*oth)[i])*w[i];
return res;
@@ -161,13 +166,18 @@ public:
a=x/q;
b=x%q;
Eigen::VectorXd *id,*oth;
- id = &(uniq[a]->feature);
if (single)
+ {
+ id = &(uniq[a]->feature);
oth = &(other[b]->feature);
- else if (b<a)
- oth = &(all[b]->feature);
- else
- oth = &(all[b+1]->feature);
+ }
+ else {
+ id = &(all[a]->feature);
+ if (b<a)
+ oth = &(all[b]->feature);
+ else
+ oth = &(all[b+1]->feature);
+ }
for (int i=0;i<n;++i)
X[i] += fabs((*id)[i] - (*oth)[i])*w;
}