Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
80a36e4c
Commit
80a36e4c
authored
Jul 15, 2010
by
Christopher Bruns
Browse files
MSVC does not support C99 struct initialization syntax. Workaround.
parent
56f05a6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
openmmapi/src/LocalEnergyMinimizer.cpp
openmmapi/src/LocalEnergyMinimizer.cpp
+5
-3
No files found.
openmmapi/src/LocalEnergyMinimizer.cpp
View file @
80a36e4c
...
...
@@ -40,10 +40,12 @@
using
namespace
OpenMM
;
using
namespace
std
;
typedef
struct
{
struct
MinimizerData
{
Context
&
context
;
double
k
;
}
MinimizerData
;
MinimizerData
(
Context
&
context
,
double
k
)
:
context
(
context
),
k
(
k
)
{}
};
static
lbfgsfloatval_t
evaluate
(
void
*
instance
,
const
lbfgsfloatval_t
*
x
,
lbfgsfloatval_t
*
g
,
const
int
n
,
const
lbfgsfloatval_t
step
)
{
MinimizerData
*
data
=
reinterpret_cast
<
MinimizerData
*>
(
instance
);
...
...
@@ -134,7 +136,7 @@ void LocalEnergyMinimizer::minimize(Context& context, double tolerance, int maxI
// Perform the minimization.
lbfgsfloatval_t
fx
;
MinimizerData
data
=
(
MinimizerData
)
{
context
,
k
}
;
MinimizerData
data
(
context
,
k
)
;
lbfgs
(
numParticles
*
3
,
x
,
&
fx
,
evaluate
,
NULL
,
&
data
,
&
param
);
// Check whether all constraints are satisfied.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment