GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DASPK-opts.cc
Go to the documentation of this file.
1 // DO NOT EDIT!
2 // Generated automatically from ../liboctave/numeric/DASPK-opts.in.
3 
4 #ifdef HAVE_CONFIG_H
5 #include <config.h>
6 #endif
7 
8 #include <iomanip>
9 #include <iostream>
10 
11 #include "DASPK-opts.h"
12 
13 #include "defun.h"
14 #include "pr-output.h"
15 
16 #include "oct-obj.h"
17 #include "utils.h"
18 #include "pager.h"
19 
21 
22 #define MAX_TOKENS 6
23 
25 {
26  const char *keyword;
27  const char *kw_tok[MAX_TOKENS + 1];
28  int min_len[MAX_TOKENS + 1];
30 };
31 
32 #define NUM_OPTIONS 13
33 
35 {
36  { "absolute tolerance",
37  { "absolute", "tolerance", 0, 0, 0, 0, 0, },
38  { 2, 0, 0, 0, 0, 0, 0, }, 1, },
39 
40  { "relative tolerance",
41  { "relative", "tolerance", 0, 0, 0, 0, 0, },
42  { 1, 0, 0, 0, 0, 0, 0, }, 1, },
43 
44  { "compute consistent initial condition",
45  { "compute", "consistent", "initial", "condition", 0, 0, 0, },
46  { 1, 0, 0, 0, 0, 0, 0, }, 1, },
47 
48  { "use initial condition heuristics",
49  { "use", "initial", "condition", "heuristics", 0, 0, 0, },
50  { 1, 0, 0, 0, 0, 0, 0, }, 1, },
51 
52  { "initial condition heuristics",
53  { "initial", "condition", "heuristics", 0, 0, 0, 0, },
54  { 3, 1, 0, 0, 0, 0, 0, }, 2, },
55 
56  { "print initial condition info",
57  { "print", "initial", "condition", "info", 0, 0, 0, },
58  { 1, 0, 0, 0, 0, 0, 0, }, 1, },
59 
60  { "exclude algebraic variables from error test",
61  { "exclude", "algebraic", "variables", "from", "error", "test", 0, },
62  { 2, 0, 0, 0, 0, 0, 0, }, 1, },
63 
64  { "algebraic variables",
65  { "algebraic", "variables", 0, 0, 0, 0, 0, },
66  { 2, 0, 0, 0, 0, 0, 0, }, 1, },
67 
68  { "enforce inequality constraints",
69  { "enforce", "inequality", "constraints", 0, 0, 0, 0, },
70  { 2, 0, 0, 0, 0, 0, 0, }, 1, },
71 
72  { "inequality constraint types",
73  { "inequality", "constraint", "types", 0, 0, 0, 0, },
74  { 3, 0, 0, 0, 0, 0, 0, }, 1, },
75 
76  { "initial step size",
77  { "initial", "step", "size", 0, 0, 0, 0, },
78  { 3, 1, 0, 0, 0, 0, 0, }, 2, },
79 
80  { "maximum order",
81  { "maximum", "order", 0, 0, 0, 0, 0, },
82  { 1, 1, 0, 0, 0, 0, 0, }, 2, },
83 
84  { "maximum step size",
85  { "maximum", "step", "size", 0, 0, 0, 0, },
86  { 1, 1, 0, 0, 0, 0, 0, }, 2, },
87 };
88 
89 static void
90 print_DASPK_options (std::ostream& os)
91 {
92  std::ostringstream buf;
93 
94  os << "\n"
95  << "Options for DASPK include:\n\n"
96  << " keyword value\n"
97  << " ------- -----\n";
98 
100 
101  {
102  os << " "
103  << std::setiosflags (std::ios::left) << std::setw (50)
104  << list[0].keyword
105  << std::resetiosflags (std::ios::left)
106  << " ";
107 
108  Array<double> val = daspk_opts.absolute_tolerance ();
109 
110  if (val.length () == 1)
111  {
112  os << val(0) << "\n";
113  }
114  else
115  {
116  os << "\n\n";
117  Matrix tmp = Matrix (ColumnVector (val));
118  octave_print_internal (os, tmp, false, 2);
119  os << "\n\n";
120  }
121  }
122 
123  {
124  os << " "
125  << std::setiosflags (std::ios::left) << std::setw (50)
126  << list[1].keyword
127  << std::resetiosflags (std::ios::left)
128  << " ";
129 
130  Array<double> val = daspk_opts.relative_tolerance ();
131 
132  if (val.length () == 1)
133  {
134  os << val(0) << "\n";
135  }
136  else
137  {
138  os << "\n\n";
139  Matrix tmp = Matrix (ColumnVector (val));
140  octave_print_internal (os, tmp, false, 2);
141  os << "\n\n";
142  }
143  }
144 
145  {
146  os << " "
147  << std::setiosflags (std::ios::left) << std::setw (50)
148  << list[2].keyword
149  << std::resetiosflags (std::ios::left)
150  << " ";
151 
152  int val = daspk_opts.compute_consistent_initial_condition ();
153 
154  os << val << "\n";
155  }
156 
157  {
158  os << " "
159  << std::setiosflags (std::ios::left) << std::setw (50)
160  << list[3].keyword
161  << std::resetiosflags (std::ios::left)
162  << " ";
163 
164  int val = daspk_opts.use_initial_condition_heuristics ();
165 
166  os << val << "\n";
167  }
168 
169  {
170  os << " "
171  << std::setiosflags (std::ios::left) << std::setw (50)
172  << list[4].keyword
173  << std::resetiosflags (std::ios::left)
174  << " ";
175 
176  Array<double> val = daspk_opts.initial_condition_heuristics ();
177 
178  if (val.length () == 1)
179  {
180  os << val(0) << "\n";
181  }
182  else
183  {
184  os << "\n\n";
185  Matrix tmp = Matrix (ColumnVector (val));
186  octave_print_internal (os, tmp, false, 2);
187  os << "\n\n";
188  }
189  }
190 
191  {
192  os << " "
193  << std::setiosflags (std::ios::left) << std::setw (50)
194  << list[5].keyword
195  << std::resetiosflags (std::ios::left)
196  << " ";
197 
198  int val = daspk_opts.print_initial_condition_info ();
199 
200  os << val << "\n";
201  }
202 
203  {
204  os << " "
205  << std::setiosflags (std::ios::left) << std::setw (50)
206  << list[6].keyword
207  << std::resetiosflags (std::ios::left)
208  << " ";
209 
210  int val = daspk_opts.exclude_algebraic_variables_from_error_test ();
211 
212  os << val << "\n";
213  }
214 
215  {
216  os << " "
217  << std::setiosflags (std::ios::left) << std::setw (50)
218  << list[7].keyword
219  << std::resetiosflags (std::ios::left)
220  << " ";
221 
222  Array<octave_idx_type> val = daspk_opts.algebraic_variables ();
223 
224  if (val.length () == 1)
225  {
226  os << val(0) << "\n";
227  }
228  else
229  {
230  os << "\n\n";
231  octave_idx_type len = val.length ();
232  Matrix tmp (len, 1);
233  for (octave_idx_type i = 0; i < len; i++)
234  tmp(i,0) = val(i);
235  octave_print_internal (os, tmp, false, 2);
236  os << "\n\n";
237  }
238  }
239 
240  {
241  os << " "
242  << std::setiosflags (std::ios::left) << std::setw (50)
243  << list[8].keyword
244  << std::resetiosflags (std::ios::left)
245  << " ";
246 
247  int val = daspk_opts.enforce_inequality_constraints ();
248 
249  os << val << "\n";
250  }
251 
252  {
253  os << " "
254  << std::setiosflags (std::ios::left) << std::setw (50)
255  << list[9].keyword
256  << std::resetiosflags (std::ios::left)
257  << " ";
258 
260 
261  if (val.length () == 1)
262  {
263  os << val(0) << "\n";
264  }
265  else
266  {
267  os << "\n\n";
268  octave_idx_type len = val.length ();
269  Matrix tmp (len, 1);
270  for (octave_idx_type i = 0; i < len; i++)
271  tmp(i,0) = val(i);
272  octave_print_internal (os, tmp, false, 2);
273  os << "\n\n";
274  }
275  }
276 
277  {
278  os << " "
279  << std::setiosflags (std::ios::left) << std::setw (50)
280  << list[10].keyword
281  << std::resetiosflags (std::ios::left)
282  << " ";
283 
284  double val = daspk_opts.initial_step_size ();
285 
286  os << val << "\n";
287  }
288 
289  {
290  os << " "
291  << std::setiosflags (std::ios::left) << std::setw (50)
292  << list[11].keyword
293  << std::resetiosflags (std::ios::left)
294  << " ";
295 
296  int val = daspk_opts.maximum_order ();
297 
298  os << val << "\n";
299  }
300 
301  {
302  os << " "
303  << std::setiosflags (std::ios::left) << std::setw (50)
304  << list[12].keyword
305  << std::resetiosflags (std::ios::left)
306  << " ";
307 
308  double val = daspk_opts.maximum_step_size ();
309 
310  os << val << "\n";
311  }
312 
313  os << "\n";
314 }
315 
316 static void
317 set_DASPK_options (const std::string& keyword, const octave_value& val)
318 {
320 
321  if (keyword_almost_match (list[0].kw_tok, list[0].min_len,
322  keyword, list[0].min_toks_to_match, MAX_TOKENS))
323  {
324  Array<double> tmp = val.vector_value ();
325 
326  if (! error_state)
327  daspk_opts.set_absolute_tolerance (tmp);
328  }
329  else if (keyword_almost_match (list[1].kw_tok, list[1].min_len,
330  keyword, list[1].min_toks_to_match, MAX_TOKENS))
331  {
332  Array<double> tmp = val.vector_value ();
333 
334  if (! error_state)
335  daspk_opts.set_relative_tolerance (tmp);
336  }
337  else if (keyword_almost_match (list[2].kw_tok, list[2].min_len,
338  keyword, list[2].min_toks_to_match, MAX_TOKENS))
339  {
340  int tmp = val.int_value ();
341 
342  if (! error_state)
344  }
345  else if (keyword_almost_match (list[3].kw_tok, list[3].min_len,
346  keyword, list[3].min_toks_to_match, MAX_TOKENS))
347  {
348  int tmp = val.int_value ();
349 
350  if (! error_state)
351  daspk_opts.set_use_initial_condition_heuristics (tmp);
352  }
353  else if (keyword_almost_match (list[4].kw_tok, list[4].min_len,
354  keyword, list[4].min_toks_to_match, MAX_TOKENS))
355  {
356  Array<double> tmp = val.vector_value ();
357 
358  if (! error_state)
359  daspk_opts.set_initial_condition_heuristics (tmp);
360  }
361  else if (keyword_almost_match (list[5].kw_tok, list[5].min_len,
362  keyword, list[5].min_toks_to_match, MAX_TOKENS))
363  {
364  int tmp = val.int_value ();
365 
366  if (! error_state)
367  daspk_opts.set_print_initial_condition_info (tmp);
368  }
369  else if (keyword_almost_match (list[6].kw_tok, list[6].min_len,
370  keyword, list[6].min_toks_to_match, MAX_TOKENS))
371  {
372  int tmp = val.int_value ();
373 
374  if (! error_state)
376  }
377  else if (keyword_almost_match (list[7].kw_tok, list[7].min_len,
378  keyword, list[7].min_toks_to_match, MAX_TOKENS))
379  {
380  Array<int> tmp = val.int_vector_value ();
381 
382  if (! error_state)
383  daspk_opts.set_algebraic_variables (tmp);
384  }
385  else if (keyword_almost_match (list[8].kw_tok, list[8].min_len,
386  keyword, list[8].min_toks_to_match, MAX_TOKENS))
387  {
388  int tmp = val.int_value ();
389 
390  if (! error_state)
391  daspk_opts.set_enforce_inequality_constraints (tmp);
392  }
393  else if (keyword_almost_match (list[9].kw_tok, list[9].min_len,
394  keyword, list[9].min_toks_to_match, MAX_TOKENS))
395  {
396  Array<int> tmp = val.int_vector_value ();
397 
398  if (! error_state)
399  daspk_opts.set_inequality_constraint_types (tmp);
400  }
401  else if (keyword_almost_match (list[10].kw_tok, list[10].min_len,
402  keyword, list[10].min_toks_to_match, MAX_TOKENS))
403  {
404  double tmp = val.double_value ();
405 
406  if (! error_state)
407  daspk_opts.set_initial_step_size (tmp);
408  }
409  else if (keyword_almost_match (list[11].kw_tok, list[11].min_len,
410  keyword, list[11].min_toks_to_match, MAX_TOKENS))
411  {
412  int tmp = val.int_value ();
413 
414  if (! error_state)
415  daspk_opts.set_maximum_order (tmp);
416  }
417  else if (keyword_almost_match (list[12].kw_tok, list[12].min_len,
418  keyword, list[12].min_toks_to_match, MAX_TOKENS))
419  {
420  double tmp = val.double_value ();
421 
422  if (! error_state)
423  daspk_opts.set_maximum_step_size (tmp);
424  }
425  else
426  {
427  warning ("daspk_options: no match for `%s'", keyword.c_str ());
428  }
429 }
430 
431 static octave_value_list
432 show_DASPK_options (const std::string& keyword)
433 {
434  octave_value retval;
435 
437 
438  if (keyword_almost_match (list[0].kw_tok, list[0].min_len,
439  keyword, list[0].min_toks_to_match, MAX_TOKENS))
440  {
441  Array<double> val = daspk_opts.absolute_tolerance ();
442 
443  if (val.length () == 1)
444  {
445  retval = val(0);
446  }
447  else
448  {
449  retval = ColumnVector (val);
450  }
451  }
452  else if (keyword_almost_match (list[1].kw_tok, list[1].min_len,
453  keyword, list[1].min_toks_to_match, MAX_TOKENS))
454  {
455  Array<double> val = daspk_opts.relative_tolerance ();
456 
457  if (val.length () == 1)
458  {
459  retval = val(0);
460  }
461  else
462  {
463  retval = ColumnVector (val);
464  }
465  }
466  else if (keyword_almost_match (list[2].kw_tok, list[2].min_len,
467  keyword, list[2].min_toks_to_match, MAX_TOKENS))
468  {
469  int val = daspk_opts.compute_consistent_initial_condition ();
470 
471  retval = static_cast<double> (val);
472  }
473  else if (keyword_almost_match (list[3].kw_tok, list[3].min_len,
474  keyword, list[3].min_toks_to_match, MAX_TOKENS))
475  {
476  int val = daspk_opts.use_initial_condition_heuristics ();
477 
478  retval = static_cast<double> (val);
479  }
480  else if (keyword_almost_match (list[4].kw_tok, list[4].min_len,
481  keyword, list[4].min_toks_to_match, MAX_TOKENS))
482  {
483  Array<double> val = daspk_opts.initial_condition_heuristics ();
484 
485  if (val.length () == 1)
486  {
487  retval = val(0);
488  }
489  else
490  {
491  retval = ColumnVector (val);
492  }
493  }
494  else if (keyword_almost_match (list[5].kw_tok, list[5].min_len,
495  keyword, list[5].min_toks_to_match, MAX_TOKENS))
496  {
497  int val = daspk_opts.print_initial_condition_info ();
498 
499  retval = static_cast<double> (val);
500  }
501  else if (keyword_almost_match (list[6].kw_tok, list[6].min_len,
502  keyword, list[6].min_toks_to_match, MAX_TOKENS))
503  {
504  int val = daspk_opts.exclude_algebraic_variables_from_error_test ();
505 
506  retval = static_cast<double> (val);
507  }
508  else if (keyword_almost_match (list[7].kw_tok, list[7].min_len,
509  keyword, list[7].min_toks_to_match, MAX_TOKENS))
510  {
511  Array<octave_idx_type> val = daspk_opts.algebraic_variables ();
512 
513  if (val.length () == 1)
514  {
515  retval = static_cast<double> (val(0));
516  }
517  else
518  {
519  octave_idx_type len = val.length ();
520  ColumnVector tmp (len);
521  for (octave_idx_type i = 0; i < len; i++)
522  tmp(i) = val(i);
523  retval = tmp;
524  }
525  }
526  else if (keyword_almost_match (list[8].kw_tok, list[8].min_len,
527  keyword, list[8].min_toks_to_match, MAX_TOKENS))
528  {
529  int val = daspk_opts.enforce_inequality_constraints ();
530 
531  retval = static_cast<double> (val);
532  }
533  else if (keyword_almost_match (list[9].kw_tok, list[9].min_len,
534  keyword, list[9].min_toks_to_match, MAX_TOKENS))
535  {
537 
538  if (val.length () == 1)
539  {
540  retval = static_cast<double> (val(0));
541  }
542  else
543  {
544  octave_idx_type len = val.length ();
545  ColumnVector tmp (len);
546  for (octave_idx_type i = 0; i < len; i++)
547  tmp(i) = val(i);
548  retval = tmp;
549  }
550  }
551  else if (keyword_almost_match (list[10].kw_tok, list[10].min_len,
552  keyword, list[10].min_toks_to_match, MAX_TOKENS))
553  {
554  double val = daspk_opts.initial_step_size ();
555 
556  retval = val;
557  }
558  else if (keyword_almost_match (list[11].kw_tok, list[11].min_len,
559  keyword, list[11].min_toks_to_match, MAX_TOKENS))
560  {
561  int val = daspk_opts.maximum_order ();
562 
563  retval = static_cast<double> (val);
564  }
565  else if (keyword_almost_match (list[12].kw_tok, list[12].min_len,
566  keyword, list[12].min_toks_to_match, MAX_TOKENS))
567  {
568  double val = daspk_opts.maximum_step_size ();
569 
570  retval = val;
571  }
572  else
573  {
574  warning ("daspk_options: no match for `%s'", keyword.c_str ());
575  }
576 
577  return retval;
578 }
579 
580 DEFUN (daspk_options, args, ,
581  "-*- texinfo -*-\n\
582 @deftypefn {Built-in Function} {} daspk_options ()\n\
583 @deftypefnx {Built-in Function} {val =} daspk_options (@var{opt})\n\
584 @deftypefnx {Built-in Function} {} daspk_options (@var{opt}, @var{val})\n\
585 Query or set options for the function @code{daspk}.\n\
586 When called with no arguments, the names of all available options and\n\
587 their current values are displayed.\n\
588 Given one argument, return the value of the corresponding option.\n\
589 When called with two arguments, @code{daspk_options} set the option\n\
590 @var{opt} to value @var{val}.\n\
591 \n\
592 Options include\n\
593 \n\
594 @table @code\n\
595 @item @qcode{\"absolute tolerance\"}\n\
596 Absolute tolerance. May be either vector or scalar. If a vector, it\n\
597 must match the dimension of the state vector, and the relative\n\
598 tolerance must also be a vector of the same length.\n\
599 \n\
600 @item @qcode{\"relative tolerance\"}\n\
601 Relative tolerance. May be either vector or scalar. If a vector, it\n\
602 must match the dimension of the state vector, and the absolute\n\
603 tolerance must also be a vector of the same length.\n\
604 \n\
605 The local error test applied at each integration step is\n\
606 \n\
607 @example\n\
608 @group\n\
609  abs (local error in x(i))\n\
610  <= rtol(i) * abs (Y(i)) + atol(i)\n\
611 @end group\n\
612 @end example\n\
613 \n\
614 @item @qcode{\"compute consistent initial condition\"}\n\
615 Denoting the differential variables in the state vector by @samp{Y_d}\n\
616 and the algebraic variables by @samp{Y_a}, @code{ddaspk} can solve\n\
617 one of two initialization problems:\n\
618 \n\
619 @enumerate\n\
620 @item Given Y_d, calculate Y_a and Y'_d\n\
621 \n\
622 @item Given Y', calculate Y.\n\
623 @end enumerate\n\
624 \n\
625 In either case, initial values for the given components are input, and\n\
626 initial guesses for the unknown components must also be provided as\n\
627 input. Set this option to 1 to solve the first problem, or 2 to solve\n\
628 the second (the default is 0, so you must provide a set of\n\
629 initial conditions that are consistent).\n\
630 \n\
631 If this option is set to a nonzero value, you must also set the\n\
632 @qcode{\"algebraic variables\"} option to declare which variables in the\n\
633 problem are algebraic.\n\
634 \n\
635 @item @qcode{\"use initial condition heuristics\"}\n\
636 Set to a nonzero value to use the initial condition heuristics options\n\
637 described below.\n\
638 \n\
639 @item @qcode{\"initial condition heuristics\"}\n\
640 A vector of the following parameters that can be used to control the\n\
641 initial condition calculation.\n\
642 \n\
643 @table @code\n\
644 @item MXNIT\n\
645 Maximum number of Newton iterations (default is 5).\n\
646 \n\
647 @item MXNJ\n\
648 Maximum number of Jacobian evaluations (default is 6).\n\
649 \n\
650 @item MXNH\n\
651 Maximum number of values of the artificial stepsize parameter to be\n\
652 tried if the @qcode{\"compute consistent initial condition\"} option has\n\
653 been set to 1 (default is 5).\n\
654 \n\
655 Note that the maximum total number of Newton iterations allowed is\n\
656 @code{MXNIT*MXNJ*MXNH} if the @qcode{\"compute consistent initial\n\
657 condition\"} option has been set to 1 and @code{MXNIT*MXNJ} if it is\n\
658 set to 2.\n\
659 \n\
660 @item LSOFF\n\
661 Set to a nonzero value to disable the linesearch algorithm (default is\n\
662 0).\n\
663 \n\
664 @item STPTOL\n\
665 Minimum scaled step in linesearch algorithm (default is eps^(2/3)).\n\
666 \n\
667 @item EPINIT\n\
668 Swing factor in the Newton iteration convergence test. The test is\n\
669 applied to the residual vector, premultiplied by the approximate\n\
670 Jacobian. For convergence, the weighted RMS norm of this vector\n\
671 (scaled by the error weights) must be less than @code{EPINIT*EPCON},\n\
672 where @code{EPCON} = 0.33 is the analogous test constant used in the\n\
673 time steps. The default is @code{EPINIT} = 0.01.\n\
674 @end table\n\
675 \n\
676 @item @qcode{\"print initial condition info\"}\n\
677 Set this option to a nonzero value to display detailed information\n\
678 about the initial condition calculation (default is 0).\n\
679 \n\
680 @item @qcode{\"exclude algebraic variables from error test\"}\n\
681 Set to a nonzero value to exclude algebraic variables from the error\n\
682 test. You must also set the @qcode{\"algebraic variables\"} option to\n\
683 declare which variables in the problem are algebraic (default is 0).\n\
684 \n\
685 @item @qcode{\"algebraic variables\"}\n\
686 A vector of the same length as the state vector. A nonzero element\n\
687 indicates that the corresponding element of the state vector is an\n\
688 algebraic variable (i.e., its derivative does not appear explicitly\n\
689 in the equation set.\n\
690 \n\
691 This option is required by the\n\
692 @qcode{compute consistent initial condition\"} and\n\
693 @qcode{\"exclude algebraic variables from error test\"} options.\n\
694 \n\
695 @item @qcode{\"enforce inequality constraints\"}\n\
696 Set to one of the following values to enforce the inequality\n\
697 constraints specified by the @qcode{\"inequality constraint types\"}\n\
698 option (default is 0).\n\
699 \n\
700 @enumerate\n\
701 @item To have constraint checking only in the initial condition calculation.\n\
702 \n\
703 @item To enforce constraint checking during the integration.\n\
704 \n\
705 @item To enforce both options 1 and 2.\n\
706 @end enumerate\n\
707 \n\
708 @item @qcode{\"inequality constraint types\"}\n\
709 A vector of the same length as the state specifying the type of\n\
710 inequality constraint. Each element of the vector corresponds to an\n\
711 element of the state and should be assigned one of the following\n\
712 codes\n\
713 \n\
714 @table @asis\n\
715 @item -2\n\
716 Less than zero.\n\
717 \n\
718 @item -1\n\
719 Less than or equal to zero.\n\
720 \n\
721 @item 0\n\
722 Not constrained.\n\
723 \n\
724 @item 1\n\
725 Greater than or equal to zero.\n\
726 \n\
727 @item 2\n\
728 Greater than zero.\n\
729 @end table\n\
730 \n\
731 This option only has an effect if the\n\
732 @qcode{\"enforce inequality constraints\"} option is nonzero.\n\
733 \n\
734 @item @qcode{\"initial step size\"}\n\
735 Differential-algebraic problems may occasionally suffer from severe\n\
736 scaling difficulties on the first step. If you know a great deal\n\
737 about the scaling of your problem, you can help to alleviate this\n\
738 problem by specifying an initial stepsize (default is computed\n\
739 automatically).\n\
740 \n\
741 @item @qcode{\"maximum order\"}\n\
742 Restrict the maximum order of the solution method. This option must\n\
743 be between 1 and 5, inclusive (default is 5).\n\
744 \n\
745 @item @qcode{\"maximum step size\"}\n\
746 Setting the maximum stepsize will avoid passing over very large\n\
747 regions (default is not specified).\n\
748 @end table\n\
749 @end deftypefn")
750 {
751  octave_value_list retval;
752 
753  int nargin = args.length ();
754 
755  if (nargin == 0)
756  {
758  }
759  else if (nargin == 1 || nargin == 2)
760  {
761  std::string keyword = args(0).string_value ();
762 
763  if (! error_state)
764  {
765  if (nargin == 1)
766  retval = show_DASPK_options (keyword);
767  else
768  set_DASPK_options (keyword, args(1));
769  }
770  else
771  error ("daspk_options: expecting keyword as first argument");
772  }
773  else
774  print_usage ();
775 
776  return retval;
777 }