Mercurial > octave
changeset 22660:7eb3f8ec1aed stable
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.
author | Carlo de Falco <carlo.defalco@polimi.it> |
---|---|
date | Mon, 24 Oct 2016 12:17:30 +0200 |
parents | 04fc7e9c5f96 |
children | c00578ac8dda |
files | scripts/ode/ode23.m scripts/ode/ode45.m |
diffstat | 2 files changed, 39 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ode/ode23.m Sun Oct 23 22:03:20 2016 -0700 +++ b/scripts/ode/ode23.m Mon Oct 24 12:17:30 2016 +0200 @@ -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 = ... + {"BDF", "InitialSlope", "Jacobian", "JPattern", + "MassSingular", "MaxOrder", "MvPattern", "Vectorized"}; + + 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); @@ -331,12 +329,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 @@ -483,10 +475,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: +## +## "BDF" +## "InitialSlope" +## "JPattern" +## "Jacobian" +## "MassSingular" +## "MaxOrder" +## "MvPattern" +## "Vectorized" %!test # Check that imaginary part of solution does not get inverted %! sol = ode23 (@(x,y) 1, [0 1], 1i);
--- a/scripts/ode/ode45.m Sun Oct 23 22:03:20 2016 -0700 +++ b/scripts/ode/ode45.m Mon Oct 24 12:17:30 2016 +0200 @@ -147,16 +147,16 @@ [defaults, classes, attributes] = odedefaults (numel (init), trange(1), trange(end)); - 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"}); + ## FIXME: Refine is not correctly implemented yet + defaults = odeset (defaults, "Refine", 4); + + persistent ode45_ignore_options = ... + {"BDF", "InitialSlope", "Jacobian", "JPattern", + "MassSingular", "MaxOrder", "MvPattern", "Vectorized"}; + + 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); @@ -322,12 +322,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 @@ -491,10 +485,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: +## +## "BDF" +## "InitialSlope" +## "JPattern" +## "Jacobian" +## "MassSingular" +## "MaxOrder" +## "MvPattern" +## "Vectorized" %!test # Check that imaginary part of solution does not get inverted %! sol = ode45 (@(x,y) 1, [0 1], 1i);