From b86b167aae7d19bc8694d7ad21eae5b58cef81b7 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Mon, 25 May 2015 13:06:27 +0800 Subject: full pairs cont. --- tools/dataProvider.h | 17 +++++++++++------ 1 file 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 (bfeature); - else - oth = &(all[b+1]->feature); + } + else { + id = &(all[a]->feature); + if (bfeature); + 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; }; -- cgit v1.2.3-70-g09d2