From b15766bef024f086c51e56aa9af17783d3c1ff68 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Wed, 20 May 2015 16:59:50 +0800 Subject: speedup, internalize libop --- model/ranksvmtn.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'model/ranksvmtn.cpp') diff --git a/model/ranksvmtn.cpp b/model/ranksvmtn.cpp index 7f292f5..ba2d5a3 100644 --- a/model/ranksvmtn.cpp +++ b/model/ranksvmtn.cpp @@ -9,23 +9,26 @@ using namespace Eigen; void cal_Dw(RidList &D,const VectorXd &w, VectorXd &Dw) { int n = D.getSize(); - #pragma omp parallel for + // static chunk size of 1 to interleave the iterations + #pragma omp parallel for schedule(static,1) for (int i=0;i &rank,const VectorXd &corr,const VectorX else g+=Ds[rank[i+j]]; } - VectorXd tmp = alpha.cwiseProduct(Ds)-gamma; - VectorXd res = VectorXd::Zero(D.getSize()); + VectorXd tmp(n); + for (int i=0;i