hillclimber 0.1.6__cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (475) hide show
  1. hillclimber/__init__.py +41 -0
  2. hillclimber/actions.py +53 -0
  3. hillclimber/analysis.py +590 -0
  4. hillclimber/biases.py +293 -0
  5. hillclimber/calc.py +22 -0
  6. hillclimber/cvs.py +1070 -0
  7. hillclimber/interfaces.py +133 -0
  8. hillclimber/metadynamics.py +416 -0
  9. hillclimber/nodes.py +6 -0
  10. hillclimber/opes.py +359 -0
  11. hillclimber/pycv.py +362 -0
  12. hillclimber/selectors.py +230 -0
  13. hillclimber/virtual_atoms.py +341 -0
  14. hillclimber-0.1.6.dist-info/METADATA +325 -0
  15. hillclimber-0.1.6.dist-info/RECORD +475 -0
  16. hillclimber-0.1.6.dist-info/WHEEL +6 -0
  17. hillclimber-0.1.6.dist-info/entry_points.txt +8 -0
  18. hillclimber-0.1.6.dist-info/licenses/LICENSE +165 -0
  19. hillclimber-0.1.6.dist-info/sboms/auditwheel.cdx.json +1 -0
  20. hillclimber.libs/libgomp-a49a47f9.so.1.0.0 +0 -0
  21. plumed/__init__.py +104 -0
  22. plumed/_lib/bin/plumed +0 -0
  23. plumed/_lib/bin/plumed-config +9 -0
  24. plumed/_lib/bin/plumed-patch +9 -0
  25. plumed/_lib/include/plumed/adjmat/AdjacencyMatrixBase.h +659 -0
  26. plumed/_lib/include/plumed/adjmat/ContactMatrix.h +59 -0
  27. plumed/_lib/include/plumed/asmjit/arch.h +228 -0
  28. plumed/_lib/include/plumed/asmjit/arm.h +43 -0
  29. plumed/_lib/include/plumed/asmjit/asmjit.h +69 -0
  30. plumed/_lib/include/plumed/asmjit/asmjit_apibegin.h +143 -0
  31. plumed/_lib/include/plumed/asmjit/asmjit_apiend.h +93 -0
  32. plumed/_lib/include/plumed/asmjit/asmjit_build.h +971 -0
  33. plumed/_lib/include/plumed/asmjit/assembler.h +183 -0
  34. plumed/_lib/include/plumed/asmjit/base.h +56 -0
  35. plumed/_lib/include/plumed/asmjit/codebuilder.h +944 -0
  36. plumed/_lib/include/plumed/asmjit/codecompiler.h +767 -0
  37. plumed/_lib/include/plumed/asmjit/codeemitter.h +528 -0
  38. plumed/_lib/include/plumed/asmjit/codeholder.h +777 -0
  39. plumed/_lib/include/plumed/asmjit/constpool.h +286 -0
  40. plumed/_lib/include/plumed/asmjit/cpuinfo.h +402 -0
  41. plumed/_lib/include/plumed/asmjit/func.h +1327 -0
  42. plumed/_lib/include/plumed/asmjit/globals.h +370 -0
  43. plumed/_lib/include/plumed/asmjit/inst.h +137 -0
  44. plumed/_lib/include/plumed/asmjit/logging.h +317 -0
  45. plumed/_lib/include/plumed/asmjit/misc_p.h +103 -0
  46. plumed/_lib/include/plumed/asmjit/moved_string.h +318 -0
  47. plumed/_lib/include/plumed/asmjit/operand.h +1599 -0
  48. plumed/_lib/include/plumed/asmjit/osutils.h +207 -0
  49. plumed/_lib/include/plumed/asmjit/regalloc_p.h +597 -0
  50. plumed/_lib/include/plumed/asmjit/runtime.h +227 -0
  51. plumed/_lib/include/plumed/asmjit/simdtypes.h +1104 -0
  52. plumed/_lib/include/plumed/asmjit/utils.h +1387 -0
  53. plumed/_lib/include/plumed/asmjit/vmem.h +183 -0
  54. plumed/_lib/include/plumed/asmjit/x86.h +45 -0
  55. plumed/_lib/include/plumed/asmjit/x86assembler.h +125 -0
  56. plumed/_lib/include/plumed/asmjit/x86builder.h +117 -0
  57. plumed/_lib/include/plumed/asmjit/x86compiler.h +322 -0
  58. plumed/_lib/include/plumed/asmjit/x86emitter.h +5149 -0
  59. plumed/_lib/include/plumed/asmjit/x86globals.h +535 -0
  60. plumed/_lib/include/plumed/asmjit/x86inst.h +2547 -0
  61. plumed/_lib/include/plumed/asmjit/x86instimpl_p.h +74 -0
  62. plumed/_lib/include/plumed/asmjit/x86internal_p.h +108 -0
  63. plumed/_lib/include/plumed/asmjit/x86logging_p.h +92 -0
  64. plumed/_lib/include/plumed/asmjit/x86misc.h +417 -0
  65. plumed/_lib/include/plumed/asmjit/x86operand.h +1133 -0
  66. plumed/_lib/include/plumed/asmjit/x86regalloc_p.h +734 -0
  67. plumed/_lib/include/plumed/asmjit/zone.h +1157 -0
  68. plumed/_lib/include/plumed/bias/Bias.h +82 -0
  69. plumed/_lib/include/plumed/bias/ReweightBase.h +58 -0
  70. plumed/_lib/include/plumed/blas/blas.h +253 -0
  71. plumed/_lib/include/plumed/blas/def_external.h +61 -0
  72. plumed/_lib/include/plumed/blas/def_internal.h +97 -0
  73. plumed/_lib/include/plumed/blas/real.h +49 -0
  74. plumed/_lib/include/plumed/cltools/CLTool.h +32 -0
  75. plumed/_lib/include/plumed/clusters/ClusteringBase.h +70 -0
  76. plumed/_lib/include/plumed/colvar/Colvar.h +32 -0
  77. plumed/_lib/include/plumed/colvar/ColvarInput.h +68 -0
  78. plumed/_lib/include/plumed/colvar/ColvarShortcut.h +81 -0
  79. plumed/_lib/include/plumed/colvar/CoordinationBase.h +52 -0
  80. plumed/_lib/include/plumed/colvar/MultiColvarTemplate.h +333 -0
  81. plumed/_lib/include/plumed/colvar/PathMSDBase.h +101 -0
  82. plumed/_lib/include/plumed/colvar/RMSDVector.h +78 -0
  83. plumed/_lib/include/plumed/config/Config.h +118 -0
  84. plumed/_lib/include/plumed/config/version.h +9 -0
  85. plumed/_lib/include/plumed/contour/ContourFindingObject.h +87 -0
  86. plumed/_lib/include/plumed/contour/DistanceFromContourBase.h +82 -0
  87. plumed/_lib/include/plumed/contour/FindContour.h +67 -0
  88. plumed/_lib/include/plumed/core/Action.h +540 -0
  89. plumed/_lib/include/plumed/core/ActionAnyorder.h +48 -0
  90. plumed/_lib/include/plumed/core/ActionAtomistic.h +343 -0
  91. plumed/_lib/include/plumed/core/ActionForInterface.h +99 -0
  92. plumed/_lib/include/plumed/core/ActionPilot.h +57 -0
  93. plumed/_lib/include/plumed/core/ActionRegister.h +124 -0
  94. plumed/_lib/include/plumed/core/ActionSet.h +163 -0
  95. plumed/_lib/include/plumed/core/ActionSetup.h +48 -0
  96. plumed/_lib/include/plumed/core/ActionShortcut.h +73 -0
  97. plumed/_lib/include/plumed/core/ActionToGetData.h +59 -0
  98. plumed/_lib/include/plumed/core/ActionToPutData.h +101 -0
  99. plumed/_lib/include/plumed/core/ActionWithArguments.h +140 -0
  100. plumed/_lib/include/plumed/core/ActionWithMatrix.h +87 -0
  101. plumed/_lib/include/plumed/core/ActionWithValue.h +258 -0
  102. plumed/_lib/include/plumed/core/ActionWithVector.h +94 -0
  103. plumed/_lib/include/plumed/core/ActionWithVirtualAtom.h +123 -0
  104. plumed/_lib/include/plumed/core/CLTool.h +177 -0
  105. plumed/_lib/include/plumed/core/CLToolMain.h +102 -0
  106. plumed/_lib/include/plumed/core/CLToolRegister.h +108 -0
  107. plumed/_lib/include/plumed/core/Colvar.h +115 -0
  108. plumed/_lib/include/plumed/core/DataPassingObject.h +94 -0
  109. plumed/_lib/include/plumed/core/DataPassingTools.h +54 -0
  110. plumed/_lib/include/plumed/core/DomainDecomposition.h +120 -0
  111. plumed/_lib/include/plumed/core/ExchangePatterns.h +47 -0
  112. plumed/_lib/include/plumed/core/FlexibleBin.h +63 -0
  113. plumed/_lib/include/plumed/core/GREX.h +61 -0
  114. plumed/_lib/include/plumed/core/GenericMolInfo.h +89 -0
  115. plumed/_lib/include/plumed/core/Group.h +41 -0
  116. plumed/_lib/include/plumed/core/ModuleMap.h +30 -0
  117. plumed/_lib/include/plumed/core/ParallelTaskManager.h +1023 -0
  118. plumed/_lib/include/plumed/core/PbcAction.h +61 -0
  119. plumed/_lib/include/plumed/core/PlumedMain.h +632 -0
  120. plumed/_lib/include/plumed/core/PlumedMainInitializer.h +118 -0
  121. plumed/_lib/include/plumed/core/RegisterBase.h +340 -0
  122. plumed/_lib/include/plumed/core/TargetDist.h +48 -0
  123. plumed/_lib/include/plumed/core/Value.h +547 -0
  124. plumed/_lib/include/plumed/core/WithCmd.h +93 -0
  125. plumed/_lib/include/plumed/dimred/SMACOF.h +55 -0
  126. plumed/_lib/include/plumed/drr/DRR.h +383 -0
  127. plumed/_lib/include/plumed/drr/colvar_UIestimator.h +777 -0
  128. plumed/_lib/include/plumed/fisst/legendre_rule_fast.h +44 -0
  129. plumed/_lib/include/plumed/function/Custom.h +54 -0
  130. plumed/_lib/include/plumed/function/Function.h +85 -0
  131. plumed/_lib/include/plumed/function/FunctionOfMatrix.h +368 -0
  132. plumed/_lib/include/plumed/function/FunctionOfScalar.h +135 -0
  133. plumed/_lib/include/plumed/function/FunctionOfVector.h +296 -0
  134. plumed/_lib/include/plumed/function/FunctionSetup.h +180 -0
  135. plumed/_lib/include/plumed/function/FunctionShortcut.h +130 -0
  136. plumed/_lib/include/plumed/function/FunctionWithSingleArgument.h +165 -0
  137. plumed/_lib/include/plumed/gridtools/ActionWithGrid.h +43 -0
  138. plumed/_lib/include/plumed/gridtools/EvaluateGridFunction.h +99 -0
  139. plumed/_lib/include/plumed/gridtools/FunctionOfGrid.h +295 -0
  140. plumed/_lib/include/plumed/gridtools/GridCoordinatesObject.h +179 -0
  141. plumed/_lib/include/plumed/gridtools/GridSearch.h +135 -0
  142. plumed/_lib/include/plumed/gridtools/Interpolator.h +45 -0
  143. plumed/_lib/include/plumed/gridtools/KDE.h +455 -0
  144. plumed/_lib/include/plumed/gridtools/RDF.h +40 -0
  145. plumed/_lib/include/plumed/gridtools/SumOfKernels.h +219 -0
  146. plumed/_lib/include/plumed/isdb/MetainferenceBase.h +398 -0
  147. plumed/_lib/include/plumed/lapack/def_external.h +207 -0
  148. plumed/_lib/include/plumed/lapack/def_internal.h +388 -0
  149. plumed/_lib/include/plumed/lapack/lapack.h +899 -0
  150. plumed/_lib/include/plumed/lapack/lapack_limits.h +79 -0
  151. plumed/_lib/include/plumed/lapack/real.h +50 -0
  152. plumed/_lib/include/plumed/lepton/CompiledExpression.h +164 -0
  153. plumed/_lib/include/plumed/lepton/CustomFunction.h +143 -0
  154. plumed/_lib/include/plumed/lepton/Exception.h +93 -0
  155. plumed/_lib/include/plumed/lepton/ExpressionProgram.h +137 -0
  156. plumed/_lib/include/plumed/lepton/ExpressionTreeNode.h +145 -0
  157. plumed/_lib/include/plumed/lepton/Lepton.h +85 -0
  158. plumed/_lib/include/plumed/lepton/MSVC_erfc.h +123 -0
  159. plumed/_lib/include/plumed/lepton/Operation.h +1302 -0
  160. plumed/_lib/include/plumed/lepton/ParsedExpression.h +165 -0
  161. plumed/_lib/include/plumed/lepton/Parser.h +111 -0
  162. plumed/_lib/include/plumed/lepton/windowsIncludes.h +73 -0
  163. plumed/_lib/include/plumed/mapping/Path.h +44 -0
  164. plumed/_lib/include/plumed/mapping/PathProjectionCalculator.h +57 -0
  165. plumed/_lib/include/plumed/matrixtools/MatrixOperationBase.h +54 -0
  166. plumed/_lib/include/plumed/matrixtools/MatrixTimesMatrix.h +309 -0
  167. plumed/_lib/include/plumed/matrixtools/MatrixTimesVectorBase.h +365 -0
  168. plumed/_lib/include/plumed/matrixtools/OuterProduct.h +238 -0
  169. plumed/_lib/include/plumed/maze/Core.h +65 -0
  170. plumed/_lib/include/plumed/maze/Loss.h +86 -0
  171. plumed/_lib/include/plumed/maze/Member.h +66 -0
  172. plumed/_lib/include/plumed/maze/Memetic.h +799 -0
  173. plumed/_lib/include/plumed/maze/Optimizer.h +357 -0
  174. plumed/_lib/include/plumed/maze/Random_MT.h +156 -0
  175. plumed/_lib/include/plumed/maze/Tools.h +183 -0
  176. plumed/_lib/include/plumed/metatomic/vesin.h +188 -0
  177. plumed/_lib/include/plumed/molfile/Gromacs.h +2013 -0
  178. plumed/_lib/include/plumed/molfile/endianswap.h +217 -0
  179. plumed/_lib/include/plumed/molfile/fastio.h +683 -0
  180. plumed/_lib/include/plumed/molfile/largefiles.h +78 -0
  181. plumed/_lib/include/plumed/molfile/libmolfile_plugin.h +77 -0
  182. plumed/_lib/include/plumed/molfile/molfile_plugin.h +1034 -0
  183. plumed/_lib/include/plumed/molfile/periodic_table.h +248 -0
  184. plumed/_lib/include/plumed/molfile/readpdb.h +447 -0
  185. plumed/_lib/include/plumed/molfile/vmdplugin.h +236 -0
  186. plumed/_lib/include/plumed/multicolvar/MultiColvarShortcuts.h +45 -0
  187. plumed/_lib/include/plumed/opes/ExpansionCVs.h +79 -0
  188. plumed/_lib/include/plumed/sasa/Sasa.h +32 -0
  189. plumed/_lib/include/plumed/secondarystructure/SecondaryStructureBase.h +372 -0
  190. plumed/_lib/include/plumed/setup/ActionSetup.h +25 -0
  191. plumed/_lib/include/plumed/small_vector/small_vector.h +6114 -0
  192. plumed/_lib/include/plumed/symfunc/CoordinationNumbers.h +41 -0
  193. plumed/_lib/include/plumed/tools/Angle.h +52 -0
  194. plumed/_lib/include/plumed/tools/AtomDistribution.h +138 -0
  195. plumed/_lib/include/plumed/tools/AtomNumber.h +152 -0
  196. plumed/_lib/include/plumed/tools/BiasRepresentation.h +106 -0
  197. plumed/_lib/include/plumed/tools/BitmaskEnum.h +167 -0
  198. plumed/_lib/include/plumed/tools/Brent1DRootSearch.h +159 -0
  199. plumed/_lib/include/plumed/tools/CheckInRange.h +44 -0
  200. plumed/_lib/include/plumed/tools/Citations.h +74 -0
  201. plumed/_lib/include/plumed/tools/ColvarOutput.h +118 -0
  202. plumed/_lib/include/plumed/tools/Communicator.h +316 -0
  203. plumed/_lib/include/plumed/tools/ConjugateGradient.h +80 -0
  204. plumed/_lib/include/plumed/tools/DLLoader.h +79 -0
  205. plumed/_lib/include/plumed/tools/ERMSD.h +73 -0
  206. plumed/_lib/include/plumed/tools/Exception.h +406 -0
  207. plumed/_lib/include/plumed/tools/File.h +28 -0
  208. plumed/_lib/include/plumed/tools/FileBase.h +153 -0
  209. plumed/_lib/include/plumed/tools/FileTools.h +37 -0
  210. plumed/_lib/include/plumed/tools/ForwardDecl.h +54 -0
  211. plumed/_lib/include/plumed/tools/Grid.h +638 -0
  212. plumed/_lib/include/plumed/tools/HistogramBead.h +136 -0
  213. plumed/_lib/include/plumed/tools/IFile.h +117 -0
  214. plumed/_lib/include/plumed/tools/KernelFunctions.h +113 -0
  215. plumed/_lib/include/plumed/tools/Keywords.h +380 -0
  216. plumed/_lib/include/plumed/tools/LatticeReduction.h +66 -0
  217. plumed/_lib/include/plumed/tools/LeptonCall.h +64 -0
  218. plumed/_lib/include/plumed/tools/LinkCells.h +126 -0
  219. plumed/_lib/include/plumed/tools/Log.h +41 -0
  220. plumed/_lib/include/plumed/tools/LoopUnroller.h +163 -0
  221. plumed/_lib/include/plumed/tools/Matrix.h +721 -0
  222. plumed/_lib/include/plumed/tools/MatrixSquareBracketsAccess.h +138 -0
  223. plumed/_lib/include/plumed/tools/MergeVectorTools.h +153 -0
  224. plumed/_lib/include/plumed/tools/Minimise1DBrent.h +244 -0
  225. plumed/_lib/include/plumed/tools/MinimiseBase.h +120 -0
  226. plumed/_lib/include/plumed/tools/MolDataClass.h +51 -0
  227. plumed/_lib/include/plumed/tools/NeighborList.h +112 -0
  228. plumed/_lib/include/plumed/tools/OFile.h +286 -0
  229. plumed/_lib/include/plumed/tools/OpenACC.h +180 -0
  230. plumed/_lib/include/plumed/tools/OpenMP.h +75 -0
  231. plumed/_lib/include/plumed/tools/PDB.h +154 -0
  232. plumed/_lib/include/plumed/tools/Pbc.h +139 -0
  233. plumed/_lib/include/plumed/tools/PlumedHandle.h +105 -0
  234. plumed/_lib/include/plumed/tools/RMSD.h +493 -0
  235. plumed/_lib/include/plumed/tools/Random.h +80 -0
  236. plumed/_lib/include/plumed/tools/RootFindingBase.h +79 -0
  237. plumed/_lib/include/plumed/tools/Stopwatch.h +475 -0
  238. plumed/_lib/include/plumed/tools/Subprocess.h +142 -0
  239. plumed/_lib/include/plumed/tools/SwitchingFunction.h +208 -0
  240. plumed/_lib/include/plumed/tools/Tensor.h +724 -0
  241. plumed/_lib/include/plumed/tools/TokenizedLine.h +123 -0
  242. plumed/_lib/include/plumed/tools/Tools.h +638 -0
  243. plumed/_lib/include/plumed/tools/Torsion.h +55 -0
  244. plumed/_lib/include/plumed/tools/TrajectoryParser.h +118 -0
  245. plumed/_lib/include/plumed/tools/Tree.h +61 -0
  246. plumed/_lib/include/plumed/tools/TypesafePtr.h +463 -0
  247. plumed/_lib/include/plumed/tools/Units.h +167 -0
  248. plumed/_lib/include/plumed/tools/Vector.h +433 -0
  249. plumed/_lib/include/plumed/tools/View.h +296 -0
  250. plumed/_lib/include/plumed/tools/View2D.h +100 -0
  251. plumed/_lib/include/plumed/tools/h36.h +39 -0
  252. plumed/_lib/include/plumed/vatom/ActionWithVirtualAtom.h +32 -0
  253. plumed/_lib/include/plumed/ves/BasisFunctions.h +380 -0
  254. plumed/_lib/include/plumed/ves/CoeffsBase.h +310 -0
  255. plumed/_lib/include/plumed/ves/CoeffsMatrix.h +220 -0
  256. plumed/_lib/include/plumed/ves/CoeffsVector.h +251 -0
  257. plumed/_lib/include/plumed/ves/FermiSwitchingFunction.h +74 -0
  258. plumed/_lib/include/plumed/ves/GridIntegrationWeights.h +50 -0
  259. plumed/_lib/include/plumed/ves/GridLinearInterpolation.h +81 -0
  260. plumed/_lib/include/plumed/ves/GridProjWeights.h +61 -0
  261. plumed/_lib/include/plumed/ves/LinearBasisSetExpansion.h +303 -0
  262. plumed/_lib/include/plumed/ves/Optimizer.h +444 -0
  263. plumed/_lib/include/plumed/ves/TargetDistModifer.h +53 -0
  264. plumed/_lib/include/plumed/ves/TargetDistribution.h +266 -0
  265. plumed/_lib/include/plumed/ves/VesBias.h +545 -0
  266. plumed/_lib/include/plumed/ves/VesTools.h +142 -0
  267. plumed/_lib/include/plumed/ves/WaveletGrid.h +75 -0
  268. plumed/_lib/include/plumed/volumes/ActionVolume.h +268 -0
  269. plumed/_lib/include/plumed/volumes/VolumeShortcut.h +147 -0
  270. plumed/_lib/include/plumed/wrapper/Plumed.h +5025 -0
  271. plumed/_lib/include/plumed/xdrfile/xdrfile.h +663 -0
  272. plumed/_lib/include/plumed/xdrfile/xdrfile_trr.h +89 -0
  273. plumed/_lib/include/plumed/xdrfile/xdrfile_xtc.h +90 -0
  274. plumed/_lib/lib/PythonCVInterface.so +0 -0
  275. plumed/_lib/lib/libplumed.a +0 -0
  276. plumed/_lib/lib/libplumed.so +0 -0
  277. plumed/_lib/lib/libplumedKernel.so +0 -0
  278. plumed/_lib/lib/libplumedWrapper.a +0 -0
  279. plumed/_lib/lib/pkgconfig/plumed.pc +13 -0
  280. plumed/_lib/lib/pkgconfig/plumedInternals.pc +13 -0
  281. plumed/_lib/lib/pkgconfig/plumedWrapper.pc +13 -0
  282. plumed/_lib/lib/plumed/fortran/plumed.f90 +879 -0
  283. plumed/_lib/lib/plumed/fortran/plumed_f08.f90 +2625 -0
  284. plumed/_lib/lib/plumed/modulefile +69 -0
  285. plumed/_lib/lib/plumed/patches/gromacs-2022.5.config +43 -0
  286. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt +543 -0
  287. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt.preplumed +540 -0
  288. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.cpp +1628 -0
  289. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1590 -0
  290. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.h +103 -0
  291. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.h.preplumed +99 -0
  292. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/sim_util.cpp +2527 -0
  293. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2513 -0
  294. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
  295. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
  296. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.h +408 -0
  297. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +394 -0
  298. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/md.cpp +2348 -0
  299. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/md.cpp.preplumed +2091 -0
  300. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/minimize.cpp +3573 -0
  301. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3495 -0
  302. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp +1506 -0
  303. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1402 -0
  304. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
  305. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
  306. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/rerun.cpp +997 -0
  307. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/rerun.cpp.preplumed +906 -0
  308. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/runner.cpp +2780 -0
  309. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/runner.cpp.preplumed +2738 -0
  310. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
  311. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
  312. plumed/_lib/lib/plumed/patches/gromacs-2023.5.config +43 -0
  313. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/CMakeLists.txt +549 -0
  314. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/CMakeLists.txt.preplumed +546 -0
  315. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.cpp +1632 -0
  316. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1594 -0
  317. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.h +104 -0
  318. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.h.preplumed +100 -0
  319. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/sim_util.cpp +2624 -0
  320. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2610 -0
  321. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
  322. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
  323. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.h +409 -0
  324. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +395 -0
  325. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/md.cpp +2419 -0
  326. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/md.cpp.preplumed +2164 -0
  327. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/minimize.cpp +3546 -0
  328. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3468 -0
  329. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.cpp +1513 -0
  330. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1409 -0
  331. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
  332. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
  333. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/rerun.cpp +991 -0
  334. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/rerun.cpp.preplumed +900 -0
  335. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/runner.cpp +2895 -0
  336. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/runner.cpp.preplumed +2849 -0
  337. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
  338. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
  339. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/decidegpuusage.cpp +886 -0
  340. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/decidegpuusage.cpp.preplumed +880 -0
  341. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h +347 -0
  342. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h.preplumed +345 -0
  343. plumed/_lib/lib/plumed/patches/gromacs-2024.3.config +43 -0
  344. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt +575 -0
  345. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt.preplumed +572 -0
  346. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.cpp +1632 -0
  347. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1594 -0
  348. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.h +104 -0
  349. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.h.preplumed +100 -0
  350. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/sim_util.cpp +2564 -0
  351. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2550 -0
  352. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
  353. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
  354. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.h +410 -0
  355. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +396 -0
  356. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/md.cpp +2435 -0
  357. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/md.cpp.preplumed +2187 -0
  358. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/minimize.cpp +3592 -0
  359. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3514 -0
  360. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.cpp +1513 -0
  361. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1409 -0
  362. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
  363. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
  364. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/rerun.cpp +958 -0
  365. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/rerun.cpp.preplumed +929 -0
  366. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/runner.cpp +2987 -0
  367. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/runner.cpp.preplumed +2941 -0
  368. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
  369. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
  370. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/decidegpuusage.cpp +904 -0
  371. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/decidegpuusage.cpp.preplumed +898 -0
  372. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h +353 -0
  373. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h.preplumed +351 -0
  374. plumed/_lib/lib/plumed/patches/gromacs-2025.0.config +39 -0
  375. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/cmake/gmxManagePlumed.cmake +82 -0
  376. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/cmake/gmxManagePlumed.cmake.preplumed +82 -0
  377. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedMDModule.cpp +162 -0
  378. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedMDModule.cpp.preplumed +154 -0
  379. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.cpp +107 -0
  380. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.cpp.preplumed +99 -0
  381. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.h +120 -0
  382. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.h.preplumed +111 -0
  383. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.cpp +215 -0
  384. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.cpp.preplumed +197 -0
  385. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.h +87 -0
  386. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.h.preplumed +86 -0
  387. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrun/runner.cpp +2971 -0
  388. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrun/runner.cpp.preplumed +2970 -0
  389. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrunutility/mdmodulesnotifiers.h +430 -0
  390. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrunutility/mdmodulesnotifiers.h.preplumed +429 -0
  391. plumed/_lib/lib/plumed/patches/namd-2.12.config +30 -0
  392. plumed/_lib/lib/plumed/patches/namd-2.12.diff +267 -0
  393. plumed/_lib/lib/plumed/patches/namd-2.13.config +30 -0
  394. plumed/_lib/lib/plumed/patches/namd-2.13.diff +267 -0
  395. plumed/_lib/lib/plumed/patches/namd-2.14.config +30 -0
  396. plumed/_lib/lib/plumed/patches/namd-2.14.diff +268 -0
  397. plumed/_lib/lib/plumed/patches/patch.sh +500 -0
  398. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.config +25 -0
  399. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/forces.f90 +368 -0
  400. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/forces.f90.preplumed +366 -0
  401. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90 +71 -0
  402. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90.preplumed +24 -0
  403. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_initialization.f90 +62 -0
  404. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
  405. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/pwscf.f90 +189 -0
  406. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/pwscf.f90.preplumed +185 -0
  407. plumed/_lib/lib/plumed/patches/qespresso-6.2.config +26 -0
  408. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/forces.f90 +422 -0
  409. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/forces.f90.preplumed +420 -0
  410. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90 +70 -0
  411. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
  412. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_initialization.f90 +62 -0
  413. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
  414. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/run_pwscf.f90 +233 -0
  415. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/run_pwscf.f90.preplumed +230 -0
  416. plumed/_lib/lib/plumed/patches/qespresso-7.0.config +28 -0
  417. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/Modules/Makefile +175 -0
  418. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/Modules/Makefile.preplumed +171 -0
  419. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/forces.f90 +486 -0
  420. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/forces.f90.preplumed +484 -0
  421. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_ext_forces.f90 +74 -0
  422. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
  423. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_initialization.f90 +64 -0
  424. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
  425. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/run_pwscf.f90 +532 -0
  426. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/run_pwscf.f90.preplumed +518 -0
  427. plumed/_lib/lib/plumed/patches/qespresso-7.2.config +28 -0
  428. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/Modules/Makefile +249 -0
  429. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/Modules/Makefile.preplumed +244 -0
  430. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/forces.f90 +532 -0
  431. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/forces.f90.preplumed +535 -0
  432. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_ext_forces.f90 +74 -0
  433. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
  434. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_initialization.f90 +64 -0
  435. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
  436. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/run_pwscf.f90 +569 -0
  437. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/run_pwscf.f90.preplumed +560 -0
  438. plumed/_lib/lib/plumed/plumed-config +9 -0
  439. plumed/_lib/lib/plumed/plumed-mklib +9 -0
  440. plumed/_lib/lib/plumed/plumed-newcv +9 -0
  441. plumed/_lib/lib/plumed/plumed-partial_tempering +9 -0
  442. plumed/_lib/lib/plumed/plumed-patch +9 -0
  443. plumed/_lib/lib/plumed/plumed-runtime +0 -0
  444. plumed/_lib/lib/plumed/plumed-selector +9 -0
  445. plumed/_lib/lib/plumed/plumed-vim2html +9 -0
  446. plumed/_lib/lib/plumed/scripts/config.sh +126 -0
  447. plumed/_lib/lib/plumed/scripts/mklib.sh +175 -0
  448. plumed/_lib/lib/plumed/scripts/newcv.sh +26 -0
  449. plumed/_lib/lib/plumed/scripts/partial_tempering.sh +319 -0
  450. plumed/_lib/lib/plumed/scripts/patch.sh +4 -0
  451. plumed/_lib/lib/plumed/scripts/selector.sh +234 -0
  452. plumed/_lib/lib/plumed/scripts/vim2html.sh +190 -0
  453. plumed/_lib/lib/plumed/src/colvar/Template.cpp +116 -0
  454. plumed/_lib/lib/plumed/src/config/compile_options.sh +3 -0
  455. plumed/_lib/lib/plumed/src/config/config.txt +179 -0
  456. plumed/_lib/lib/plumed/src/lib/Plumed.cmake +8 -0
  457. plumed/_lib/lib/plumed/src/lib/Plumed.cmake.runtime +5 -0
  458. plumed/_lib/lib/plumed/src/lib/Plumed.cmake.shared +5 -0
  459. plumed/_lib/lib/plumed/src/lib/Plumed.cmake.static +5 -0
  460. plumed/_lib/lib/plumed/src/lib/Plumed.inc +8 -0
  461. plumed/_lib/lib/plumed/src/lib/Plumed.inc.runtime +5 -0
  462. plumed/_lib/lib/plumed/src/lib/Plumed.inc.shared +5 -0
  463. plumed/_lib/lib/plumed/src/lib/Plumed.inc.static +5 -0
  464. plumed/_lib/lib/plumed/vim/scripts.vim +6 -0
  465. plumed/_plumed_core.cpython-311-aarch64-linux-gnu.so +0 -0
  466. plumed/_plumed_core.cpython-312-aarch64-linux-gnu.so +0 -0
  467. plumed/_plumed_core.cpython-313-aarch64-linux-gnu.so +0 -0
  468. plumed/_plumed_core.cpython-314-aarch64-linux-gnu.so +0 -0
  469. plumed/_plumed_core.cpython-314t-aarch64-linux-gnu.so +0 -0
  470. plumedCommunications.cpython-311-aarch64-linux-gnu.so +0 -0
  471. plumedCommunications.cpython-312-aarch64-linux-gnu.so +0 -0
  472. plumedCommunications.cpython-313-aarch64-linux-gnu.so +0 -0
  473. plumedCommunications.cpython-314-aarch64-linux-gnu.so +0 -0
  474. plumedCommunications.cpython-314t-aarch64-linux-gnu.so +0 -0
  475. plumedCommunications.pyi +431 -0
@@ -0,0 +1,1302 @@
1
+ /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2
+ * -------------------------------------------------------------------------- *
3
+ * Lepton *
4
+ * -------------------------------------------------------------------------- *
5
+ * This is part of the Lepton expression parser originating from *
6
+ * Simbios, the NIH National Center for Physics-Based Simulation of *
7
+ * Biological Structures at Stanford, funded under the NIH Roadmap for *
8
+ * Medical Research, grant U54 GM072970. See https://simtk.org. *
9
+ * *
10
+ * Portions copyright (c) 2013-2016 Stanford University and the Authors. *
11
+ * Authors: Peter Eastman *
12
+ * Contributors: *
13
+ * *
14
+ * Permission is hereby granted, free of charge, to any person obtaining a *
15
+ * copy of this software and associated documentation files (the "Software"), *
16
+ * to deal in the Software without restriction, including without limitation *
17
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
18
+ * and/or sell copies of the Software, and to permit persons to whom the *
19
+ * Software is furnished to do so, subject to the following conditions: *
20
+ * *
21
+ * The above copyright notice and this permission notice shall be included in *
22
+ * all copies or substantial portions of the Software. *
23
+ * *
24
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
25
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
26
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
27
+ * THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
28
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
29
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
30
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. *
31
+ * -------------------------------------------------------------------------- *
32
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
33
+ #ifndef __PLUMED_lepton_Operation_h
34
+ #define __PLUMED_lepton_Operation_h
35
+
36
+ /* -------------------------------------------------------------------------- *
37
+ * lepton *
38
+ * -------------------------------------------------------------------------- *
39
+ * This is part of the lepton expression parser originating from *
40
+ * Simbios, the NIH National Center for Physics-Based Simulation of *
41
+ * Biological Structures at Stanford, funded under the NIH Roadmap for *
42
+ * Medical Research, grant U54 GM072970. See https://simtk.org. *
43
+ * *
44
+ * Portions copyright (c) 2009-2019 Stanford University and the Authors. *
45
+ * Authors: Peter Eastman *
46
+ * Contributors: *
47
+ * *
48
+ * Permission is hereby granted, free of charge, to any person obtaining a *
49
+ * copy of this software and associated documentation files (the "Software"), *
50
+ * to deal in the Software without restriction, including without limitation *
51
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
52
+ * and/or sell copies of the Software, and to permit persons to whom the *
53
+ * Software is furnished to do so, subject to the following conditions: *
54
+ * *
55
+ * The above copyright notice and this permission notice shall be included in *
56
+ * all copies or substantial portions of the Software. *
57
+ * *
58
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
59
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
60
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
61
+ * THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
62
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
63
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
64
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. *
65
+ * -------------------------------------------------------------------------- */
66
+
67
+ #include "windowsIncludes.h"
68
+ #include "CustomFunction.h"
69
+ #include "Exception.h"
70
+ #include <cmath>
71
+ #include <map>
72
+ #include <string>
73
+ #include <vector>
74
+ #include <sstream>
75
+ #include <algorithm>
76
+ #include <limits>
77
+
78
+ namespace PLMD {
79
+ namespace lepton {
80
+
81
+ class ExpressionTreeNode;
82
+
83
+ /**
84
+ * An Operation represents a single step in the evaluation of an expression, such as a function,
85
+ * an operator, or a constant value. Each Operation takes some number of values as arguments
86
+ * and produces a single value.
87
+ *
88
+ * This is an abstract class with subclasses for specific operations.
89
+ */
90
+
91
+ class LEPTON_EXPORT Operation {
92
+ public:
93
+ virtual ~Operation() {
94
+ }
95
+ /**
96
+ * This enumeration lists all Operation subclasses. This is provided so that switch statements
97
+ * can be used when processing or analyzing parsed expressions.
98
+ */
99
+ enum Id {CONSTANT, VARIABLE, CUSTOM, ADD, SUBTRACT, MULTIPLY, DIVIDE, POWER, NEGATE, SQRT, EXP, LOG,
100
+ SIN, COS, SEC, CSC, TAN, COT, ASIN, ACOS, ATAN, ATAN2, SINH, COSH, TANH, ERF, ERFC, STEP, DELTA, NANDELTA, SQUARE, CUBE, RECIPROCAL,
101
+ ADD_CONSTANT, MULTIPLY_CONSTANT, POWER_CONSTANT, MIN, MAX, ABS, FLOOR, CEIL, SELECT,
102
+ ACOT, ASEC, ACSC, COTH, SECH, CSCH, ASINH, ACOSH, ATANH, ACOTH, ASECH, ACSCH};
103
+ /**
104
+ * Get the name of this Operation.
105
+ */
106
+ virtual std::string getName() const = 0;
107
+ /**
108
+ * Get this Operation's ID.
109
+ */
110
+ virtual Id getId() const = 0;
111
+ /**
112
+ * Get the number of arguments this operation expects.
113
+ */
114
+ virtual int getNumArguments() const = 0;
115
+ /**
116
+ * Create a clone of this Operation.
117
+ */
118
+ virtual Operation* clone() const = 0;
119
+ /**
120
+ * Perform the computation represented by this operation.
121
+ *
122
+ * @param args the array of arguments
123
+ * @param variables a map containing the values of all variables
124
+ * @return the result of performing the computation.
125
+ */
126
+ virtual double evaluate(double* args, const std::map<std::string, double>& variables) const = 0;
127
+ /**
128
+ * Return an ExpressionTreeNode which represents the analytic derivative of this Operation with respect to a variable.
129
+ *
130
+ * @param children the child nodes
131
+ * @param childDerivs the derivatives of the child nodes with respect to the variable
132
+ * @param variable the variable with respect to which the derivate should be taken
133
+ */
134
+ virtual ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const = 0;
135
+ /**
136
+ * Get whether this operation should be displayed with infix notation.
137
+ */
138
+ virtual bool isInfixOperator() const {
139
+ return false;
140
+ }
141
+ /**
142
+ * Get whether this is a symmetric binary operation, such that exchanging its arguments
143
+ * does not affect the result.
144
+ */
145
+ virtual bool isSymmetric() const {
146
+ return false;
147
+ }
148
+ virtual bool operator!=(const Operation& op) const {
149
+ return op.getId() != getId();
150
+ }
151
+ virtual bool operator==(const Operation& op) const {
152
+ return !(*this != op);
153
+ }
154
+ class Constant;
155
+ class Variable;
156
+ class Custom;
157
+ class Add;
158
+ class Subtract;
159
+ class Multiply;
160
+ class Divide;
161
+ class Power;
162
+ class Negate;
163
+ class Sqrt;
164
+ class Exp;
165
+ class Log;
166
+ class Sin;
167
+ class Cos;
168
+ class Sec;
169
+ class Csc;
170
+ class Tan;
171
+ class Cot;
172
+ class Asin;
173
+ class Acos;
174
+ class Atan;
175
+ class Atan2;
176
+ class Sinh;
177
+ class Cosh;
178
+ class Tanh;
179
+ class Erf;
180
+ class Erfc;
181
+ class Step;
182
+ class Delta;
183
+ class Nandelta;
184
+ class Square;
185
+ class Cube;
186
+ class Reciprocal;
187
+ class AddConstant;
188
+ class MultiplyConstant;
189
+ class PowerConstant;
190
+ class Min;
191
+ class Max;
192
+ class Abs;
193
+ class Floor;
194
+ class Ceil;
195
+ class Select;
196
+ class Acot;
197
+ class Asec;
198
+ class Acsc;
199
+ class Coth;
200
+ class Sech;
201
+ class Csch;
202
+ class Asinh;
203
+ class Acosh;
204
+ class Atanh;
205
+ class Acoth;
206
+ class Asech;
207
+ class Acsch;
208
+ };
209
+
210
+ class LEPTON_EXPORT Operation::Constant : public Operation {
211
+ public:
212
+ Constant(double setValue) : value(setValue) {
213
+ }
214
+ std::string getName() const {
215
+ std::stringstream name;
216
+ name << value;
217
+ return name.str();
218
+ }
219
+ Id getId() const {
220
+ return CONSTANT;
221
+ }
222
+ int getNumArguments() const {
223
+ return 0;
224
+ }
225
+ Operation* clone() const {
226
+ return new Constant(value);
227
+ }
228
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
229
+ return value;
230
+ }
231
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
232
+ double getValue() const {
233
+ return value;
234
+ }
235
+ bool operator!=(const Operation& op) const {
236
+ const Constant* o = dynamic_cast<const Constant*>(&op);
237
+ return (o == NULL || o->value != value);
238
+ }
239
+ private:
240
+ double value;
241
+ };
242
+
243
+ class LEPTON_EXPORT Operation::Variable : public Operation {
244
+ public:
245
+ Variable(const std::string& varname) : name(varname) {
246
+ }
247
+ std::string getName() const {
248
+ return name;
249
+ }
250
+ Id getId() const {
251
+ return VARIABLE;
252
+ }
253
+ int getNumArguments() const {
254
+ return 0;
255
+ }
256
+ Operation* clone() const {
257
+ return new Variable(name);
258
+ }
259
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
260
+ std::map<std::string, double>::const_iterator iter = variables.find(name);
261
+ if (iter == variables.end())
262
+ throw Exception("No value specified for variable "+name);
263
+ return iter->second;
264
+ }
265
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
266
+ bool operator!=(const Operation& op) const {
267
+ const Variable* o = dynamic_cast<const Variable*>(&op);
268
+ return (o == NULL || o->name != name);
269
+ }
270
+ private:
271
+ std::string name;
272
+ };
273
+
274
+ class LEPTON_EXPORT Operation::Custom : public Operation {
275
+ public:
276
+ Custom(const std::string& cname, CustomFunction* cfunction) : name(cname), function(cfunction), isDerivative(false), derivOrder(cfunction->getNumArguments(), 0) {
277
+ }
278
+ Custom(const std::string& cname, CustomFunction* cfunction, const std::vector<int>& cderivOrder) : name(cname), function(cfunction), isDerivative(false), derivOrder(cderivOrder) {
279
+ for (int order : derivOrder)
280
+ if (order != 0)
281
+ isDerivative = true;
282
+ }
283
+ Custom(const Custom& base, int derivIndex) : name(base.name), function(base.function->clone()), isDerivative(true), derivOrder(base.derivOrder) {
284
+ derivOrder[derivIndex]++;
285
+ }
286
+ ~Custom() {
287
+ delete function;
288
+ }
289
+ std::string getName() const {
290
+ return name;
291
+ }
292
+ Id getId() const {
293
+ return CUSTOM;
294
+ }
295
+ int getNumArguments() const {
296
+ return function->getNumArguments();
297
+ }
298
+ Operation* clone() const {
299
+ Custom* clone = new Custom(name, function->clone());
300
+ clone->isDerivative = isDerivative;
301
+ clone->derivOrder = derivOrder;
302
+ return clone;
303
+ }
304
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
305
+ if (isDerivative)
306
+ return function->evaluateDerivative(args, &derivOrder[0]);
307
+ return function->evaluate(args);
308
+ }
309
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
310
+ const std::vector<int>& getDerivOrder() const {
311
+ return derivOrder;
312
+ }
313
+ bool operator!=(const Operation& op) const {
314
+ const Custom* o = dynamic_cast<const Custom*>(&op);
315
+ return (o == NULL || o->name != name || o->isDerivative != isDerivative || o->derivOrder != derivOrder);
316
+ }
317
+ private:
318
+ std::string name;
319
+ CustomFunction* function;
320
+ bool isDerivative;
321
+ std::vector<int> derivOrder;
322
+ };
323
+
324
+ class LEPTON_EXPORT Operation::Add : public Operation {
325
+ public:
326
+ Add() {
327
+ }
328
+ std::string getName() const {
329
+ return "+";
330
+ }
331
+ Id getId() const {
332
+ return ADD;
333
+ }
334
+ int getNumArguments() const {
335
+ return 2;
336
+ }
337
+ Operation* clone() const {
338
+ return new Add();
339
+ }
340
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
341
+ return args[0]+args[1];
342
+ }
343
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
344
+ bool isInfixOperator() const {
345
+ return true;
346
+ }
347
+ bool isSymmetric() const {
348
+ return true;
349
+ }
350
+ };
351
+
352
+ class LEPTON_EXPORT Operation::Subtract : public Operation {
353
+ public:
354
+ Subtract() {
355
+ }
356
+ std::string getName() const {
357
+ return "-";
358
+ }
359
+ Id getId() const {
360
+ return SUBTRACT;
361
+ }
362
+ int getNumArguments() const {
363
+ return 2;
364
+ }
365
+ Operation* clone() const {
366
+ return new Subtract();
367
+ }
368
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
369
+ return args[0]-args[1];
370
+ }
371
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
372
+ bool isInfixOperator() const {
373
+ return true;
374
+ }
375
+ };
376
+
377
+ class LEPTON_EXPORT Operation::Multiply : public Operation {
378
+ public:
379
+ Multiply() {
380
+ }
381
+ std::string getName() const {
382
+ return "*";
383
+ }
384
+ Id getId() const {
385
+ return MULTIPLY;
386
+ }
387
+ int getNumArguments() const {
388
+ return 2;
389
+ }
390
+ Operation* clone() const {
391
+ return new Multiply();
392
+ }
393
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
394
+ return args[0]*args[1];
395
+ }
396
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
397
+ bool isInfixOperator() const {
398
+ return true;
399
+ }
400
+ bool isSymmetric() const {
401
+ return true;
402
+ }
403
+ };
404
+
405
+ class LEPTON_EXPORT Operation::Divide : public Operation {
406
+ public:
407
+ Divide() {
408
+ }
409
+ std::string getName() const {
410
+ return "/";
411
+ }
412
+ Id getId() const {
413
+ return DIVIDE;
414
+ }
415
+ int getNumArguments() const {
416
+ return 2;
417
+ }
418
+ Operation* clone() const {
419
+ return new Divide();
420
+ }
421
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
422
+ return args[0]/args[1];
423
+ }
424
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
425
+ bool isInfixOperator() const {
426
+ return true;
427
+ }
428
+ };
429
+
430
+ class LEPTON_EXPORT Operation::Power : public Operation {
431
+ public:
432
+ Power() {
433
+ }
434
+ std::string getName() const {
435
+ return "^";
436
+ }
437
+ Id getId() const {
438
+ return POWER;
439
+ }
440
+ int getNumArguments() const {
441
+ return 2;
442
+ }
443
+ Operation* clone() const {
444
+ return new Power();
445
+ }
446
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
447
+ return std::pow(args[0], args[1]);
448
+ }
449
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
450
+ bool isInfixOperator() const {
451
+ return true;
452
+ }
453
+ };
454
+
455
+ class LEPTON_EXPORT Operation::Negate : public Operation {
456
+ public:
457
+ Negate() {
458
+ }
459
+ std::string getName() const {
460
+ return "-";
461
+ }
462
+ Id getId() const {
463
+ return NEGATE;
464
+ }
465
+ int getNumArguments() const {
466
+ return 1;
467
+ }
468
+ Operation* clone() const {
469
+ return new Negate();
470
+ }
471
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
472
+ return -args[0];
473
+ }
474
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
475
+ };
476
+
477
+ class LEPTON_EXPORT Operation::Sqrt : public Operation {
478
+ public:
479
+ Sqrt() {
480
+ }
481
+ std::string getName() const {
482
+ return "sqrt";
483
+ }
484
+ Id getId() const {
485
+ return SQRT;
486
+ }
487
+ int getNumArguments() const {
488
+ return 1;
489
+ }
490
+ Operation* clone() const {
491
+ return new Sqrt();
492
+ }
493
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
494
+ return std::sqrt(args[0]);
495
+ }
496
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
497
+ };
498
+
499
+ class LEPTON_EXPORT Operation::Exp : public Operation {
500
+ public:
501
+ Exp() {
502
+ }
503
+ std::string getName() const {
504
+ return "exp";
505
+ }
506
+ Id getId() const {
507
+ return EXP;
508
+ }
509
+ int getNumArguments() const {
510
+ return 1;
511
+ }
512
+ Operation* clone() const {
513
+ return new Exp();
514
+ }
515
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
516
+ return std::exp(args[0]);
517
+ }
518
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
519
+ };
520
+
521
+ class LEPTON_EXPORT Operation::Log : public Operation {
522
+ public:
523
+ Log() {
524
+ }
525
+ std::string getName() const {
526
+ return "log";
527
+ }
528
+ Id getId() const {
529
+ return LOG;
530
+ }
531
+ int getNumArguments() const {
532
+ return 1;
533
+ }
534
+ Operation* clone() const {
535
+ return new Log();
536
+ }
537
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
538
+ return std::log(args[0]);
539
+ }
540
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
541
+ };
542
+
543
+ class LEPTON_EXPORT Operation::Sin : public Operation {
544
+ public:
545
+ Sin() {
546
+ }
547
+ std::string getName() const {
548
+ return "sin";
549
+ }
550
+ Id getId() const {
551
+ return SIN;
552
+ }
553
+ int getNumArguments() const {
554
+ return 1;
555
+ }
556
+ Operation* clone() const {
557
+ return new Sin();
558
+ }
559
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
560
+ return std::sin(args[0]);
561
+ }
562
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
563
+ };
564
+
565
+ class LEPTON_EXPORT Operation::Cos : public Operation {
566
+ public:
567
+ Cos() {
568
+ }
569
+ std::string getName() const {
570
+ return "cos";
571
+ }
572
+ Id getId() const {
573
+ return COS;
574
+ }
575
+ int getNumArguments() const {
576
+ return 1;
577
+ }
578
+ Operation* clone() const {
579
+ return new Cos();
580
+ }
581
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
582
+ return std::cos(args[0]);
583
+ }
584
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
585
+ };
586
+
587
+ class LEPTON_EXPORT Operation::Sec : public Operation {
588
+ public:
589
+ Sec() {
590
+ }
591
+ std::string getName() const {
592
+ return "sec";
593
+ }
594
+ Id getId() const {
595
+ return SEC;
596
+ }
597
+ int getNumArguments() const {
598
+ return 1;
599
+ }
600
+ Operation* clone() const {
601
+ return new Sec();
602
+ }
603
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
604
+ return 1.0/std::cos(args[0]);
605
+ }
606
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
607
+ };
608
+
609
+ class LEPTON_EXPORT Operation::Csc : public Operation {
610
+ public:
611
+ Csc() {
612
+ }
613
+ std::string getName() const {
614
+ return "csc";
615
+ }
616
+ Id getId() const {
617
+ return CSC;
618
+ }
619
+ int getNumArguments() const {
620
+ return 1;
621
+ }
622
+ Operation* clone() const {
623
+ return new Csc();
624
+ }
625
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
626
+ return 1.0/std::sin(args[0]);
627
+ }
628
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
629
+ };
630
+
631
+ class LEPTON_EXPORT Operation::Tan : public Operation {
632
+ public:
633
+ Tan() {
634
+ }
635
+ std::string getName() const {
636
+ return "tan";
637
+ }
638
+ Id getId() const {
639
+ return TAN;
640
+ }
641
+ int getNumArguments() const {
642
+ return 1;
643
+ }
644
+ Operation* clone() const {
645
+ return new Tan();
646
+ }
647
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
648
+ return std::tan(args[0]);
649
+ }
650
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
651
+ };
652
+
653
+ class LEPTON_EXPORT Operation::Cot : public Operation {
654
+ public:
655
+ Cot() {
656
+ }
657
+ std::string getName() const {
658
+ return "cot";
659
+ }
660
+ Id getId() const {
661
+ return COT;
662
+ }
663
+ int getNumArguments() const {
664
+ return 1;
665
+ }
666
+ Operation* clone() const {
667
+ return new Cot();
668
+ }
669
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
670
+ return 1.0/std::tan(args[0]);
671
+ }
672
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
673
+ };
674
+
675
+ class LEPTON_EXPORT Operation::Asin : public Operation {
676
+ public:
677
+ Asin() {
678
+ }
679
+ std::string getName() const {
680
+ return "asin";
681
+ }
682
+ Id getId() const {
683
+ return ASIN;
684
+ }
685
+ int getNumArguments() const {
686
+ return 1;
687
+ }
688
+ Operation* clone() const {
689
+ return new Asin();
690
+ }
691
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
692
+ return std::asin(args[0]);
693
+ }
694
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
695
+ };
696
+
697
+ class LEPTON_EXPORT Operation::Acos : public Operation {
698
+ public:
699
+ Acos() {
700
+ }
701
+ std::string getName() const {
702
+ return "acos";
703
+ }
704
+ Id getId() const {
705
+ return ACOS;
706
+ }
707
+ int getNumArguments() const {
708
+ return 1;
709
+ }
710
+ Operation* clone() const {
711
+ return new Acos();
712
+ }
713
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
714
+ return std::acos(args[0]);
715
+ }
716
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
717
+ };
718
+
719
+ class LEPTON_EXPORT Operation::Atan : public Operation {
720
+ public:
721
+ Atan() {
722
+ }
723
+ std::string getName() const {
724
+ return "atan";
725
+ }
726
+ Id getId() const {
727
+ return ATAN;
728
+ }
729
+ int getNumArguments() const {
730
+ return 1;
731
+ }
732
+ Operation* clone() const {
733
+ return new Atan();
734
+ }
735
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
736
+ return std::atan(args[0]);
737
+ }
738
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
739
+ };
740
+
741
+ class LEPTON_EXPORT Operation::Atan2 : public Operation {
742
+ public:
743
+ Atan2() {
744
+ }
745
+ std::string getName() const {
746
+ return "atan2";
747
+ }
748
+ Id getId() const {
749
+ return ATAN2;
750
+ }
751
+ int getNumArguments() const {
752
+ return 2;
753
+ }
754
+ Operation* clone() const {
755
+ return new Atan2();
756
+ }
757
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
758
+ return std::atan2(args[0], args[1]);
759
+ }
760
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
761
+ };
762
+
763
+ class LEPTON_EXPORT Operation::Sinh : public Operation {
764
+ public:
765
+ Sinh() {
766
+ }
767
+ std::string getName() const {
768
+ return "sinh";
769
+ }
770
+ Id getId() const {
771
+ return SINH;
772
+ }
773
+ int getNumArguments() const {
774
+ return 1;
775
+ }
776
+ Operation* clone() const {
777
+ return new Sinh();
778
+ }
779
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
780
+ return std::sinh(args[0]);
781
+ }
782
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
783
+ };
784
+
785
+ class LEPTON_EXPORT Operation::Cosh : public Operation {
786
+ public:
787
+ Cosh() {
788
+ }
789
+ std::string getName() const {
790
+ return "cosh";
791
+ }
792
+ Id getId() const {
793
+ return COSH;
794
+ }
795
+ int getNumArguments() const {
796
+ return 1;
797
+ }
798
+ Operation* clone() const {
799
+ return new Cosh();
800
+ }
801
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
802
+ return std::cosh(args[0]);
803
+ }
804
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
805
+ };
806
+
807
+ class LEPTON_EXPORT Operation::Tanh : public Operation {
808
+ public:
809
+ Tanh() {
810
+ }
811
+ std::string getName() const {
812
+ return "tanh";
813
+ }
814
+ Id getId() const {
815
+ return TANH;
816
+ }
817
+ int getNumArguments() const {
818
+ return 1;
819
+ }
820
+ Operation* clone() const {
821
+ return new Tanh();
822
+ }
823
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
824
+ return std::tanh(args[0]);
825
+ }
826
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
827
+ };
828
+
829
+ class LEPTON_EXPORT Operation::Erf : public Operation {
830
+ public:
831
+ Erf() {
832
+ }
833
+ std::string getName() const {
834
+ return "erf";
835
+ }
836
+ Id getId() const {
837
+ return ERF;
838
+ }
839
+ int getNumArguments() const {
840
+ return 1;
841
+ }
842
+ Operation* clone() const {
843
+ return new Erf();
844
+ }
845
+ double evaluate(double* args, const std::map<std::string, double>& variables) const;
846
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
847
+ };
848
+
849
+ class LEPTON_EXPORT Operation::Erfc : public Operation {
850
+ public:
851
+ Erfc() {
852
+ }
853
+ std::string getName() const {
854
+ return "erfc";
855
+ }
856
+ Id getId() const {
857
+ return ERFC;
858
+ }
859
+ int getNumArguments() const {
860
+ return 1;
861
+ }
862
+ Operation* clone() const {
863
+ return new Erfc();
864
+ }
865
+ double evaluate(double* args, const std::map<std::string, double>& variables) const;
866
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
867
+ };
868
+
869
+ class LEPTON_EXPORT Operation::Step : public Operation {
870
+ public:
871
+ Step() {
872
+ }
873
+ std::string getName() const {
874
+ return "step";
875
+ }
876
+ Id getId() const {
877
+ return STEP;
878
+ }
879
+ int getNumArguments() const {
880
+ return 1;
881
+ }
882
+ Operation* clone() const {
883
+ return new Step();
884
+ }
885
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
886
+ return (args[0] >= 0.0 ? 1.0 : 0.0);
887
+ }
888
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
889
+ };
890
+
891
+ class LEPTON_EXPORT Operation::Delta : public Operation {
892
+ public:
893
+ Delta() {
894
+ }
895
+ std::string getName() const {
896
+ return "delta";
897
+ }
898
+ Id getId() const {
899
+ return DELTA;
900
+ }
901
+ int getNumArguments() const {
902
+ return 1;
903
+ }
904
+ Operation* clone() const {
905
+ return new Delta();
906
+ }
907
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
908
+ return (args[0] == 0.0 ? 1.0/0.0 : 0.0);
909
+ }
910
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
911
+ };
912
+
913
+ class LEPTON_EXPORT Operation::Nandelta : public Operation {
914
+ public:
915
+ Nandelta() {
916
+ }
917
+ std::string getName() const {
918
+ return "nandelta";
919
+ }
920
+ Id getId() const {
921
+ return NANDELTA;
922
+ }
923
+ int getNumArguments() const {
924
+ return 1;
925
+ }
926
+ Operation* clone() const {
927
+ return new Nandelta();
928
+ }
929
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
930
+ return (args[0] == 0.0 ? std::numeric_limits<double>::quiet_NaN() : 0.0);
931
+ }
932
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
933
+ };
934
+
935
+ class LEPTON_EXPORT Operation::Square : public Operation {
936
+ public:
937
+ Square() {
938
+ }
939
+ std::string getName() const {
940
+ return "square";
941
+ }
942
+ Id getId() const {
943
+ return SQUARE;
944
+ }
945
+ int getNumArguments() const {
946
+ return 1;
947
+ }
948
+ Operation* clone() const {
949
+ return new Square();
950
+ }
951
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
952
+ return args[0]*args[0];
953
+ }
954
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
955
+ };
956
+
957
+ class LEPTON_EXPORT Operation::Cube : public Operation {
958
+ public:
959
+ Cube() {
960
+ }
961
+ std::string getName() const {
962
+ return "cube";
963
+ }
964
+ Id getId() const {
965
+ return CUBE;
966
+ }
967
+ int getNumArguments() const {
968
+ return 1;
969
+ }
970
+ Operation* clone() const {
971
+ return new Cube();
972
+ }
973
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
974
+ return args[0]*args[0]*args[0];
975
+ }
976
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
977
+ };
978
+
979
+ class LEPTON_EXPORT Operation::Reciprocal : public Operation {
980
+ public:
981
+ Reciprocal() {
982
+ }
983
+ std::string getName() const {
984
+ return "recip";
985
+ }
986
+ Id getId() const {
987
+ return RECIPROCAL;
988
+ }
989
+ int getNumArguments() const {
990
+ return 1;
991
+ }
992
+ Operation* clone() const {
993
+ return new Reciprocal();
994
+ }
995
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
996
+ return 1.0/args[0];
997
+ }
998
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
999
+ };
1000
+
1001
+ class LEPTON_EXPORT Operation::AddConstant : public Operation {
1002
+ public:
1003
+ AddConstant(double cvalue) : value(cvalue) {
1004
+ }
1005
+ std::string getName() const {
1006
+ std::stringstream name;
1007
+ name << value << "+";
1008
+ return name.str();
1009
+ }
1010
+ Id getId() const {
1011
+ return ADD_CONSTANT;
1012
+ }
1013
+ int getNumArguments() const {
1014
+ return 1;
1015
+ }
1016
+ Operation* clone() const {
1017
+ return new AddConstant(value);
1018
+ }
1019
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
1020
+ return args[0]+value;
1021
+ }
1022
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
1023
+ double getValue() const {
1024
+ return value;
1025
+ }
1026
+ bool operator!=(const Operation& op) const {
1027
+ const AddConstant* o = dynamic_cast<const AddConstant*>(&op);
1028
+ return (o == NULL || o->value != value);
1029
+ }
1030
+ private:
1031
+ double value;
1032
+ };
1033
+
1034
+ class LEPTON_EXPORT Operation::MultiplyConstant : public Operation {
1035
+ public:
1036
+ MultiplyConstant(double cvalue) : value(cvalue) {
1037
+ }
1038
+ std::string getName() const {
1039
+ std::stringstream name;
1040
+ name << value << "*";
1041
+ return name.str();
1042
+ }
1043
+ Id getId() const {
1044
+ return MULTIPLY_CONSTANT;
1045
+ }
1046
+ int getNumArguments() const {
1047
+ return 1;
1048
+ }
1049
+ Operation* clone() const {
1050
+ return new MultiplyConstant(value);
1051
+ }
1052
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
1053
+ return args[0]*value;
1054
+ }
1055
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
1056
+ double getValue() const {
1057
+ return value;
1058
+ }
1059
+ bool operator!=(const Operation& op) const {
1060
+ const MultiplyConstant* o = dynamic_cast<const MultiplyConstant*>(&op);
1061
+ return (o == NULL || o->value != value);
1062
+ }
1063
+ private:
1064
+ double value;
1065
+ };
1066
+
1067
+ class LEPTON_EXPORT Operation::PowerConstant : public Operation {
1068
+ public:
1069
+ PowerConstant(double cvalue) : value(cvalue) {
1070
+ intValue = (int) value;
1071
+ isIntPower = (intValue == value);
1072
+ }
1073
+ std::string getName() const {
1074
+ std::stringstream name;
1075
+ name << "^" << value;
1076
+ return name.str();
1077
+ }
1078
+ Id getId() const {
1079
+ return POWER_CONSTANT;
1080
+ }
1081
+ int getNumArguments() const {
1082
+ return 1;
1083
+ }
1084
+ Operation* clone() const {
1085
+ return new PowerConstant(value);
1086
+ }
1087
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
1088
+ if (isIntPower) {
1089
+ // Integer powers can be computed much more quickly by repeated multiplication.
1090
+
1091
+ int exponent = intValue;
1092
+ double base = args[0];
1093
+ if (exponent < 0) {
1094
+ exponent = -exponent;
1095
+ base = 1.0/base;
1096
+ }
1097
+ double result = 1.0;
1098
+ while (exponent != 0) {
1099
+ if ((exponent&1) == 1)
1100
+ result *= base;
1101
+ base *= base;
1102
+ exponent = exponent>>1;
1103
+ }
1104
+ return result;
1105
+ }
1106
+ else
1107
+ return std::pow(args[0], value);
1108
+ }
1109
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
1110
+ double getValue() const {
1111
+ return value;
1112
+ }
1113
+ bool operator!=(const Operation& op) const {
1114
+ const PowerConstant* o = dynamic_cast<const PowerConstant*>(&op);
1115
+ return (o == NULL || o->value != value);
1116
+ }
1117
+ bool isInfixOperator() const {
1118
+ return true;
1119
+ }
1120
+ private:
1121
+ double value;
1122
+ int intValue;
1123
+ bool isIntPower;
1124
+ };
1125
+
1126
+ class LEPTON_EXPORT Operation::Min : public Operation {
1127
+ public:
1128
+ Min() {
1129
+ }
1130
+ std::string getName() const {
1131
+ return "min";
1132
+ }
1133
+ Id getId() const {
1134
+ return MIN;
1135
+ }
1136
+ int getNumArguments() const {
1137
+ return 2;
1138
+ }
1139
+ Operation* clone() const {
1140
+ return new Min();
1141
+ }
1142
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
1143
+ // parens around (std::min) are workaround for horrible microsoft max/min macro trouble
1144
+ return (std::min)(args[0], args[1]);
1145
+ }
1146
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
1147
+ };
1148
+
1149
+ class LEPTON_EXPORT Operation::Max : public Operation {
1150
+ public:
1151
+ Max() {
1152
+ }
1153
+ std::string getName() const {
1154
+ return "max";
1155
+ }
1156
+ Id getId() const {
1157
+ return MAX;
1158
+ }
1159
+ int getNumArguments() const {
1160
+ return 2;
1161
+ }
1162
+ Operation* clone() const {
1163
+ return new Max();
1164
+ }
1165
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
1166
+ // parens around (std::min) are workaround for horrible microsoft max/min macro trouble
1167
+ return (std::max)(args[0], args[1]);
1168
+ }
1169
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
1170
+ };
1171
+
1172
+ class LEPTON_EXPORT Operation::Abs : public Operation {
1173
+ public:
1174
+ Abs() {
1175
+ }
1176
+ std::string getName() const {
1177
+ return "abs";
1178
+ }
1179
+ Id getId() const {
1180
+ return ABS;
1181
+ }
1182
+ int getNumArguments() const {
1183
+ return 1;
1184
+ }
1185
+ Operation* clone() const {
1186
+ return new Abs();
1187
+ }
1188
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
1189
+ return std::abs(args[0]);
1190
+ }
1191
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
1192
+ };
1193
+
1194
+ class LEPTON_EXPORT Operation::Floor : public Operation {
1195
+ public:
1196
+
1197
+ Floor() {
1198
+ }
1199
+ std::string getName() const {
1200
+ return "floor";
1201
+ }
1202
+ Id getId() const {
1203
+ return FLOOR;
1204
+ }
1205
+ int getNumArguments() const {
1206
+ return 1;
1207
+ }
1208
+ Operation* clone() const {
1209
+ return new Floor();
1210
+ }
1211
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
1212
+ return std::floor(args[0]);
1213
+ }
1214
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
1215
+ };
1216
+
1217
+ class LEPTON_EXPORT Operation::Ceil : public Operation {
1218
+ public:
1219
+ Ceil() {
1220
+ }
1221
+ std::string getName() const {
1222
+ return "ceil";
1223
+ }
1224
+ Id getId() const {
1225
+ return CEIL;
1226
+ }
1227
+ int getNumArguments() const {
1228
+ return 1;
1229
+ }
1230
+ Operation* clone() const {
1231
+ return new Ceil();
1232
+ }
1233
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
1234
+ return std::ceil(args[0]);
1235
+ }
1236
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
1237
+ };
1238
+
1239
+ class LEPTON_EXPORT Operation::Select : public Operation {
1240
+ public:
1241
+ Select() {
1242
+ }
1243
+ std::string getName() const {
1244
+ return "select";
1245
+ }
1246
+ Id getId() const {
1247
+ return SELECT;
1248
+ }
1249
+ int getNumArguments() const {
1250
+ return 3;
1251
+ }
1252
+ Operation* clone() const {
1253
+ return new Select();
1254
+ }
1255
+ double evaluate(double* args, const std::map<std::string, double>& variables) const {
1256
+ return (args[0] != 0.0 ? args[1] : args[2]);
1257
+ }
1258
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
1259
+ };
1260
+
1261
+ #define LEPTON_CLASS_OPERATION(Name,name,NAME,nargs,impl) \
1262
+ class LEPTON_EXPORT Operation::Name : public Operation { \
1263
+ public: \
1264
+ Name() { \
1265
+ } \
1266
+ std::string getName() const { \
1267
+ return #name; \
1268
+ } \
1269
+ Id getId() const { \
1270
+ return NAME; \
1271
+ } \
1272
+ int getNumArguments() const { \
1273
+ return nargs; \
1274
+ } \
1275
+ Operation* clone() const { \
1276
+ return new Name(); \
1277
+ } \
1278
+ double evaluate(double* args, const std::map<std::string, double>& variables) const { \
1279
+ return impl; \
1280
+ } \
1281
+ ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const; \
1282
+ }
1283
+
1284
+ LEPTON_CLASS_OPERATION(Acot,acot,ACOT,1,std::atan(1.0/args[0]));
1285
+ LEPTON_CLASS_OPERATION(Asec,asec,ASEC,1,std::acos(1.0/args[0]));
1286
+ LEPTON_CLASS_OPERATION(Acsc,acsc,ACSC,1,std::asin(1.0/args[0]));
1287
+ LEPTON_CLASS_OPERATION(Coth,coth,ACOT,1,1.0/std::tanh(args[0]));
1288
+ LEPTON_CLASS_OPERATION(Sech,sech,SECH,1,1.0/std::cosh(args[0]));
1289
+ LEPTON_CLASS_OPERATION(Csch,csch,CSCH,1,1.0/std::sinh(args[0]));
1290
+
1291
+ LEPTON_CLASS_OPERATION(Asinh,asinh,ASINH,1,std::asinh(args[0]));
1292
+ LEPTON_CLASS_OPERATION(Acosh,acosh,ACOSH,1,std::acosh(args[0]));
1293
+ LEPTON_CLASS_OPERATION(Atanh,atanh,ATANH,1,std::atanh(args[0]));
1294
+
1295
+ LEPTON_CLASS_OPERATION(Acoth,acoth,ACOTH,1,0.5*std::log((args[0]+1.0)/(args[0]-1.0)));
1296
+ LEPTON_CLASS_OPERATION(Asech,asech,ASECH,1,std::log(std::sqrt(1.0/args[0]-1.0)*std::sqrt(1.0/args[0]+1.0)+1.0/args[0]));
1297
+ LEPTON_CLASS_OPERATION(Acsch,acsch,ACSCH,1,std::log(1.0/args[0]+std::sqrt(1.0/(args[0]*args[0])+1.0)));
1298
+
1299
+ } // namespace lepton
1300
+ } // namespace PLMD
1301
+
1302
+ #endif /*LEPTON_OPERATION_H_*/