Skip to content

Commit 37558ae

Browse files
authored
1189 Ensure zero initialization for AD example (#1190)
1 parent adc7c49 commit 37558ae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cpp/examples/ad_odeint_example.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ int main()
5656
x[0] = 1.0; // start at x=1.0, p=0.0
5757
x[1] = 0.0;
5858
ad::derivative(x[0]) = 1.0; // compute derivative with respect to x[0] (scalar tangent-linear mode)
59+
ad::derivative(x[0]) = 0.0;
5960

6061
auto t0 = time_type(0.0); // initial time
6162
auto t_end = time_type(10.0); // stop time

0 commit comments

Comments
 (0)