From b29d766bb0c3d2e5839164ef6cd316b2e00fba62 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Tue, 2 Jun 2015 11:42:43 +0800 Subject: added avg for cmc auditing --- model/rankaccu.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'model') diff --git a/model/rankaccu.h b/model/rankaccu.h index 832a9f5..e8da882 100644 --- a/model/rankaccu.h +++ b/model/rankaccu.h @@ -15,10 +15,11 @@ class CMC private: std::vector acc; int cnt; + double sum; public: - void clear(){for (int i=0;i getAcc() { std::vector res; res.reserve(CMC_MAX); @@ -34,6 +35,10 @@ public: { return cnt; } + double getAvg() + { + return sum/cnt; + } }; void rank_CMC(RidList &D,const std::vector pred,CMC & cmc); -- cgit v1.2.3-70-g09d2