From 1f53fe7adbb14e71d1c41459a8e4b579ef43559c Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Mon, 18 May 2015 22:25:58 +0800 Subject: revert --- tools/dataProvider.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/dataProvider.h b/tools/dataProvider.h index 59b989a..bf47856 100644 --- a/tools/dataProvider.h +++ b/tools/dataProvider.h @@ -98,7 +98,7 @@ public: } inline int getqSize() { - return (int)other.size(); + return (int)(uniq.size()+other.size()-1); } inline int getuSize() { @@ -113,13 +113,23 @@ public: a=x/n; b=x%n; Eigen::VectorXd vec; - return (uniq[a]->feature-other[b]->feature).cwiseAbs(); + if (bfeature-uniq[b]->feature; + else + if (bfeature-uniq[b+1]->feature; + else + vec=uniq[a]->feature-other[b-uniq.size()+1]->feature; + return vec.cwiseAbs(); }; inline double getL(int x){ int a,b,n=getqSize(); a=x/n; b=x%n; - if (std::fabs(other[b]->rank - a) < 1e-5) + if (brank - a) < 1e-5) return 1; return -1; }; -- cgit v1.2.3-70-g09d2