26 #if defined (HAVE_CONFIG_H)
84 catch (octave::execution_exception& ee)
89 if (tmp.
empty () || ! tmp(0).is_defined ())
94 warning (
"lsode: ignoring imaginary part returned from user-supplied function");
98 retval = tmp(0).xvector_value (
"lsode: expecting user supplied function to return numeric vector");
124 catch (octave::execution_exception& ee)
129 if (tmp.
empty () || ! tmp(0).is_defined ())
134 warning (
"lsode: ignoring imaginary part returned from user-supplied jacobian function");
139 0).xmatrix_value (
"lsode: expecting user supplied jacobian function to return numeric array");
283 int nargin = args.length ();
285 if (nargin < 3 || nargin > 4)
295 error (
"lsode: invalid recursive call");
299 std::string fcn_name, fname, jac_name, jname;
306 std::list<std::string> parameter_names ({
"x",
"t"});
313 else if (c.
numel () == 2)
326 error (
"lsode: incorrect number of elements in cell array");
335 switch (f_arg.
rows ())
360 error (
"lsode: first arg should be a string or 2-element string array");
366 error (
"lsode: FCN argument is not a valid function name or handle");
368 ColumnVector state = args(1).xvector_value (
"lsode: initial state X_0 must be a vector");
369 ColumnVector out_times = args(2).xvector_value (
"lsode: output time variable T must be a vector");
373 int crit_times_set = 0;
376 crit_times = args(3).xvector_value (
"lsode: list of critical times T_CRIT must be a vector");
381 double tzero = out_times (0);
394 output = ode.
integrate (out_times, crit_times);
398 if (fcn_name.length ())
400 if (jac_name.length ())
409 else if (nargout < 2)
410 error (
"lsode: %s", msg.c_str ());
static LSODE_options lsode_opts
OCTARRAY_OVERRIDABLE_FUNC_API bool isempty(void) const
Size of the specified dimension.
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type numel(void) const
Number of elements in the array.
std::string error_message(void) const
ODEFunc & set_jacobian_function(ODEJacFunc j)
virtual ColumnVector integrate(double tt)
bool integration_ok(void) const
octave_idx_type integration_state(void) const
octave_idx_type rows(void) const
bool is_defined(void) const
Cell cell_value(void) const
bool is_function_handle(void) const
string_vector string_vector_value(bool pad=false) const
bool is_undefined(void) const
bool is_inline_function(void) const
void clear_function(const std::string &name)
OCTINTERP_API void print_usage(void)
void warning(const char *fmt,...)
void error(const char *fmt,...)
void err_user_supplied_eval(const char *name)
octave_value get_function_handle(interpreter &interp, const octave_value &arg, const std::string ¶meter_name)
F77_RET_T const F77_DBLE * x
static octave_value lsode_jac
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value lsode_fcn
DEFMETHOD(lsode, interp, args, nargout, doc:)
static bool warned_jac_imaginary
static Matrix lsode_user_jacobian(const ColumnVector &x, double t)
static bool warned_fcn_imaginary
static ColumnVector lsode_user_function(const ColumnVector &x, double t)
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
static uint32_t state[624]