Permalink
Browse files

Added access to all step types, need to redo some POD

  • Loading branch information...
1 parent 8207fc1 commit 8b4d996963343b2ed153915ddde4ef8c314be012 @jberger committed Aug 24, 2011
Showing with 35 additions and 8 deletions.
  1. +23 −1 ODEIV2.xs
  2. +11 −6 lib/Math/GSLx/ODEIV2.pm
  3. +1 −1 t/sine.t
View
@@ -256,9 +256,31 @@ SV* c_ode_solver
case 6:
if (has_jacobian == 0)
warn ("The specified step type requires the Jacobian");
-
+ step_type = gsl_odeiv2_step_rk1imp;
+ break;
+ case 7:
+ if (has_jacobian == 0)
+ warn ("The specified step type requires the Jacobian");
+ step_type = gsl_odeiv2_step_rk2imp;
+ break;
+ case 8:
+ if (has_jacobian == 0)
+ warn ("The specified step type requires the Jacobian");
+ step_type = gsl_odeiv2_step_rk4imp;
+ break;
+ case 9:
+ if (has_jacobian == 0)
+ warn ("The specified step type requires the Jacobian");
step_type = gsl_odeiv2_step_bsimp;
break;
+ case 10:
+ step_type = gsl_odeiv2_step_msadams;
+ break;
+ case 11:
+ if (has_jacobian == 0)
+ warn ("The specified step type requires the Jacobian");
+ step_type = gsl_odeiv2_step_msbdf;
+ break;
default:
warn("Could not determine step type, using rk8pd");
step_type = gsl_odeiv2_step_rk8pd;
View
@@ -23,12 +23,17 @@ require XSLoader;
XSLoader::load('Math::GSLx::ODEIV2', $VERSION);
my %step_types = (
- rk2 => 1,
- rk4 => 2,
- rkf45 => 3,
- rkck => 4,
- rk8pd => 5,
- bsimp => 6,
+ rk2 => 1,
+ rk4 => 2,
+ rkf45 => 3,
+ rkck => 4,
+ rk8pd => 5,
+ rk1imp_j => 6,
+ rk2imp_j => 7,
+ rk4imp_j => 8,
+ bsimp_j => 9,
+ msadams => 10,
+ msbdf_j => 11,
);
sub ode_solver {
View
@@ -47,7 +47,7 @@ sub eqn {
foreach my $step_type (get_step_types()) {
#skip steps which require Jacobian
- next if ($step_type eq 'bsimp');
+ next if ($step_type =~ /_j$/);
my $type_sin = ode_solver(\&eqn, [0, 2*3.14, 100], {type => $step_type});
my ($type_pi_by_2) = grep { sprintf("%.2f", $_->[0]) == 1.57 } @$type_sin;

0 comments on commit 8b4d996

Please sign in to comment.