From e5d8fe50719f61138a21a568da9b06532a42dd5b Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 7 Feb 2017 13:17:45 +0800 Subject: Handle #pragma omp warning when not give -fopenmp --- methods/linmin/linmin.hpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'methods/linmin') diff --git a/methods/linmin/linmin.hpp b/methods/linmin/linmin.hpp index fe5e58c..b542fba 100644 --- a/methods/linmin/linmin.hpp +++ b/methods/linmin/linmin.hpp @@ -26,19 +26,19 @@ namespace opt_utilities func_adaptor(const func_adaptor&) :func_obj(),p1(),xi1(),pfoo(NULL_PTR) {} - + public: /* void set_origin(pT& p2) { p1=p2; } - + void set_direction(pT& xi2) { xi1=xi2; } - + void set_func_obj(func_obj& foo) { pfoo=&foo; @@ -47,20 +47,22 @@ namespace opt_utilities func_adaptor(const pT& _p,const pT& _xi,const func_obj& pf) :p1(_p),xi1(_xi),pfoo(&pf) {} - + private: func_obj* do_clone()const { return new func_adaptor(*this); } - + rT do_eval(const rT& x) { //assert(p1.size()==xi1.size()); - + pT xt; opt_eq(xt,p1); -#pragma omp parallel for +#ifdef _OPENMP +#pragma omp parallel for +#endif for(size_t i=0;i void linmin(pT& p,pT& xi,rT& fret,func_obj& func) @@ -90,13 +92,15 @@ namespace opt_utilities ax=0.; xx=1.; - + mnbrak(ax,xx,bx,fa,fx,fb,fadpt); //cout<