From def2bcd3f41a36e52b179aa435c5bf29c94dab5e Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Mon, 18 May 2015 22:22:11 +0800 Subject: added openmp directive --- tools/dataProvider.h | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'tools') diff --git a/tools/dataProvider.h b/tools/dataProvider.h index 586965e..59b989a 100644 --- a/tools/dataProvider.h +++ b/tools/dataProvider.h @@ -82,9 +82,23 @@ public: else uniq.push_back(d); } + inline DataEntry* getU(int x) + { + return uniq[x]; + } + inline DataEntry* getO(int x) + { + return other[x]; + } + inline std::string getQid(int x) + { + int a,b,n=getqSize(); + a=x/n; + return getU(a)->qid; + } inline int getqSize() { - return (int)(uniq.size()+other.size()-1); + return (int)other.size(); } inline int getuSize() { @@ -99,24 +113,14 @@ public: a=x/n; b=x%n; Eigen::VectorXd vec; - 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(); + return (uniq[a]->feature-other[b]->feature).cwiseAbs(); }; inline double getL(int x){ int a,b,n=getqSize(); a=x/n; b=x%n; - if (brank - a) < 1e-5) - return 1; + if (std::fabs(other[b]->rank - a) < 1e-5) + return 1; return -1; }; }; -- cgit v1.2.3-70-g09d2