GNU Octave  4.0.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 \n\
587 When called with no arguments, the names of all available options and\n\
588 their current values are displayed.\n\
589 \n\
590 Given one argument, return the value of the option @var{opt}.\n\
591 \n\
592 When called with two arguments, @code{daspk_options} sets the option\n\
593 @var{opt} to value @var{val}.\n\
594 \n\
595 Options include\n\
596 \n\
597 @table @code\n\
598 @item @qcode{\"absolute tolerance\"}\n\
599 Absolute tolerance. May be either vector or scalar. If a vector, it\n\
600 must match the dimension of the state vector, and the relative\n\
601 tolerance must also be a vector of the same length.\n\
602 \n\
603 @item @qcode{\"relative tolerance\"}\n\
604 Relative tolerance. May be either vector or scalar. If a vector, it\n\
605 must match the dimension of the state vector, and the absolute\n\
606 tolerance must also be a vector of the same length.\n\
607 \n\
608 The local error test applied at each integration step is\n\
609 \n\
610 @example\n\
611 @group\n\
612  abs (local error in x(i))\n\
613  <= rtol(i) * abs (Y(i)) + atol(i)\n\
614 @end group\n\
615 @end example\n\
616 \n\
617 @item @qcode{\"compute consistent initial condition\"}\n\
618 Denoting the differential variables in the state vector by @samp{Y_d}\n\
619 and the algebraic variables by @samp{Y_a}, @code{ddaspk} can solve\n\
620 one of two initialization problems:\n\
621 \n\
622 @enumerate\n\
623 @item Given Y_d, calculate Y_a and Y'_d\n\
624 \n\
625 @item Given Y', calculate Y.\n\
626 @end enumerate\n\
627 \n\
628 In either case, initial values for the given components are input, and\n\
629 initial guesses for the unknown components must also be provided as\n\
630 input. Set this option to 1 to solve the first problem, or 2 to solve\n\
631 the second (the default is 0, so you must provide a set of\n\
632 initial conditions that are consistent).\n\
633 \n\
634 If this option is set to a nonzero value, you must also set the\n\
635 @qcode{\"algebraic variables\"} option to declare which variables in the\n\
636 problem are algebraic.\n\
637 \n\
638 @item @qcode{\"use initial condition heuristics\"}\n\
639 Set to a nonzero value to use the initial condition heuristics options\n\
640 described below.\n\
641 \n\
642 @item @qcode{\"initial condition heuristics\"}\n\
643 A vector of the following parameters that can be used to control the\n\
644 initial condition calculation.\n\
645 \n\
646 @table @code\n\
647 @item MXNIT\n\
648 Maximum number of Newton iterations (default is 5).\n\
649 \n\
650 @item MXNJ\n\
651 Maximum number of Jacobian evaluations (default is 6).\n\
652 \n\
653 @item MXNH\n\
654 Maximum number of values of the artificial stepsize parameter to be\n\
655 tried if the @qcode{\"compute consistent initial condition\"} option has\n\
656 been set to 1 (default is 5).\n\
657 \n\
658 Note that the maximum total number of Newton iterations allowed is\n\
659 @code{MXNIT*MXNJ*MXNH} if the @qcode{\"compute consistent initial\n\
660 condition\"} option has been set to 1 and @code{MXNIT*MXNJ} if it is\n\
661 set to 2.\n\
662 \n\
663 @item LSOFF\n\
664 Set to a nonzero value to disable the linesearch algorithm (default is\n\
665 0).\n\
666 \n\
667 @item STPTOL\n\
668 Minimum scaled step in linesearch algorithm (default is eps^(2/3)).\n\
669 \n\
670 @item EPINIT\n\
671 Swing factor in the Newton iteration convergence test. The test is\n\
672 applied to the residual vector, premultiplied by the approximate\n\
673 Jacobian. For convergence, the weighted RMS norm of this vector\n\
674 (scaled by the error weights) must be less than @code{EPINIT*EPCON},\n\
675 where @code{EPCON} = 0.33 is the analogous test constant used in the\n\
676 time steps. The default is @code{EPINIT} = 0.01.\n\
677 @end table\n\
678 \n\
679 @item @qcode{\"print initial condition info\"}\n\
680 Set this option to a nonzero value to display detailed information\n\
681 about the initial condition calculation (default is 0).\n\
682 \n\
683 @item @qcode{\"exclude algebraic variables from error test\"}\n\
684 Set to a nonzero value to exclude algebraic variables from the error\n\
685 test. You must also set the @qcode{\"algebraic variables\"} option to\n\
686 declare which variables in the problem are algebraic (default is 0).\n\
687 \n\
688 @item @qcode{\"algebraic variables\"}\n\
689 A vector of the same length as the state vector. A nonzero element\n\
690 indicates that the corresponding element of the state vector is an\n\
691 algebraic variable (i.e., its derivative does not appear explicitly\n\
692 in the equation set).\n\
693 \n\
694 This option is required by the\n\
695 @qcode{\"compute consistent initial condition\"} and\n\
696 @qcode{\"exclude algebraic variables from error test\"} options.\n\
697 \n\
698 @item @qcode{\"enforce inequality constraints\"}\n\
699 Set to one of the following values to enforce the inequality\n\
700 constraints specified by the @qcode{\"inequality constraint types\"}\n\
701 option (default is 0).\n\
702 \n\
703 @enumerate\n\
704 @item To have constraint checking only in the initial condition calculation.\n\
705 \n\
706 @item To enforce constraint checking during the integration.\n\
707 \n\
708 @item To enforce both options 1 and 2.\n\
709 @end enumerate\n\
710 \n\
711 @item @qcode{\"inequality constraint types\"}\n\
712 A vector of the same length as the state specifying the type of\n\
713 inequality constraint. Each element of the vector corresponds to an\n\
714 element of the state and should be assigned one of the following\n\
715 codes\n\
716 \n\
717 @table @asis\n\
718 @item -2\n\
719 Less than zero.\n\
720 \n\
721 @item -1\n\
722 Less than or equal to zero.\n\
723 \n\
724 @item 0\n\
725 Not constrained.\n\
726 \n\
727 @item 1\n\
728 Greater than or equal to zero.\n\
729 \n\
730 @item 2\n\
731 Greater than zero.\n\
732 @end table\n\
733 \n\
734 This option only has an effect if the\n\
735 @qcode{\"enforce inequality constraints\"} option is nonzero.\n\
736 \n\
737 @item @qcode{\"initial step size\"}\n\
738 Differential-algebraic problems may occasionally suffer from severe\n\
739 scaling difficulties on the first step. If you know a great deal\n\
740 about the scaling of your problem, you can help to alleviate this\n\
741 problem by specifying an initial stepsize (default is computed\n\
742 automatically).\n\
743 \n\
744 @item @qcode{\"maximum order\"}\n\
745 Restrict the maximum order of the solution method. This option must\n\
746 be between 1 and 5, inclusive (default is 5).\n\
747 \n\
748 @item @qcode{\"maximum step size\"}\n\
749 Setting the maximum stepsize will avoid passing over very large\n\
750 regions (default is not specified).\n\
751 @end table\n\
752 @end deftypefn")
753 {
754  octave_value_list retval;
755 
756  int nargin = args.length ();
757 
758  if (nargin == 0)
759  {
761  }
762  else if (nargin == 1 || nargin == 2)
763  {
764  std::string keyword = args(0).string_value ();
765 
766  if (! error_state)
767  {
768  if (nargin == 1)
769  retval = show_DASPK_options (keyword);
770  else
771  set_DASPK_options (keyword, args(1));
772  }
773  else
774  error ("daspk_options: expecting keyword as first argument");
775  }
776  else
777  print_usage ();
778 
779  return retval;
780 }
Array< double > absolute_tolerance(void) const
Definition: DASPK-opts.h:188
OCTINTERP_API void print_usage(void)
Definition: defun.cc:51
void set_inequality_constraint_types(octave_idx_type val)
Definition: DASPK-opts.h:170
octave_idx_type length(void) const
Definition: oct-obj.h:89
int int_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:730
#define DEFUN(name, args_name, nargout_name, doc)
Definition: defun.h:44
void error(const char *fmt,...)
Definition: error.cc:476
void set_print_initial_condition_info(octave_idx_type val)
Definition: DASPK-opts.h:151
octave_idx_type print_initial_condition_info(void) const
Definition: DASPK-opts.h:203
static int left
Definition: randmtzig.c:189
octave_idx_type use_initial_condition_heuristics(void) const
Definition: DASPK-opts.h:197
void set_algebraic_variables(int val)
Definition: DASPK-opts.h:157
static void set_DASPK_options(const std::string &keyword, const octave_value &val)
Definition: DASPK-opts.cc:317
const char * keyword
Definition: DASPK-opts.cc:26
double maximum_step_size(void) const
Definition: DASPK-opts.h:224
void set_initial_step_size(double val)
Definition: DASPK-opts.h:180
void set_maximum_step_size(double val)
Definition: DASPK-opts.h:186
void set_absolute_tolerance(double val)
Definition: DASPK-opts.h:122
double initial_step_size(void) const
Definition: DASPK-opts.h:218
int error_state
Definition: error.cc:101
octave_idx_type maximum_order(void) const
Definition: DASPK-opts.h:221
void set_use_initial_condition_heuristics(octave_idx_type val)
Definition: DASPK-opts.h:145
Array< octave_idx_type > algebraic_variables(void) const
Definition: DASPK-opts.h:209
octave_idx_type compute_consistent_initial_condition(void) const
Definition: DASPK-opts.h:194
octave_idx_type enforce_inequality_constraints(void) const
Definition: DASPK-opts.h:212
Definition: dMatrix.h:35
int keyword_almost_match(const char *const *std, int *min_len, const std::string &s, int min_toks_to_match, int max_toks)
Definition: utils.cc:155
octave_idx_type exclude_algebraic_variables_from_error_test(void) const
Definition: DASPK-opts.h:206
Array< octave_idx_type > inequality_constraint_types(void) const
Definition: DASPK-opts.h:215
const char * kw_tok[6+1]
Definition: DASPK-opts.cc:27
static DASPK_options_struct DASPK_options_table[]
Definition: DASPK-opts.cc:34
static octave_value_list show_DASPK_options(const std::string &keyword)
Definition: DASPK-opts.cc:432
void warning(const char *fmt,...)
Definition: error.cc:681
Handles the reference counting for all the derived classes.
Definition: Array.h:45
octave_idx_type length(void) const
Number of elements in the array.
Definition: Array.h:267
void set_maximum_order(octave_idx_type val)
Definition: DASPK-opts.h:183
#define octave_stdout
Definition: pager.h:144
void set_enforce_inequality_constraints(octave_idx_type val)
Definition: DASPK-opts.h:167
Array< double > relative_tolerance(void) const
Definition: DASPK-opts.h:191
void octave_print_internal(std::ostream &, char, bool)
Definition: pr-output.cc:1715
static void print_DASPK_options(std::ostream &os)
Definition: DASPK-opts.cc:90
Array< double > vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
Definition: ov.cc:1690
void set_relative_tolerance(double val)
Definition: DASPK-opts.h:132
Array< int > int_vector_value(bool req_int=false, bool frc_str_conv=false, bool frc_vec_conv=false) const
Definition: ov.cc:1717
#define MAX_TOKENS
Definition: DASPK-opts.cc:22
double double_value(bool frc_str_conv=false) const
Definition: ov.h:759
static DASPK_options daspk_opts
Definition: DASPK-opts.cc:20
void set_exclude_algebraic_variables_from_error_test(octave_idx_type val)
Definition: DASPK-opts.h:154
void set_initial_condition_heuristics(const Array< double > &val)
Definition: DASPK-opts.h:148
void set_compute_consistent_initial_condition(octave_idx_type val)
Definition: DASPK-opts.h:142
Array< double > initial_condition_heuristics(void) const
Definition: DASPK-opts.h:200