Skip to content

Commit d577f19

Browse files
LegalizeAdulthoodmborland
authored andcommitted
Use x.data instead of x.begin when doing pointer arithmetic
Fixes #93
1 parent 2875284 commit d577f19

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/chaotic_system.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ void lorenz_with_lyap( const state_type &x , state_type &dxdt , double t )
6161

6262
for( size_t l=0 ; l<num_of_lyap ; ++l )
6363
{
64-
const double *pert = x.begin() + 3 + l * 3;
65-
double *dpert = dxdt.begin() + 3 + l * 3;
64+
const double *pert = x.data() + 3 + l * 3;
65+
double *dpert = dxdt.data() + 3 + l * 3;
6666
dpert[0] = - sigma * pert[0] + 10.0 * pert[1];
6767
dpert[1] = ( R - x[2] ) * pert[0] - pert[1] - x[0] * pert[2];
6868
dpert[2] = x[1] * pert[0] + x[0] * pert[1] - b * pert[2];

0 commit comments

Comments
 (0)