diff options
author | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2011-01-06 10:35:24 +0000 |
---|---|---|
committer | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2011-01-06 10:35:24 +0000 |
commit | d2de20ef215b386c7a4dbedc437a884595a909a3 (patch) | |
tree | f73e108ec8398f0ba32b71211ce0ae1979dd32e7 | |
parent | ecd625f55e583a1960f2fc82507132a05fc6fbc4 (diff) | |
download | opt-utilities-d2de20ef215b386c7a4dbedc437a884595a909a3.tar.bz2 |
Parallelized for the powell method
git-svn-id: file:///home/svn/opt_utilities@159 ed2142bd-67ad-457f-ba7c-d818d4011675
-rw-r--r-- | methods/linmin/linmin.hpp | 2 | ||||
-rw-r--r-- | methods/powell/powell_method.hpp | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/methods/linmin/linmin.hpp b/methods/linmin/linmin.hpp index ddf2a8e..9ec1dd8 100644 --- a/methods/linmin/linmin.hpp +++ b/methods/linmin/linmin.hpp @@ -53,6 +53,7 @@ namespace opt_utilities pT xt; opt_eq(xt,p1); +#pragma omp parallel for for(size_t i=0;i<get_size(xt);++i) { //get_element(xt,i)+=x*get_element((pT)xi1,i); @@ -88,6 +89,7 @@ namespace opt_utilities //cout<<xx<<endl; fret=brent(ax,xx,bx,fadpt,TOL,xmin); //cout<<xmin<<endl; +#pragma omp parallel for for(j=0;j<n;++j) { //get_element(xi,j)*=xmin; diff --git a/methods/powell/powell_method.hpp b/methods/powell/powell_method.hpp index 041fa93..294e101 100644 --- a/methods/powell/powell_method.hpp +++ b/methods/powell/powell_method.hpp @@ -116,6 +116,7 @@ namespace opt_utilities del=0.0; for(i=0;i<n;++i) { +#pragma omp parallel for for(j=0;j<n;++j) { //get_element(xit,j)=xi[j][i]; @@ -138,6 +139,7 @@ namespace opt_utilities std::cerr<<"powell exceeding maximun iterations."<<std::endl; return; } +#pragma omp parallel for for(j=0;j<n;++j) { //get_element(ptt,j)=T(2.)*get_element(p,j)-get_element(pt,j); @@ -155,6 +157,7 @@ namespace opt_utilities if(t<T(0.)) { linmin(p,xit,fret,*p_fo); +#pragma omp parallel for for(j=0;j<n;++j) { xi[j][ibig-1]=xi[j][n-1]; |