130 lines
3.6 KiB
Diff
130 lines
3.6 KiB
Diff
diff -up wrk/ode-initval2/msbdf.c.wrk wrk/ode-initval2/msbdf.c
|
|
--- wrk/ode-initval2/msbdf.c.wrk 2013-01-09 10:35:45.259960403 +0100
|
|
+++ wrk/ode-initval2/msbdf.c 2013-01-17 15:16:29.529656745 +0100
|
|
@@ -116,7 +116,6 @@ static void *
|
|
msbdf_alloc (size_t dim)
|
|
{
|
|
msbdf_state_t *state = (msbdf_state_t *) malloc (sizeof (msbdf_state_t));
|
|
-
|
|
if (state == 0)
|
|
{
|
|
GSL_ERROR_NULL ("failed to allocate space for msbdf_state", GSL_ENOMEM);
|
|
@@ -461,6 +460,7 @@ msbdf_failurehandler (void *vstate, cons
|
|
has occurred at this order and point.
|
|
*/
|
|
|
|
+printf("ALOKUJEEEEEEEEEEEEEEEEEEEEEEEEEEM\n");
|
|
msbdf_state_t *state = (msbdf_state_t *) vstate;
|
|
|
|
const size_t ord = state->ord;
|
|
diff -up wrk/ode-initval2/test.c.wrk wrk/ode-initval2/test.c
|
|
--- wrk/ode-initval2/test.c.wrk 2013-01-09 10:48:22.051415928 +0100
|
|
+++ wrk/ode-initval2/test.c 2013-01-17 15:12:31.666983138 +0100
|
|
@@ -923,6 +923,18 @@ rhs_ringmod (double t, const double y[],
|
|
f[13] = (-y[0] + uin1 - (ri + rg1) * y[13]) / ls1;
|
|
f[14] = (-y[1] - (rc + rg1) * y[14]) / ls1;
|
|
|
|
+ /*int i;
|
|
+ printf("temp states\n");
|
|
+ for (i=0; i<15; ++i) {
|
|
+
|
|
+ printf("%lu\n", *((unsigned long *)(&(y[i]))));
|
|
+ }
|
|
+
|
|
+ printf("%lu\n", *((unsigned long *)(&(rg2))));
|
|
+ printf("%lu\n", *((unsigned long *)(&(ls2))));
|
|
+ printf("%lu\n", *((unsigned long *)(&(rg3))));
|
|
+ printf("%lu\n", *((unsigned long *)(&(ls3))));
|
|
+*/
|
|
return GSL_SUCCESS;
|
|
}
|
|
|
|
@@ -1264,10 +1276,19 @@ sys_driver (const gsl_odeiv2_step_type *
|
|
nfe = 0;
|
|
nje = 0;
|
|
|
|
+ int poc=0;
|
|
while (t < t1)
|
|
{
|
|
s = gsl_odeiv2_evolve_apply (d->e, d->c, d->s, sys, &t, t1, &h, y);
|
|
-
|
|
+/*
|
|
+ printf("\nkrok %d\n", ++poc);
|
|
+ int k;
|
|
+ for (k=0; k<15; ++k) {
|
|
+ printf(" %lu\n",(*(unsigned long int *)(&(y[k]))));
|
|
+ }
|
|
+ printf(" %lu\n",(*(unsigned long int *)(&t)));
|
|
+*/
|
|
+ //printf("\n");
|
|
#ifdef DEBUG
|
|
printf ("%.5e %.5e %.5e %d\n", t, y[0], y[1],
|
|
gsl_odeiv2_step_order (d->s));
|
|
@@ -1959,7 +1980,7 @@ test_extreme_problems (void)
|
|
|
|
/* Loop over problems */
|
|
|
|
- for (p = 0; p < CONST_EXTREME_NPROB; p++)
|
|
+ for (p = 2; p < CONST_EXTREME_NPROB; p++)
|
|
{
|
|
/* Initialize */
|
|
|
|
@@ -2001,12 +2022,13 @@ test_extreme_problems (void)
|
|
|
|
/* Call each solver for the problem */
|
|
|
|
- for (i = 0; steppers[i] != 0; i++)
|
|
+ for (i = 1; steppers[i] != 0; i++)
|
|
{
|
|
+ printf("spustam driver p=%ld i=%ld\n", p, i);
|
|
int s = sys_driver (steppers[i], prob[p], start[p], end[p],
|
|
initstepsize[p], &y[sd[p] * i],
|
|
epsabs[p], epsrel[p], probname[p]);
|
|
-
|
|
+ printf("koniec drivera\n");
|
|
if (s != GSL_SUCCESS)
|
|
{
|
|
printf ("start=%.5e, initstepsize=%.5e\n", start[p],
|
|
@@ -2450,7 +2472,7 @@ main (void)
|
|
|
|
/* Basic tests for all steppers */
|
|
|
|
- for (i = 0; p[i].type != 0; i++)
|
|
+ /*for (i = 0; p[i].type != 0; i++)
|
|
{
|
|
test_stepper (p[i].type);
|
|
}
|
|
@@ -2469,9 +2491,9 @@ main (void)
|
|
test_stepsize_fail (p[i].type, p[i].h);
|
|
test_user_break (p[i].type, p[i].h);
|
|
}
|
|
-
|
|
+*/
|
|
/* Derivative test for explicit steppers */
|
|
-
|
|
+/*
|
|
explicit_stepper[0].type = gsl_odeiv2_step_rk4;
|
|
explicit_stepper[0].h = 1.0e-3;
|
|
explicit_stepper[1].type = gsl_odeiv2_step_rk2;
|
|
@@ -2491,16 +2513,16 @@ main (void)
|
|
test_stepfn (explicit_stepper[i].type);
|
|
test_stepfn2 (explicit_stepper[i].type);
|
|
}
|
|
-
|
|
+*/
|
|
/* Special tests */
|
|
|
|
- test_nonstiff_problems ();
|
|
+ // test_nonstiff_problems ();
|
|
|
|
- test_stiff_problems ();
|
|
+ // test_stiff_problems ();
|
|
|
|
test_extreme_problems ();
|
|
|
|
- test_driver ();
|
|
+ //test_driver ();
|
|
|
|
exit (gsl_test_summary ());
|
|
}
|