From c69b39a9f149cc6b5c7270d7d864fb677bc83b34 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Mon, 11 May 2015 18:38:39 +0800 Subject: RidFile tested --- tools/dataProvider.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tools/dataProvider.h') diff --git a/tools/dataProvider.h b/tools/dataProvider.h index 1d430e4..028980e 100644 --- a/tools/dataProvider.h +++ b/tools/dataProvider.h @@ -40,7 +40,11 @@ public: DataEntry* dat = new DataEntry; dat->rank = d->rank; dat->qid = d->qid; - dat->feature = d->feature; + dat->feature.resize(d->feature.rows()); + for (int i=0;ifeature.rows();++i) + { + dat->feature(i)=d->feature(i); + } return dat; } inline std::vector& getData(){ @@ -59,7 +63,7 @@ public: DataProvider():eof(false){}; bool EOFile(){return eof;} - void getAllData(DataList &out){\ + void getAllDataSet(DataList &out){\ out.clear(); DataList buf; while (!EOFile()) @@ -68,9 +72,12 @@ public: // won't work as data are discarded with every call to getDataSet // out.getData().insert(out.getData().end(),buf.getData().begin(),buf.getData().end()); for (int i=0;i