~ubuntu-branches/ubuntu/natty/octave-odepkg/natty

« back to all changes in this revision

Viewing changes to inst/odepkg_structure_check.m

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Weber
  • Date: 2010-05-16 20:37:31 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100516203731-a9rey8g4kfkbt3jc
Tags: 0.6.10-1
* New upstream release
* debian/control:
  - Remove Rafael Laboissiere from Uploaders (Closes: #571858)
  - Remove Ólafur Jens Sigurðsson <ojsbug@gmail.com> from Uploaders
* Bump Standards-Version to 3.8.4, no changes needed
* Switch to dpkg-source 3.0 (quilt) format
* Dropped patch fix-test (applied upstream)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%# Copyright (C) 2006-2008, Thomas Treichl <treichl@users.sourceforge.net>
 
1
%# Copyright (C) 2006-2009, Thomas Treichl <treichl@users.sourceforge.net>
2
2
%# OdePkg - A package for solving ordinary differential equations and more
3
3
%#
4
4
%# This program is free software; you can redistribute it and/or modify
275
275
        end
276
276
 
277
277
      case 'BDF'
278
 
        if (strcmp (vret.(vfld{vcntarg}), 'on') || ...
279
 
            strcmp (vret.(vfld{vcntarg}), 'off'))
 
278
        if (isempty (vret.(vfld{vcntarg})) || ...
 
279
            (strcmp (vret.(vfld{vcntarg}), 'on') || ...
 
280
             strcmp (vret.(vfld{vcntarg}), 'off')))
 
281
        else
 
282
          error ('OdePkg:InvalidParameter', ...
 
283
            'Unknown parameter name "%s" or no valid parameter value', ...
 
284
            vfld{vcntarg});
 
285
        end
 
286
 
 
287
      case 'NewtonTol'
 
288
        if (isnumeric (vret.(vfld{vcntarg})) && ...
 
289
            isreal    (vret.(vfld{vcntarg})) && ...
 
290
            all       (vret.(vfld{vcntarg}) > 0)) %# 'all' is a MatLab need
 
291
        else
 
292
          error ('OdePkg:InvalidParameter', ...
 
293
            'Unknown parameter name "%s" or no valid parameter value', ...
 
294
            vfld{vcntarg});
 
295
        end
 
296
 
 
297
      case 'MaxNewtonIterations'
 
298
        if (isempty (vret.(vfld{vcntarg})) || ...
 
299
            (mod (vret.(vfld{vcntarg}), 1) == 0 && ...
 
300
             vret.(vfld{vcntarg}) > 0))
280
301
        else
281
302
          error ('OdePkg:InvalidParameter', ...
282
303
            'Unknown parameter name "%s" or no valid parameter value', ...
385
406
%!test  A = odeset ('MaxOrder', []);
386
407
%!test  A = odeset ('BDF', 'on');
387
408
%!test  A = odeset ('BDF', 'off');
 
409
%!test  A = odeset ('BDF', []);
388
410
%!error A = odeset ('BDF', [1, 2; 3, 4]);
389
 
%!error A = odeset ('BDF', []);
 
411
%!test  A = odeset ('NewtonTol', []);
 
412
%!test  A = odeset ('NewtonTol', 1e-3);
 
413
%!test  A = odeset ('NewtonTol', [1e-3, 1e-3, 1e-3]);
 
414
%!error A = odeset ('NewtonTol', 'string');
 
415
%!test  A = odeset ('MaxNewtonIterations', []);
 
416
%!test  A = odeset ('MaxNewtonIterations', 2);
 
417
%!error A = odeset ('MaxNewtonIterations', 'string');
390
418
 
391
419
%!demo
392
420
%! # Return the checked OdePkg options structure that is created by