From 17be62773adb99fc3fac11c13b3f7cd8bf5f2258 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Sun, 31 May 2015 23:47:10 +0800 Subject: misc --- tools/dataProvider.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tools') diff --git a/tools/dataProvider.h b/tools/dataProvider.h index 47946c8..65a6b63 100644 --- a/tools/dataProvider.h +++ b/tools/dataProvider.h @@ -128,6 +128,28 @@ public: { return getuSize()*getqSize(); } + inline double getBha(int x){ + int a,b,q=getqSize(); + a=x/q; + b=x%q; + double res = 0; + Eigen::VectorXd *id,*oth; + if (single) + { + id = &(uniq[a]->feature); + oth = &(other[b]->feature); + } + else { + id = &(all[a]->feature); + if (bfeature); + else + oth = &(all[b+1]->feature); + } + for (int i=0;i