From def2bcd3f41a36e52b179aa435c5bf29c94dab5e Mon Sep 17 00:00:00 2001
From: Joe Zhao <ztuowen@gmail.com>
Date: Mon, 18 May 2015 22:22:11 +0800
Subject: added openmp directive

---
 train.cpp | 29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

(limited to 'train.cpp')

diff --git a/train.cpp b/train.cpp
index 039c93a..0b5b4d4 100644
--- a/train.cpp
+++ b/train.cpp
@@ -43,7 +43,7 @@ int predict(DataProvider &dp) {
     rsvm = RSVM::loadModel(vm["model"].as<string>().c_str());
 
     dp.open();
-    DataList D;
+    RidList D;
     vector<double> L;
     CMC cmc;
     LOG(INFO)<<"Prediction started";
@@ -59,24 +59,21 @@ int predict(DataProvider &dp) {
     else
         ot=&cout;
 
-    while (!dp.EOFile())
-    {
-        dp.getDataSet(D);
-        LOG(INFO)<<"Read "<<D.getSize()<<" entries with "<< D.getfSize()<<" features";
-        rsvm->predict(D,L);
-
-        if (vm.count("validate"))
-        {
-            rank_accu(D,L);
-            if (vm.count("cmc"))
-                rank_CMC(D,L,cmc);
-        }
+    dp.getAllDataSet(D);
+    LOG(INFO)<<"Read "<<D.getSize()<<" entries with "<< D.getfSize()<<" features";
+    rsvm->predict(D,L);
 
-        if (vm.count("output") && vm.count("predict"))
-            for (int i=0; i<L.size();++i)
-                *ot<<L[i]<<endl;
+    if (vm.count("validate"))
+    {
+        rank_accu(D,L);
+        if (vm.count("cmc"))
+            rank_CMC(D,L,cmc);
     }
 
+    if (vm.count("output") && vm.count("predict"))
+        for (int i=0; i<L.size();++i)
+            *ot<<L[i]<<endl;
+
     LOG(INFO)<<"Finished";
     if (vm.count("cmc"))
     {
-- 
cgit v1.2.3-70-g09d2