Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
L
libpcma
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sbalzarini Lab
libpcma
Commits
c870b40a
Commit
c870b40a
authored
Nov 26, 2009
by
ofgeorg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the header in all files to the new group name and included all authors
changed filenames/subroutine names in the libcma folder
parent
9b419162
Changes
41
Show whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
221 additions
and
185 deletions
+221
-185
BBOB/BBOB.vcproj
BBOB/BBOB.vcproj
+1
-1
Libpcma.sln
Libpcma.sln
+1
-1
Libpcma.vfproj
Libpcma.vfproj
+54
-46
bfgs/lbfgs_nocedal.f
bfgs/lbfgs_nocedal.f
+1
-1
bfgs/lbfgsb_mod.f90
bfgs/lbfgsb_mod.f90
+10
-10
energy_landscapes/LJ/LJ_COMP.f90
energy_landscapes/LJ/LJ_COMP.f90
+1
-1
libcma/cma.f90
libcma/cma.f90
+4
-3
libcma/cmaes_checkparams.f90
libcma/cmaes_checkparams.f90
+5
-4
libcma/cmaes_freememory.f90
libcma/cmaes_freememory.f90
+4
-3
libcma/cmaes_funcwrap.f90
libcma/cmaes_funcwrap.f90
+4
-3
libcma/cmaes_handlebounds.f90
libcma/cmaes_handlebounds.f90
+4
-3
libcma/cmaes_init.f90
libcma/cmaes_init.f90
+6
-5
libcma/cmaes_initbounds.f90
libcma/cmaes_initbounds.f90
+4
-3
libcma/cmaes_initoutput.f90
libcma/cmaes_initoutput.f90
+4
-3
libcma/cmaes_mod.f90
libcma/cmaes_mod.f90
+6
-5
libcma/cmaes_myprctile.f90
libcma/cmaes_myprctile.f90
+4
-3
libcma/cmaes_opts_mod.f90
libcma/cmaes_opts_mod.f90
+4
-3
libcma/cmaes_out_mod.f90
libcma/cmaes_out_mod.f90
+4
-3
libcma/cmaes_param_mod.f90
libcma/cmaes_param_mod.f90
+4
-3
libcma/cmaes_readparams.f90
libcma/cmaes_readparams.f90
+2
-2
libcma/cmaes_run.f90
libcma/cmaes_run.f90
+22
-21
libcma/cmaes_run_mod.f90
libcma/cmaes_run_mod.f90
+8
-7
libcma/cmaes_start.f90
libcma/cmaes_start.f90
+7
-6
libcma/cmaes_startpoint.f90
libcma/cmaes_startpoint.f90
+4
-4
libcma/cmaes_writegen.f90
libcma/cmaes_writegen.f90
+4
-3
libcma/cmaes_xintobounds.f90
libcma/cmaes_xintobounds.f90
+4
-3
libcma/tool_create_rotmat.f90
libcma/tool_create_rotmat.f90
+4
-3
libcma/tool_create_rotmat_mod.f90
libcma/tool_create_rotmat_mod.f90
+4
-3
libcma/tool_eigendecomp.f90
libcma/tool_eigendecomp.f90
+4
-3
libcma/tool_eigendecomp_mod.f90
libcma/tool_eigendecomp_mod.f90
+4
-3
libcma/tool_formatarrays.f90
libcma/tool_formatarrays.f90
+4
-3
libcma/tool_mindist2lines.f90
libcma/tool_mindist2lines.f90
+4
-3
libcma/tool_myrange.f90
libcma/tool_myrange.f90
+4
-3
libcma/tool_realtxt2arr.f90
libcma/tool_realtxt2arr.f90
+4
-3
libcma/tool_symmatrix.f90
libcma/tool_symmatrix.f90
+4
-3
libcma/tool_symmatrix_mod.f90
libcma/tool_symmatrix_mod.f90
+4
-3
libqrng/qr_gen_mod.f90
libqrng/qr_gen_mod.f90
+1
-1
libtestfcns/CEC2005.f90
libtestfcns/CEC2005.f90
+1
-1
libtestfcns/DoubleFunnel.f90
libtestfcns/DoubleFunnel.f90
+1
-1
libtestfcns/benchmark_bobb.f90
libtestfcns/benchmark_bobb.f90
+1
-1
libtestfcns/random_landscape.f90
libtestfcns/random_landscape.f90
+1
-1
No files found.
BBOB/BBOB.vcproj
View file @
c870b40a
...
...
@@ -92,7 +92,7 @@
</Configuration>
<Configuration
Name=
"Debug|x64"
OutputDirectory=
"$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
OutputDirectory=
"$(SolutionDir)$
\
(PlatformName)\$(ConfigurationName)"
IntermediateDirectory=
"$(PlatformName)\$(ConfigurationName)"
ConfigurationType=
"1"
CharacterSet=
"1"
...
...
Libpcma.sln
View file @
c870b40a
...
...
@@ -61,7 +61,7 @@ Global
{351C4CC9-FB03-4476-A1CD-56A7E0709A31}.Debug Single Matlab|x64.ActiveCfg = Debug|x64
{351C4CC9-FB03-4476-A1CD-56A7E0709A31}.Debug|Win32.ActiveCfg = Debug|Win32
{351C4CC9-FB03-4476-A1CD-56A7E0709A31}.Debug|Win32.Build.0 = Debug|Win32
{351C4CC9-FB03-4476-A1CD-56A7E0709A31}.Debug|x64.ActiveCfg = Debug|
Win32
{351C4CC9-FB03-4476-A1CD-56A7E0709A31}.Debug|x64.ActiveCfg = Debug|
x64
{351C4CC9-FB03-4476-A1CD-56A7E0709A31}.DebugMPI|Win32.ActiveCfg = Debug|Win32
{351C4CC9-FB03-4476-A1CD-56A7E0709A31}.DebugMPI|Win32.Build.0 = Debug|Win32
{351C4CC9-FB03-4476-A1CD-56A7E0709A31}.DebugMPI|x64.ActiveCfg = Debug|Win32
...
...
Libpcma.vfproj
View file @
c870b40a
...
...
@@ -276,6 +276,31 @@
<Filter
Name=
"BFGS"
>
<File
RelativePath=
".\bfgs\lbfgs_nocedal.f"
/>
<File
RelativePath=
".\bfgs\lbfgsb_mod.f90"
/></Filter>
<Filter
Name=
"energy_landscapes"
>
<Filter
Name=
"LJ"
>
<File
RelativePath=
".\energy_landscapes\LJ\lj.f"
>
<FileConfiguration
Name=
"Debug Single Matlab|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration>
<FileConfiguration
Name=
"Release|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration>
<FileConfiguration
Name=
"Debug|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration>
<FileConfiguration
Name=
"DebugMPI|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration></File>
<File
RelativePath=
".\energy_landscapes\LJ\LJ_COMP.f90"
/>
<File
RelativePath=
".\energy_landscapes\LJ\LJ_POT.f90"
/>
<File
RelativePath=
".\energy_landscapes\LJ\lj_writeout.f90"
/></Filter>
<Filter
Name=
"TIPnP"
>
<File
RelativePath=
".\energy_landscapes\TIPnP\tip.f"
>
<FileConfiguration
Name=
"Debug Single Matlab|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration>
<FileConfiguration
Name=
"Release|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration>
<FileConfiguration
Name=
"Debug|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration>
<FileConfiguration
Name=
"DebugMPI|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration></File>
<File
RelativePath=
".\energy_landscapes\TIPnP\water_writeout.f90"
/></Filter></Filter>
<Filter
Name=
"libCMA"
>
<Filter
Name=
"matlab"
>
<File
RelativePath=
".\libcma\matlab\cma2mat.f90"
>
...
...
@@ -307,39 +332,38 @@
<File
RelativePath=
".\libcma\mpi\psoUpdate.f90"
>
<FileConfiguration
Name=
"Debug Single Matlab|x64"
ExcludedFromBuild=
"true"
/>
<FileConfiguration
Name=
"Debug|x64"
ExcludedFromBuild=
"true"
/></File></Filter>
<File
RelativePath=
".\libcma\cmaes_checkparams.f90"
/>
<File
RelativePath=
".\libcma\cmaes_freememory.f90"
/>
<File
RelativePath=
".\libcma\cmaes_funcwrap.f90"
/>
<File
RelativePath=
".\libcma\cmaes_handlebounds.f90"
/>
<File
RelativePath=
".\libcma\cmaes_init.f90"
/>
<File
RelativePath=
".\libcma\cmaes_initbounds.f90"
/>
<File
RelativePath=
".\libcma\cmaes_initoutput.f90"
/>
<File
RelativePath=
".\libcma\cmaes_mod.f90"
/>
<File
RelativePath=
".\libcma\cmaes_myprctile.f90"
/>
<File
RelativePath=
".\libcma\cmaes_opts_mod.f90"
/>
<File
RelativePath=
".\libcma\cmaes_out_mod.f90"
/>
<File
RelativePath=
".\libcma\cmaes_param_mod.f90"
/>
<File
RelativePath=
".\libcma\cmaes_params.txt"
/>
<File
RelativePath=
".\libcma\cmaes_readparams.f90"
/>
<File
RelativePath=
".\libcma\cmaes_Startpoint.f90"
/>
<File
RelativePath=
".\libcma\cmaesCheck.f90"
/>
<File
RelativePath=
".\libcma\cmaesInit.f90"
/>
<File
RelativePath=
".\libcma\cmaesOpts_mod.f90"
/>
<File
RelativePath=
".\libcma\cmaesOut_mod.f90"
/>
<File
RelativePath=
".\libcma\cmaesRun.f90"
/>
<File
RelativePath=
".\libcma\cmaesRun_mod.f90"
/>
<File
RelativePath=
".\libcma\cmaesStart.f90"
/>
<File
RelativePath=
".\libcma\createR.f90"
/>
<File
RelativePath=
".\libcma\createR_mod.f90"
/>
<File
RelativePath=
".\libcma\eigenDecomp.f90"
/>
<File
RelativePath=
".\libcma\eigenDecomp_mod.f90"
/>
<File
RelativePath=
".\libcma\formatArrays.f90"
/>
<File
RelativePath=
".\libcma\freeMemory.f90"
/>
<File
RelativePath=
".\libcma\funcWrap.f90"
/>
<File
RelativePath=
".\libcma\handleBounds.f90"
/>
<File
RelativePath=
".\libcma\initBounds.f90"
/>
<File
RelativePath=
".\libcma\initOutput.f90"
/>
<File
RelativePath=
".\libcma\m_mrgrnk.f90"
/>
<File
RelativePath=
".\libcma\main_cma.f90"
/>
<File
RelativePath=
".\libcma\mindist2lines.f90"
/>
<File
RelativePath=
".\libcma\cmaes_run.f90"
/>
<File
RelativePath=
".\libcma\cmaes_run_mod.f90"
/>
<File
RelativePath=
".\libcma\cmaes_start.f90"
/>
<File
RelativePath=
".\libcma\cmaes_startpoint.f90"
/>
<File
RelativePath=
".\libcma\cmaes_writegen.f90"
/>
<File
RelativePath=
".\libcma\cmaes_xintobounds.f90"
/>
<File
RelativePath=
".\libcma\cma.f90"
/>
<File
RelativePath=
".\libcma\mpi_mod.f90"
/>
<File
RelativePath=
".\libcma\myprctile.f90"
/>
<File
RelativePath=
".\libcma\myrange.f90"
/>
<File
RelativePath=
".\libcma\realtxt2Arr.f90"
/>
<File
RelativePath=
".\libcma\symMatrix.f90"
/>
<File
RelativePath=
".\libcma\symMatrix_mod.f90"
/>
<File
RelativePath=
".\libcma\writeGen.f90"
/>
<File
RelativePath=
".\libcma\xIntoBounds.f90"
/></Filter>
<File
RelativePath=
".\libcma\tool_create_rotmat.f90"
/>
<File
RelativePath=
".\libcma\tool_create_rotmat_mod.f90"
/>
<File
RelativePath=
".\libcma\tool_eigendecomp.f90"
/>
<File
RelativePath=
".\libcma\tool_eigendecomp_mod.f90"
/>
<File
RelativePath=
".\libcma\tool_formatarrays.f90"
/>
<File
RelativePath=
".\libcma\tool_mindist2lines.f90"
/>
<File
RelativePath=
".\libcma\tool_mrgrnk_mod.f90"
/>
<File
RelativePath=
".\libcma\tool_myrange.f90"
/>
<File
RelativePath=
".\libcma\tool_realtxt2arr.f90"
/>
<File
RelativePath=
".\libcma\tool_symmatrix.f90"
/>
<File
RelativePath=
".\libcma\tool_symmatrix_mod.f90"
/></Filter>
<Filter
Name=
"libtestfcns"
>
<Filter
Name=
"BOBB objects"
>
<File
RelativePath=
".\BBOB\x64\Debug\benchmarks.obj"
>
...
...
@@ -368,22 +392,6 @@
<File
RelativePath=
".\libtestfcns\random_landscape.f90"
/>
<File
RelativePath=
".\libtestfcns\testCEC2005.f90"
>
<FileConfiguration
Name=
"Debug|x64"
ExcludedFromBuild=
"true"
/></File></Filter>
<Filter
Name=
"Potential Energy Landscapes"
>
<Filter
Name=
"LJ"
>
<File
RelativePath=
".\Potential_Energy_Landscapes\LJ\lj.f"
>
<FileConfiguration
Name=
"Debug Single Matlab|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration></File>
<File
RelativePath=
".\Potential_Energy_Landscapes\LJ\LJ_COMP.f90"
/>
<File
RelativePath=
".\Potential_Energy_Landscapes\LJ\LJ_POT.f90"
/>
<File
RelativePath=
".\Potential_Energy_Landscapes\LJ\lj_writeout.f90"
/></Filter>
<Filter
Name=
"water"
>
<File
RelativePath=
".\Potential_Energy_Landscapes\Water\rigidfuncs.f"
>
<FileConfiguration
Name=
"Debug Single Matlab|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration></File>
<File
RelativePath=
".\Potential_Energy_Landscapes\Water\tip.f"
>
<FileConfiguration
Name=
"Debug Single Matlab|x64"
>
<Tool
Name=
"VFFortranCompilerTool"
FixedFormLineLength=
"fixedLength132"
/></FileConfiguration></File>
<File
RelativePath=
".\Potential_Energy_Landscapes\Water\water_writeout.f90"
/></Filter></Filter>
<Filter
Name=
"Random Numbers"
>
<File
RelativePath=
".\libqrng\faure.f90"
/>
<File
RelativePath=
".\libqrng\halton.f90"
/>
...
...
@@ -394,5 +402,5 @@
<File
RelativePath=
".\libqrng\randomGenerator.f"
/>
<File
RelativePath=
".\libqrng\sobol.f90"
/></Filter></Filter>
<File
RelativePath=
".\make_brutus.inc"
/>
<File
RelativePath=
".\makefile
.txt
"
/></Files>
<File
RelativePath=
".\makefile"
/></Files>
<Globals/></VisualStudioProject>
bfgs/lbfgs_nocedal.f
View file @
c870b40a
...
...
@@ -8,7 +8,7 @@ C
SUBROUTINE
LBFGS
(
N
,
M
,
X
,
F
,
G
,
DIAGCO
,
DIAG
,
IPRINT
,
EPS
,
XTOL
,
W
,
IFLAG
,
.
DGUESS
,
STEPMAX
)
C
USE
cmaes
O
pts_mod
USE
cmaes
_o
pts_mod
INTEGER
N
,
M
,
IPRINT
(
2
),
IFLAG
DOUBLE PRECISION
X
(
N
),
G
(
N
),
DIAG
(
N
),
W
(
N
*
(
2
*
M
+1
)
+2
*
M
)
...
...
bfgs/lbfgsb_mod.f90
View file @
c870b40a
...
...
@@ -22,7 +22,7 @@
MODULE
lbfgsb_mod
USE
cmaes_param_mod
USE
cmaes
O
pts_mod
USE
cmaes
_o
pts_mod
USE
cmaes_mod
USE
CEC2005
! USE deriv_class
...
...
@@ -78,7 +78,7 @@
INTEGER
::
iflag
REAL
(
MK
),
DIMENSION
(
n
*
(
2
*
m
+1
)
+2
*
m
)
::
W
INTEGER
,
DIMENSION
(
2
)
::
iprint
REAL
(
MK
)
::
funcW
rap
REAL
(
MK
)
::
cmaes_funcw
rap
!INTEGER,SAVE :: test = 0
REAL
(
MK
)
::
dguess
iprint
=
options
%
BFGS_print
...
...
@@ -110,10 +110,10 @@
IF
(
options
%
Benchfctnr
.EQ.
9
)
THEN
CALL
F09_grad
(
g
,
x
,
n
,
n
,
options
%
LBounds
,
options
%
UBounds
)
!gradient
!CALL my_grad_approx(n,x,fcn,f,g1) !otherwise approximate the Gradient
f
=
funcW
rap
(
x
,
n
,
fcn
)
f
=
cmaes_funcw
rap
(
x
,
n
,
fcn
)
countBFGSEval
=
countBFGSEval
+
1
ELSE
f
=
funcW
rap
(
x
,
n
,
fcn
)
f
=
cmaes_funcw
rap
(
x
,
n
,
fcn
)
countBFGSEval
=
countBFGSEval
+
1
CALL
my_grad_approx
(
n
,
x
,
fcn
,
f
,
g
)
!otherwise approximate the Gradient
...
...
@@ -145,7 +145,7 @@
!local vars
REAL
(
MK
)
::
funcW
rap
REAL
(
MK
)
::
cmaes_funcw
rap
INTEGER
::
i
REAL
(
MK
)
::
f_plus
,
f_minus
...
...
@@ -154,10 +154,10 @@
DO
i
=
1
,
n
xtmp
=
x
xtmp
(
i
)
=
xtmp
(
i
)
+
options
%
BFGS_grad_stepsize
/
2
f_plus
=
funcW
rap
(
xtmp
,
n
,
fcn
)
f_plus
=
cmaes_funcw
rap
(
xtmp
,
n
,
fcn
)
countBFGSEval
=
countBFGSEval
+
1
xtmp
(
i
)
=
xtmp
(
i
)
-
options
%
BFGS_grad_stepsize
f_minus
=
funcW
rap
(
xtmp
,
n
,
fcn
)
f_minus
=
cmaes_funcw
rap
(
xtmp
,
n
,
fcn
)
countBFGSEval
=
countBFGSEval
+
1
g
(
i
)
=
(
f_plus
-
f_minus
)/
options
%
BFGS_grad_stepsize
END
DO
...
...
@@ -166,7 +166,7 @@
xtmp
=
x
xtmp
(
i
)
=
xtmp
(
i
)
+
options
%
BFGS_grad_stepsize
countBFGSEval
=
countBFGSEval
+
1
f_plus
=
funcW
rap
(
xtmp
,
n
,
fcn
)
f_plus
=
cmaes_funcw
rap
(
xtmp
,
n
,
fcn
)
countBFGSEval
=
countBFGSEval
+
1
g
(
i
)
=
(
f_plus
-
f
)/
options
%
BFGS_grad_stepsize
END
DO
...
...
@@ -187,13 +187,13 @@
INTEGER
::
n
REAL
(
MK
),
DIMENSION
(
n
)
::
x
REAL
(
MK
)
::
f
REAL
(
MK
)
::
funcW
rap
REAL
(
MK
)
::
cmaes_funcw
rap
EXTERNAL
::
fcn
f
=
funcW
rap
(
x
,
n
,
fcn
)
f
=
cmaes_funcw
rap
(
x
,
n
,
fcn
)
...
...
energy_landscapes/LJ/LJ_COMP.f90
View file @
c870b40a
SUBROUTINE
LJ_POT_COMP
(
res
,
vars
,
m
,
n
,
lbounds
,
ubounds
)
USE
cmaes_param_mod
USE
cmaes
O
pts_mod
USE
cmaes
_o
pts_mod
!Parameters
REAL
(
MK
),
DIMENSION
(
n
),
INTENT
(
out
)
::
res
REAL
(
MK
),
DIMENSION
(
m
,
n
),
INTENT
(
in
)
::
vars
...
...
libcma/cma.f90
View file @
c870b40a
...
...
@@ -11,9 +11,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner, Christian L. Mueller
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck, Christian L. Mueller
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
PROGRAM
cma
...
...
libcma/cmaes_checkparams.f90
View file @
c870b40a
...
...
@@ -12,16 +12,17 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
SUBROUTINE
cmaes_checkparams
()
!-------------------------------------------------------------------------
! Modules
!-------------------------------------------------------------------------
USE
cmaes_mod
USE
cmaes
O
pts_mod
USE
cmaes
_o
pts_mod
IMPLICIT
NONE
!-------------------------------------------------------------------------
! Local Variables
...
...
libcma/cmaes_freememory.f90
View file @
c870b40a
...
...
@@ -11,9 +11,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
SUBROUTINE
cmaes_freememory
()
!-------------------------------------------------------------------------
...
...
libcma/cmaes_funcwrap.f90
View file @
c870b40a
...
...
@@ -19,9 +19,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
#ifdef __SP
REAL
FUNCTION
cmaes_funcwrap
(
x
,
N
,
fitfun
)
...
...
libcma/cmaes_handlebounds.f90
View file @
c870b40a
...
...
@@ -27,9 +27,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
SUBROUTINE
cmaes_handlebounds
(
arxvalid
,
arx
,
m
,
n
)
!-------------------------------------------------------------------------
...
...
libcma/cmaes_init.f90
View file @
c870b40a
...
...
@@ -11,9 +11,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
SUBROUTINE
cmaes_init
!-------------------------------------------------------------------------
...
...
@@ -21,7 +22,7 @@
!-------------------------------------------------------------------------
USE
cmaes_param_mod
USE
cmaes_mod
USE
cmaes
O
pts_mod
USE
cmaes
_o
pts_mod
IMPLICIT
NONE
!-------------------------------------------------------------------------
! Local variables
...
...
@@ -92,7 +93,7 @@
weights
(
i
)
=
log
(
REAL
(
mu
)
+1.
)
-
log
(
REAL
(
i
))
END
DO
ELSE
STOP
'RecombinationWeights not set correctly (see cmaes
O
pts_mod)'
STOP
'RecombinationWeights not set correctly (see cmaes
_o
pts_mod)'
END
IF
! mueff
...
...
libcma/cmaes_initbounds.f90
View file @
c870b40a
...
...
@@ -15,9 +15,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
SUBROUTINE
cmaes_initbounds
()
!-------------------------------------------------------------------------
...
...
libcma/cmaes_initoutput.f90
View file @
c870b40a
...
...
@@ -12,9 +12,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
SUBROUTINE
cmaes_initoutput
(
fitfun
)
USE
cmaes_param_mod
...
...
libcma/cmaes_mod.f90
View file @
c870b40a
...
...
@@ -12,13 +12,14 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
MODULE
cmaes_mod
USE
cmaes_param_mod
USE
eigenD
ecomp_mod
USE
tool_eigend
ecomp_mod
IMPLICIT
NONE
SAVE
...
...
@@ -135,7 +136,7 @@
! Module Procedures
!-----------------------------------------------------------------------
! CONTAINS
!#include "
xIntoB
ounds.f90"
!#include "
cmaes_xintob
ounds.f90"
END
MODULE
cmaes_mod
\ No newline at end of file
libcma/cmaes_myprctile.f90
View file @
c870b40a
...
...
@@ -21,9 +21,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
SUBROUTINE
cmaes_myprctile
(
inar
,
N
,
perc
,
rN
,
res
)
USE
cmaes_param_mod
...
...
libcma/cmaes_opts_mod.f90
View file @
c870b40a
...
...
@@ -18,9 +18,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
MODULE
cmaes_opts_mod
USE
cmaes_param_mod
...
...
libcma/cmaes_out_mod.f90
View file @
c870b40a
...
...
@@ -12,9 +12,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
MODULE
cmaes_out_mod
USE
cmaes_param_mod
...
...
libcma/cmaes_param_mod.f90
View file @
c870b40a
...
...
@@ -12,9 +12,10 @@
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
MODULE
cmaes_param_mod
IMPLICIT
NONE
...
...
libcma/cmaes_readparams.f90
View file @
c870b40a
...
...
@@ -13,7 +13,7 @@
!-------------------------------------------------------------------------
SUBROUTINE
cmaes_readparams
(
ctrlfile
,
info
)
USE
cmaes
O
pts_mod
USE
cmaes
_o
pts_mod
USE
CEC2005
IMPLICIT
NONE
#ifdef __HAVE_MPI__
...
...
@@ -499,7 +499,7 @@
!-----------------------------------------------------------------------------
! Set the inital Starting Point
!-----------------------------------------------------------------------------
CALL
cmaes_
S
tartpoint
()
CALL
cmaes_
s
tartpoint
()
...
...
libcma/cmaes_run.f90
View file @
c870b40a
...
...
@@ -16,9 +16,10 @@
! Revisions :
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Covariance Matrix Adaption Library (LIBCMA)
! Benedikt Baumgartner
! Computational Biophysics Lab, ETH Zurich, Switzerland
! pCMALib: a parallel fortran 90 library for the evolution strategy with
! covariance matrix adaptation
! Christian L. Mueller, Benedikt Baumgartner, Georg Ofenbeck
! MOSAIC group, ETH Zurich, Switzerland
!-------------------------------------------------------------------------
SUBROUTINE
cmaes_run
(
fitfun
)
!-------------------------------------------------------------------------
...
...
@@ -36,7 +37,7 @@
! Interfaces
!-------------------------------------------------------------------------
INTERFACE
SUBROUTINE
xIntoB
ounds
(
LBounds
,
UBounds
,
N
,
x
,
xout
,
idx
)
SUBROUTINE
cmaes_xintob
ounds
(
LBounds
,
UBounds
,
N
,
x
,
xout
,
idx
)
USE
cmaes_param_mod
USE
cmaes_mod
,
only
:
countOutOfBounds
IMPLICIT
NONE
...
...
@@ -58,8 +59,8 @@
!-------------------------------------------------------------------------
REAL
(
MK
)
::
ZBQLNOR
!RNG
!REAL(MK) :: ZBQLU01
REAL
(
MK
)
::
funcW
rap
REAL
(
MK
)
::
myrange
REAL
(
MK
)
::
cmaes_funcw
rap
REAL
(
MK
)
::
tool_
myrange
!-------------------------------------------------------------------------
! Local Variables
!-------------------------------------------------------------------------
...
...
@@ -352,9 +353,9 @@
!-------------------------------------------------------------------------
IF
(
options
%
flgGenData
)
THEN
#ifdef __HAVE_MPI__
CALL
writeG
en
(
arx
,
arxvalid
,
GLOBAL_X_BEST
,
input
%
N
,
lambda
,
uNum
)
CALL
cmaes_writeg
en
(
arx
,
arxvalid
,
GLOBAL_X_BEST
,
input
%
N
,
lambda
,
uNum
)
#else
CALL
writeG
en
(
arx
,
arxvalid
,
input
%
N
,
lambda
,
uNum
)
CALL
cmaes_writeg
en
(
arx
,
arxvalid
,
input
%
N
,
lambda
,
uNum
)
#endif
END
IF
...
...
@@ -447,7 +448,7 @@
! Check if sample point is valid (within given bounds)
!-------------------------------------------------------------------
IF
(
bnd
%
isactive
)
THEN
CALL
xIntoB
ounds
(
options
%
LBounds
,
options
%
UBounds
,&
CALL
cmaes_xintob
ounds
(
options
%
LBounds
,
options
%
UBounds
,&
input
%
N
,
arx
(:,
k
),
arxvalid
(:,
k
))
ELSE
arxvalid
(:,
k
)
=
arx
(:,
k
)
...
...
@@ -472,7 +473,7 @@
!-------------------------------------------------------------------
! Otherwise Evaluate function at valid sample point
!-------------------------------------------------------------------
fitness
%
raw
(
k
)
=
funcW
rap
(
arxvalid
(:,
k
),
input
%
N
,
fitfun
)
fitness
%
raw
(
k
)
=
cmaes_funcw
rap
(
arxvalid
(:,
k
),
input
%
N
,
fitfun
)
END
IF
tries
=
tries
+
1
!WRITE(*,*) 'fitness%raw: ', fitness%raw(k)
...
...
@@ -585,7 +586,7 @@
!------------------------------------------------------------------------
! Handle boundaries
!------------------------------------------------------------------------
IF
(
bnd
%
isactive
)
CALL
handleB
ounds
(
arxvalid
,
arx
,
input
%
N
,
lambda
)
IF
(
bnd
%
isactive
)
CALL
cmaes_handleb
ounds
(
arxvalid
,
arx
,
input
%
N
,
lambda
)
!-------------------------------------------------------------------------
! Sort by fitness (idx/idxsel being indices indicating orig. positions)
...
...
@@ -789,7 +790,7 @@
!-----------------------------------------------------------------------
! Enforce symmetry
!-----------------------------------------------------------------------
CALL
symM
atrix
(
C
,
input
%
N
,
triuC
)
CALL
tool_symm
atrix
(
C
,
input
%
N
,
triuC
)
...
...
@@ -797,9 +798,9 @@
! Eigen decomposition, D=diagonal matrix of eigenvalues,
! B=normalized eigenvectors
!-----------------------------------------------------------------------
CALL
eigenD
ecomp
(
triuC
,
input
%
N
,
D
,
B
,
info
)
CALL
tool_eigend
ecomp
(
triuC
,
input
%
N
,
D
,
B
,
info
)
!if
eigenD
ecomp returned Error go to the Restart Loop
!if
tool_eigend
ecomp returned Error go to the Restart Loop
IF
(
info
.NE.
0
)
THEN
stopflag
=
'DeComp Error'
!STOP
...
...
@@ -976,7 +977,7 @@
!-------------------------------------------------------------------------
! Adjust step size in case of equal function values
!-------------------------------------------------------------------------
temp
=
myrange
(
fitness
%
hist
,
size
(
fitness
%
hist
),
fitness
%
sel
(
1
),
1
,
posInf
)
temp
=
tool_
myrange
(
fitness
%
hist
,
size
(
fitness
%
hist
),
fitness
%
sel
(
1
),
1
,
posInf
)
IF
((
countIter
-
lastRestart
.GT.
2
)
.AND.
(
temp
.EQ.
0.
))
THEN
IF
(
options
%
stopOnWarnings
)
THEN
stopflag
=
'warnequalfunvalhist'
...
...
@@ -1042,13 +1043,13 @@
IF
(
any
(
sigma
*
sqrt
(
diag
)
.GT.
options
%
StopTolUpX
))
stopflag
=
'tolupx'
IF
((
countIter
-
lastRestart
.GT.
2
)
.AND.
&
(
myrange
(
fitness
%
sel
,
size
(
fitness
%
sel
),
fitness
%
hist
,&
(
tool_
myrange
(
fitness
%
sel
,
size
(
fitness
%
sel
),
fitness
%
hist
,&
size
(
fitness
%
hist
),
posInf
)
.LE.
options
%
StopTolFun
))
&
stopflag
=
'tolfun'
IF
((
countIter
-
lastRestart
.GE.
size
(
fitness
%
hist
))
.AND.
&
(
myrange
(
fitness
%
hist
,
size
(
fitness
%
hist
),
posInf_array
,
1
,
posInf
)
&
(
tool_
myrange
(
fitness
%
hist
,
size
(
fitness
%
hist
),
posInf_array
,
1
,
posInf
)
&
.LE.
options
%
StopTolHistFun
))
THEN
stopflag
=
'tolhistfun'
END
IF
...
...
@@ -1073,9 +1074,9 @@
!-------------------------------------------------------------------------
IF
(
options
%
flgGenData
.AND.
(
mod
(
countIter
,
options
%
intGenData
))
.EQ.
0
)
THEN
#ifdef __HAVE_MPI__
CALL
writeG
en
(
arx
,
arxvalid
,
GLOBAL_X_BEST
,
input
%
N
,
lambda
,
uNum
)
CALL
cmaes_writeg
en
(
arx
,
arxvalid
,
GLOBAL_X_BEST
,
input
%
N
,
lambda
,
uNum
)
#else
CALL
writeG
en
(
arx
,
arxvalid
,
input
%
N
,
lambda
,
uNum
)
CALL
cmaes_writeg
en
(
arx
,
arxvalid
,
input
%
N
,
lambda
,
uNum
)
#endif
END
IF
...
...
@@ -1181,7 +1182,7 @@
IF
(
stop_me
)
THEN
! Close MATLAB engine if used
IF
(
options
%
matlab_func
)
THEN
temp
=
funcW
rap
(
arxvalid
(:,
1
),
-1
,
fitfun
)
temp
=
cmaes_funcw
rap
(
arxvalid
(:,
1
),
-1
,
fitfun
)
ENDIF
EXIT
genLoop
ENDIF
...
...
@@ -1303,7 +1304,7 @@
IF
(
MY_RANK
.EQ.
0
)
THEN
#endif