26 #if defined (HAVE_CONFIG_H)
82 catch (octave::execution_exception& e)
87 if (tmp.
empty () || ! tmp(0).is_defined ())
92 warning (
"lsode: ignoring imaginary part returned from user-supplied function");
96 retval = tmp(0).xvector_value (
"lsode: expecting user supplied function to return numeric vector");
122 catch (octave::execution_exception& e)
127 if (tmp.
empty () || ! tmp(0).is_defined ())
132 warning (
"lsode: ignoring imaginary part returned from user-supplied jacobian function");
136 retval = tmp(0).xmatrix_value (
"lsode: expecting user supplied jacobian function to return numeric array");
264 int nargin = args.length ();
266 if (nargin < 3 || nargin > 4)
278 error (
"lsode: invalid recursive call");
282 std::string fcn_name, fname, jac_name, jname;
289 std::list<std::string> parameter_names ({
"x",
"t"});
296 else if (c.
numel () == 2)
311 error (
"lsode: incorrect number of elements in cell array");
320 switch (f_arg.
rows ())
346 error (
"lsode: first arg should be a string or 2-element string array");
352 error (
"lsode: FCN argument is not a valid function name or handle");
354 ColumnVector state = args(1).xvector_value (
"lsode: initial state X_0 must be a vector");
355 ColumnVector out_times = args(2).xvector_value (
"lsode: output time variable T must be a vector");
359 int crit_times_set = 0;
362 crit_times = args(3).xvector_value (
"lsode: list of critical times T_CRIT must be a vector");
367 double tzero = out_times (0);
380 output = ode.
integrate (out_times, crit_times);
384 if (fcn_name.length ())
386 if (jac_name.length ())
395 else if (nargout < 2)
396 error (
"lsode: %s", msg.c_str ());
static LSODE_options lsode_opts
octave_idx_type numel(void) const
Number of elements in the array.
bool isempty(void) const
Size of the specified dimension.
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
void clear_function(const std::string &name)
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
OCTINTERP_API void print_usage(void)
void warning(const char *fmt,...)
void error(const char *fmt,...)
void err_user_supplied_eval(const char *name)
F77_RET_T const F77_DBLE * x
static octave_value lsode_jac
Matrix lsode_user_jacobian(const ColumnVector &x, double t)
DEFMETHOD(lsode, interp, args, nargout, doc:)
static bool warned_jac_imaginary
static octave_value lsode_fcn
ColumnVector lsode_user_function(const ColumnVector &x, double t)
static bool warned_fcn_imaginary
static uint32_t state[624]
octave_value get_function_handle(interpreter &interp, const octave_value &arg, const std::string ¶meter_name)
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()) ? '\'' :'"'))
octave_value::octave_value(const Array< char > &chm, char type) return retval