Skip to content

Instantly share code, notes, and snippets.

View ajasja's full-sized avatar

Ajasja Ljubetič ajasja

View GitHub Profile
@ajasja
ajasja / tpcolvars-ok
Created January 31, 2012 13:53
Theta and phi colvars
colvarsTrajFrequency 50
colvarsRestartFrequency 50000
colvar {
name theta
width 1
lowerboundary 20
upperboundary 160
lowerWallConstant 10
upperWallConstant 10
00233 cvm::fatal_error ("Error: the atom group \""+
00234 std::string (key)+"\" has already a reference group "
00235 "for the rototranslational fit, which was communicated by the "
00236 "colvar component. You should not use refPositionsGroup "
00237 "in this case.\n");
CRYST1 0.000 0.000 0.000 90.00 90.00 90.00 P 1 1
ATOM 1 N ALA P 1 0.201 1.256 -26.667 1.00 1.00 P N
ATOM 2 HT1 ALA P 1 0.493 1.913 -27.418 0.00 0.00 P H
ATOM 3 HT2 ALA P 1 0.074 0.305 -27.067 0.00 0.00 P H
ATOM 4 HT3 ALA P 1 0.931 1.227 -25.927 0.00 0.00 P H
ATOM 5 CA ALA P 1 -1.080 1.718 -26.078 1.00 1.00 P C
ATOM 6 HA ALA P 1 -0.902 2.700 -25.665 1.00 0.00 P H
ATOM 7 CB ALA P 1 -2.173 1.787 -27.166 1.00 0.00 P C
ATOM 8 HB1 ALA P 1 -3.135 2.133 -26.730 1.00 0.00 P H
ATOM 9 HB2 ALA P 1 -1.878 2.509 -27.957 1.00 0.00 P H
CRYST1 0.000 0.000 0.000 90.00 90.00 90.00 P 1 1
ATOM 1 N R1A P 18 0.996 -1.268 -0.798 1.00 1.00 P N
ATOM 2 CA R1A P 18 2.046 -0.803 0.079 1.00 1.00 P C
ATOM 3 CB R1A P 18 3.163 -0.061 -0.699 1.00 0.00 P C
ATOM 4 C R1A P 18 1.494 0.121 1.139 1.00 1.00 P C
ATOM 5 O R1A P 18 1.885 0.042 2.301 1.00 1.00 P O
END
(*Original implementation*)
MakeInPeriodicCellOrig =
Compile[{x, cellwidth},
First@Sort[{x, x - cellwidth, x + cellwidth},
Abs[#1] < Abs[#2] &], {{Sort[_], _Real}},
CompilationOptions -> {"ExpressionOptimization" -> True,
"InlineCompiledFunctions" -> True,
"InlineExternalDefinitions" -> True},
RuntimeAttributes -> {Listable},
"RuntimeOptions" -> "Speed"
@ajasja
ajasja / gist:2627215
Created May 7, 2012 10:51
NelderMeadMinimize`Dump`CompiledNelderMead
(* Produces compiled code for the Nelder-Mead algorithm with the objective function inlined. *)
(* The objective function takes the form F[parametersToOptimize..,constantParameters] *)
NelderMeadMinimize`Dump`CompiledNelderMead[
objectiveFunction_Function | objectiveFunction_CompiledFunction, vars : {__Symbol}, const: {__Symbol},
opts : OptionsPattern[NelderMeadMinimize`Dump`CompiledNelderMead]
] :=
NelderMeadMinimize`Dump`CompiledNelderMead[
objectiveFunction, vars, const
opts
] =
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.