diff options
-rw-r--r-- | tools/dataProvider.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/dataProvider.h b/tools/dataProvider.h index 07f1989..9682649 100644 --- a/tools/dataProvider.h +++ b/tools/dataProvider.h @@ -128,13 +128,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); + } return (*id-*oth).cwiseAbs(); }; inline double getVecDot(int x,const Eigen::VectorXd &w) @@ -197,7 +202,7 @@ public: oth = all[b]->rank; else oth = all[b+1]->rank; - if (fabs(oth - id) < 1e-5) + if (std::fabs(oth - id) < 1e-5) return 1; return -1; }; |