# HG changeset patch # User Carlo de Falco # Date 1477304250 -7200 # Mon Oct 24 12:17:30 2016 +0200 # Branch stable # Node ID 416cefecb811bc0713868ae637795edc9397ae85 # Parent 6b134d294d61aaf27ea3e1c4ca060d2c4eb7d5d0 Remove FIXME comment about missing tests for ignored ODE options. * scripts/ode/ode{23,45}.m : remove tests for BIST options that are ignored by the solvers. diff --git a/scripts/ode/ode23.m b/scripts/ode/ode23.m --- a/scripts/ode/ode23.m +++ b/scripts/ode/ode23.m @@ -156,15 +156,13 @@ [defaults, classes, attributes] = odedefaults (numel (init), trange(1), trange(end)); - defaults = rmfield (defaults, {"Jacobian", "JPattern", "Vectorized", ... - "MvPattern", "MassSingular", ... - "InitialSlope", "MaxOrder", "BDF"}); - classes = rmfield (classes, {"Jacobian", "JPattern", "Vectorized", ... - "MvPattern", "MassSingular", ... - "InitialSlope", "MaxOrder", "BDF"}); - attributes = rmfield (attributes, {"Jacobian", "JPattern", "Vectorized", ... - "MvPattern", "MassSingular", ... - "InitialSlope", "MaxOrder", "BDF"}); + persistent ode23_ignore_options = ... + {"Jacobian", "JPattern", "Vectorized", "MvPattern", ... + "MassSingular", "InitialSlope", "MaxOrder", "BDF"}; + + defaults = rmfield (defaults, ode23_ignore_options); + classes = rmfield (classes, ode23_ignore_options); + attributes = rmfield (attributes, ode23_ignore_options); odeopts = odemergeopts ("ode23", odeopts, defaults, classes, attributes); @@ -322,12 +320,6 @@ %!function ref = fref () # The computed reference sol %! ref = [0.32331666704577, -1.83297456798624]; %!endfunction -%!function jac = fjac (t, y, varargin) # its Jacobian -%! jac = [0, 1; -1 - 2 * y(1) * y(2), 1 - y(1)^2]; -%!endfunction -%!function jac = fjcc (t, y, varargin) # sparse type -%! jac = sparse ([0, 1; -1 - 2 * y(1) * y(2), 1 - y(1)^2]); -%!endfunction %!function [val, trm, dir] = feve (t, y, varargin) %! val = fpol (t, y, varargin); # We use the derivatives %! trm = zeros (2,1); # that's why component 2 @@ -474,10 +466,17 @@ %! sol = ode23 (@fpol, [0 2], [2 0], opt); %! assert ([sol.x(end); sol.y(:,end)], [2; fref'], 1e-3); -## FIXME: Missing tests. -## test for InitialSlope option is missing -## test for MaxOrder option is missing -## test for MvPattern option is missing +## Note: The following options have no effect on this solver +## therefore it makes no sense to test them here: +## +## "Jacobian" +## "JPattern" +## "Vectorized" +## "MvPattern" +## "MassSingular" +## "InitialSlope" +## "MaxOrder" +## "BDF" %!test # Check that imaginary part of solution does not get inverted %! sol = ode23 (@(x,y) 1, [0 1], 1i); diff --git a/scripts/ode/ode45.m b/scripts/ode/ode45.m --- a/scripts/ode/ode45.m +++ b/scripts/ode/ode45.m @@ -147,16 +147,16 @@ [defaults, classes, attributes] = odedefaults (numel (init), trange(1), trange(end)); + ## FIXME: Refine is not correctly implemented yet defaults = odeset (defaults, "Refine", 4); - defaults = rmfield (defaults, {"Jacobian", "JPattern", "Vectorized", ... - "MvPattern", "MassSingular", ... - "InitialSlope", "MaxOrder", "BDF"}); - classes = rmfield (classes, {"Jacobian", "JPattern", "Vectorized", ... - "MvPattern", "MassSingular", ... - "InitialSlope", "MaxOrder", "BDF"}); - attributes = rmfield (attributes, {"Jacobian", "JPattern", "Vectorized", ... - "MvPattern", "MassSingular", ... - "InitialSlope", "MaxOrder", "BDF"}); + + persistent ode45_ignore_options = ... + {"Jacobian", "JPattern", "Vectorized", "MvPattern", ... + "MassSingular", "InitialSlope", "MaxOrder", "BDF"}; + + defaults = rmfield (defaults, ode45_ignore_options); + classes = rmfield (classes, ode45_ignore_options); + attributes = rmfield (attributes, ode45_ignore_options); odeopts = odemergeopts ("ode45", odeopts, defaults, classes, attributes); @@ -313,12 +313,6 @@ %!function ref = fref () # The computed reference solution %! ref = [0.32331666704577, -1.83297456798624]; %!endfunction -%!function jac = fjac (t, y, varargin) # its Jacobian -%! jac = [0, 1; -1 - 2 * y(1) * y(2), 1 - y(1)^2]; -%!endfunction -%!function jac = fjcc (t, y, varargin) # sparse type -%! jac = sparse ([0, 1; -1 - 2 * y(1) * y(2), 1 - y(1)^2]); -%!endfunction %!function [val, trm, dir] = feve (t, y, varargin) %! val = fpol (t, y, varargin); # We use the derivatives %! trm = zeros (2,1); # that's why component 2 @@ -482,10 +476,17 @@ %! sol = ode45 (@fpol, [0 2], [2 0], opt); %! assert ([sol.x(end); sol.y(:,end)], [2; fref'], 1e-3); -## FIXME: Missing tests. -## test for InitialSlope option is missing -## test for MaxOrder option is missing -## test for MvPattern option is missing +## Note: The following options have no effect on this solver +## therefore it makes no sense to test them here: +## +## "Jacobian" +## "JPattern" +## "Vectorized" +## "MvPattern" +## "MassSingular" +## "InitialSlope" +## "MaxOrder" +## "BDF" %!test # Check that imaginary part of solution does not get inverted %! sol = ode45 (@(x,y) 1, [0 1], 1i);