Mercurial > hg > octave-lyh
changeset 1329:13b630c0aad3
[project @ 1995-08-24 00:58:44 by jwe]
author | jwe |
---|---|
date | Thu, 24 Aug 1995 00:58:44 +0000 |
parents | ec2ab864e8eb |
children | 41c6ffb66c01 |
files | src/dassl.cc src/fsolve.cc src/lsode.cc src/npsol.cc src/qpsol.cc src/quad.cc |
diffstat | 6 files changed, 210 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dassl.cc +++ b/src/dassl.cc @@ -274,7 +274,7 @@ } static void -do_dassl_option (char *keyword, double val) +set_dassl_option (char *keyword, double val) { DAE_OPTIONS *list = dassl_option_table; @@ -293,6 +293,28 @@ warning ("dassl_options: no match for `%s'", keyword); } +static Octave_object +show_dassl_option (char *keyword) +{ + Octave_object retval; + + DAE_OPTIONS *list = dassl_option_table; + + while (list->keyword != 0) + { + if (keyword_almost_match (list->kw_tok, list->min_len, keyword, + list->min_toks_to_match, MAX_TOKENS)) + { + return (dassl_opts.*list->d_get_fcn) (); + } + list++; + } + + warning ("dassl_options: no match for `%s'", keyword); + + return retval; +} + DEFUN_DLD_BUILTIN ("dassl_options", Fdassl_options, Sdassl_options, -1, 1, "dassl_options (KEYWORD, VALUE)\n\ \n\ @@ -308,18 +330,23 @@ print_dassl_option_list (); return retval; } - else if (nargin == 2) + else if (nargin == 1 || nargin == 2) { char *keyword = args(0).string_value (); if (! error_state) { - double val = args(1).double_value (); + if (nargin == 1) + return show_dassl_option (keyword); + else + { + double val = args(1).double_value (); - if (! error_state) - { - do_dassl_option (keyword, val); - return retval; + if (! error_state) + { + set_dassl_option (keyword, val); + return retval; + } } } }
--- a/src/fsolve.cc +++ b/src/fsolve.cc @@ -240,7 +240,7 @@ } static void -do_fsolve_option (char *keyword, double val) +set_fsolve_option (char *keyword, double val) { NLEQN_OPTIONS *list = fsolve_option_table; @@ -259,6 +259,28 @@ warning ("fsolve_options: no match for `%s'", keyword); } +static Octave_object +show_fsolve_option (char *keyword) +{ + Octave_object retval; + + NLEQN_OPTIONS *list = fsolve_option_table; + + while (list->keyword != 0) + { + if (keyword_almost_match (list->kw_tok, list->min_len, keyword, + list->min_toks_to_match, MAX_TOKENS)) + { + return (fsolve_opts.*list->d_get_fcn) (); + } + list++; + } + + warning ("fsolve_options: no match for `%s'", keyword); + + return retval; +} + DEFUN_DLD_BUILTIN ("fsolve_options", Ffsolve_options, Sfsolve_options, -1, 1, "fsolve_options (KEYWORD, VALUE)\n\ \n\ @@ -274,18 +296,23 @@ print_fsolve_option_list (); return retval; } - else if (nargin == 2) + else if (nargin == 1 || nargin == 2) { char *keyword = args(0).string_value (); if (! error_state) { - double val = args(1).double_value (); + if (nargin == 1) + return show_fsolve_option (keyword); + else + { + double val = args(1).double_value (); - if (! error_state) - { - do_fsolve_option (keyword, val); - return retval; + if (! error_state) + { + set_fsolve_option (keyword, val); + return retval; + } } } }
--- a/src/lsode.cc +++ b/src/lsode.cc @@ -255,7 +255,7 @@ } static void -do_lsode_option (char *keyword, double val) +set_lsode_option (char *keyword, double val) { ODE_OPTIONS *list = lsode_option_table; @@ -274,6 +274,28 @@ warning ("lsode_options: no match for `%s'", keyword); } +static Octave_object +show_lsode_option (char *keyword) +{ + Octave_object retval; + + ODE_OPTIONS *list = lsode_option_table; + + while (list->keyword != 0) + { + if (keyword_almost_match (list->kw_tok, list->min_len, keyword, + list->min_toks_to_match, MAX_TOKENS)) + { + return (lsode_opts.*list->d_get_fcn) (); + } + list++; + } + + warning ("lsode_options: no match for `%s'", keyword); + + return retval; +} + DEFUN_DLD_BUILTIN ("lsode_options", Flsode_options, Slsode_options, -1, 1, "lsode_options (KEYWORD, VALUE)\n\ \n\ @@ -289,18 +311,23 @@ print_lsode_option_list (); return retval; } - else if (nargin == 2) + else if (nargin == 1 || nargin == 2) { char *keyword = args(0).string_value (); if (! error_state) { - double val = args(1).double_value (); + if (nargin == 1) + return show_lsode_option (keyword); + else + { + double val = args(1).double_value (); - if (! error_state) - { - do_lsode_option (keyword, val); - return retval; + if (! error_state) + { + set_lsode_option (keyword, val); + return retval; + } } } }
--- a/src/npsol.cc +++ b/src/npsol.cc @@ -717,7 +717,7 @@ } static void -do_npsol_option (char *keyword, double val) +set_npsol_option (char *keyword, double val) { NPSOL_OPTIONS *list = npsol_option_table; @@ -746,6 +746,31 @@ warning ("npsol_options: no match for `%s'", keyword); } +static Octave_object +show_npsol_option (char *keyword) +{ + Octave_object retval; + + NPSOL_OPTIONS *list = npsol_option_table; + + while (list->keyword != 0) + { + if (keyword_almost_match (list->kw_tok, list->min_len, keyword, + list->min_toks_to_match, MAX_TOKENS)) + { + if (list->d_get_fcn) + return (npsol_opts.*list->d_get_fcn) (); + else + return (double) (npsol_opts.*list->i_get_fcn) (); + } + list++; + } + + warning ("npsol_options: no match for `%s'", keyword); + + return retval; +} + #endif #if defined (NPSOL_MISSING) @@ -776,18 +801,23 @@ print_npsol_option_list (); return retval; } - else if (nargin == 2) + else if (nargin == 1 || nargin == 2) { char *keyword = args(0).string_value (); if (! error_state) { - double val = args(1).double_value (); + if (nargin == 1) + return show_npsol_option (keyword); + else + { + double val = args(1).double_value (); - if (! error_state) - { - do_npsol_option (keyword, val); - return retval; + if (! error_state) + { + set_npsol_option (keyword, val); + return retval; + } } } }
--- a/src/qpsol.cc +++ b/src/qpsol.cc @@ -327,7 +327,7 @@ } static void -do_qpsol_option (char *keyword, double val) +set_qpsol_option (char *keyword, double val) { QPSOL_OPTIONS *list = qpsol_option_table; @@ -356,6 +356,31 @@ warning ("qpsol_options: no match for `%s'", keyword); } +static Octave_object +show_qpsol_option (char *keyword) +{ + Octave_object retval; + + QPSOL_OPTIONS *list = qpsol_option_table; + + while (list->keyword != 0) + { + if (keyword_almost_match (list->kw_tok, list->min_len, keyword, + list->min_toks_to_match, MAX_TOKENS)) + { + if (list->d_get_fcn) + return (qpsol_opts.*list->d_get_fcn) (); + else + return (double) (qpsol_opts.*list->i_get_fcn) (); + } + list++; + } + + warning ("qpsol_options: no match for `%s'", keyword); + + return retval; +} + #endif #if defined (QPSOL_MISSING) @@ -386,18 +411,23 @@ print_qpsol_option_list (); return retval; } - else if (nargin == 2) + else if (nargin == 1 || nargin == 2) { char *keyword = args(0).string_value (); if (! error_state) { - double val = args(1).double_value (); + if (nargin == 1) + return show_qpsol_option (keyword); + else + { + double val = args(1).double_value (); - if (! error_state) - { - do_qpsol_option (keyword, val); - return retval; + if (! error_state) + { + set_qpsol_option (keyword, val); + return retval; + } } } }
--- a/src/quad.cc +++ b/src/quad.cc @@ -306,7 +306,7 @@ } static void -do_quad_option (char *keyword, double val) +set_quad_option (char *keyword, double val) { QUAD_OPTIONS *list = quad_option_table; @@ -325,6 +325,28 @@ warning ("quad_options: no match for `%s'", keyword); } +static Octave_object +show_quad_option (char *keyword) +{ + Octave_object retval; + + QUAD_OPTIONS *list = quad_option_table; + + while (list->keyword != 0) + { + if (keyword_almost_match (list->kw_tok, list->min_len, keyword, + list->min_toks_to_match, MAX_TOKENS)) + { + return (quad_opts.*list->d_get_fcn) (); + } + list++; + } + + warning ("quad_options: no match for `%s'", keyword); + + return retval; +} + DEFUN_DLD_BUILTIN ("quad_options", Fquad_options, Squad_options, -1, 1, "quad_options (KEYWORD, VALUE)\n\ \n\ @@ -340,18 +362,23 @@ print_quad_option_list (); return retval; } - else if (nargin == 2) + else if (nargin == 1 || nargin == 2) { char *keyword = args(0).string_value (); if (! error_state) { - double val = args(1).double_value (); + if (nargin == 1) + return show_quad_option (keyword); + else + { + double val = args(1).double_value (); - if (! error_state) - { - do_quad_option (keyword, val); - return retval; + if (! error_state) + { + set_quad_option (keyword, val); + return retval; + } } } }