Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 14, 2024
1 parent 87c7441 commit dc60164
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions galpy/util/wez_ias15.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void wez_ias15(void (*func)(double t, double *q, double *a, int nargs, struct po
} else {
timestep_sign = -1;

Check warning on line 268 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L268

Added line #L268 was not covered by tests
}

double to= *t;

Check warning on line 271 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L271

Added line #L271 was not covered by tests
// Handle KeyboardInterrupt gracefully
#ifndef _WIN32
Expand Down Expand Up @@ -411,7 +411,7 @@ void wez_ias15(void (*func)(double t, double *q, double *a, int nargs, struct po
//result+= 2 * dim;

steps += 1;

Check warning on line 413 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L413

Added line #L413 was not covered by tests

if(steps > maxsteps){ //dynamic arrays must be increased
printf("...RESIZING ARRAY...\n");

Check warning on line 416 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L416

Added line #L416 was not covered by tests
//break;
Expand All @@ -420,7 +420,7 @@ void wez_ias15(void (*func)(double t, double *q, double *a, int nargs, struct po
double *x_steps_new = (double *) malloc ( dim * (2 * maxsteps + 1) * sizeof(double) );
double *v_steps_new = (double *) malloc ( dim * (2 * maxsteps + 1) * sizeof(double) );
double *t_steps_new = (double *) malloc ( (2 * maxsteps + 1) * sizeof(double) );

Check warning on line 422 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L420-L422

Added lines #L420 - L422 were not covered by tests

for(int k = 0; k < steps; k += 1){
t_steps_new[k] = t_steps[k];

Check warning on line 425 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L425

Added line #L425 was not covered by tests
for(ii = 0; ii < dim; ii += 1){
Expand All @@ -439,20 +439,20 @@ void wez_ias15(void (*func)(double t, double *q, double *a, int nargs, struct po
v_steps = v_steps_new;
t_steps = t_steps_new;

Check warning on line 440 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L433-L440

Added lines #L433 - L440 were not covered by tests
}

//printf("END OF STEP: %d\n", steps);
//printf("STEP SIZE: %f\n", fabs(dt));
save_dummy_ias15(dim, x, v, t_steps[steps - 1] + fabs(dt), x_steps, v_steps, t_steps, steps, maxsteps);

Check warning on line 445 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L445

Added line #L445 was not covered by tests
//finally, update the next step

dt = dt_required;

Check warning on line 448 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L448

Added line #L448 was not covered by tests
//dt = 0.028;
}
}

printf("We have max %d steps\n", maxsteps);
printf("We have taken: %d steps\n", steps);

Check warning on line 454 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L453-L454

Added lines #L453 - L454 were not covered by tests

double *t_steps_short = (double *) malloc ( (steps + 1) * sizeof(double) );

Check warning on line 456 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L456

Added line #L456 was not covered by tests
//t_steps = realloc(t_steps, (steps + 1) * sizeof(double));

Expand Down Expand Up @@ -656,4 +656,4 @@ static double seventhroot(double a){
x += (a/x6-x)/7.;

Check warning on line 656 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L655-L656

Added lines #L655 - L656 were not covered by tests
}
return x*scale;

Check warning on line 658 in galpy/util/wez_ias15.c

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.c#L658

Added line #L658 was not covered by tests
}
}
4 changes: 2 additions & 2 deletions galpy/util/wez_ias15.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ static inline void save_ias15(int dim, double *x_steps, double *v_steps, double

gsl_interp_accel *acc_v = gsl_interp_accel_alloc();
gsl_spline *spline_v = gsl_spline_alloc(gsl_interp_cspline, (steps + 1));

Check warning on line 72 in galpy/util/wez_ias15.h

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.h#L71-L72

Added lines #L71 - L72 were not covered by tests
for (ii=0; ii < dim; ii++){

for (ii=0; ii < dim; ii++){
memcpy(x_steps_short, &x_steps[ii * (maxsteps + 1)], (steps + 1) * sizeof(double));
memcpy(v_steps_short, &v_steps[ii * (maxsteps + 1)], (steps + 1) * sizeof(double));

Check warning on line 76 in galpy/util/wez_ias15.h

View check run for this annotation

Codecov / codecov/patch

galpy/util/wez_ias15.h#L75-L76

Added lines #L75 - L76 were not covered by tests

Expand Down

0 comments on commit dc60164

Please sign in to comment.