diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-05-25 13:06:27 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-05-25 13:06:27 +0800 |
commit | b86b167aae7d19bc8694d7ad21eae5b58cef81b7 (patch) | |
tree | 284af6015f6e8c75414533d33448a36bf9c7e4b4 | |
parent | 52b6b61d62b717b35af0c576733c7a305265c7d7 (diff) | |
download | ranksvm-b86b167aae7d19bc8694d7ad21eae5b58cef81b7.tar.gz ranksvm-b86b167aae7d19bc8694d7ad21eae5b58cef81b7.tar.bz2 ranksvm-b86b167aae7d19bc8694d7ad21eae5b58cef81b7.zip |
full pairs cont.
-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; }; |