26 #if defined (HAVE_CONFIG_H)
51 for (
int i = 0; i <
x.numel (); i++)
68 : num_types (0), types (
dim_vector (init_tab_sz, 1),
""),
76 compound_binary_ops (
dim_vector (
octave_value::num_compound_binary_ops, init_tab_sz, init_tab_sz), nullptr),
77 cat_ops (
dim_vector (init_tab_sz, init_tab_sz), nullptr),
80 pref_assign_conv (
dim_vector (init_tab_sz, init_tab_sz), -1),
81 widening_ops (
dim_vector (init_tab_sz, init_tab_sz), nullptr)
91 bool abort_on_duplicate)
97 if (t_name ==
types (i))
99 if (abort_on_duplicate)
101 std::cerr <<
"duplicate type " << t_name << std::endl;
105 warning (
"duplicate type %s\n", t_name.c_str ());
164 bool abort_on_duplicate)
170 if (abort_on_duplicate)
172 std::cerr <<
"duplicate unary operator '" << op_name
173 <<
"' for class dispatch" << std::endl;
177 warning (
"duplicate unary operator '%s' for class dispatch",
182 =
reinterpret_cast<void *
> (
f);
193 std::string type_name =
types(t);
195 if (abort_on_duplicate)
197 std::cerr <<
"duplicate unary operator '" << op_name
198 <<
"' for type '" << type_name <<
"'" << std::endl;
202 warning (
"duplicate unary operator '%s' for type '%s'",
203 op_name.c_str (), type_name.c_str ());
214 bool abort_on_duplicate)
219 std::string type_name =
types(t);
221 if (abort_on_duplicate)
223 std::cerr <<
"duplicate unary operator '" << op_name
224 <<
"' for type '" << type_name <<
"'" << std::endl;
228 warning (
"duplicate unary operator '%s' for type '%s'",
229 op_name.c_str (), type_name.c_str ());
233 =
reinterpret_cast<void *
> (
f);
241 bool abort_on_duplicate)
247 if (abort_on_duplicate)
250 std::cerr <<
"duplicate binary operator '" << op_name
251 <<
"' for class dispatch" << std::endl;
255 warning (
"duplicate binary operator '%s' for class dispatch",
260 =
reinterpret_cast<void *
> (
f);
268 bool abort_on_duplicate)
273 std::string t1_name =
types(t1);
274 std::string t2_name =
types(t2);
276 if (abort_on_duplicate)
278 std::cerr <<
"duplicate binary operator '" << op_name
279 <<
"' for types '" << t1_name <<
"' and '"
280 << t2_name <<
"'" << std::endl;
284 warning (
"duplicate binary operator '%s' for types '%s' and '%s'",
285 op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
289 =
reinterpret_cast<void *
> (
f);
297 bool abort_on_duplicate)
303 if (abort_on_duplicate)
305 std::cerr <<
"duplicate compound binary operator '"
306 << op_name <<
"' for class dispatch" << std::endl;
310 warning (
"duplicate compound binary operator '%s' for class dispatch",
315 =
reinterpret_cast<void *
> (
f);
323 bool abort_on_duplicate)
328 std::string t1_name =
types(t1);
329 std::string t2_name =
types(t2);
331 if (abort_on_duplicate)
333 std::cerr <<
"duplicate compound binary operator '"
334 << op_name <<
"' for types '" << t1_name
335 <<
"' and '" << t2_name <<
"'" << std::endl;
339 warning (
"duplicate compound binary operator '%s' for types '%s' and '%s'",
340 op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
344 =
reinterpret_cast<void *
> (
f);
350 bool abort_on_duplicate)
354 std::string t1_name =
types(t1);
355 std::string t2_name =
types(t2);
357 if (abort_on_duplicate)
359 std::cerr <<
"duplicate concatenation operator for types '"
360 << t1_name <<
"' and '" << t2_name <<
"'" << std::endl;
364 warning (
"duplicate concatenation operator for types '%s' and '%s'",
365 t1_name.c_str (), t1_name.c_str ());
374 int t_lhs,
int t_rhs,
376 bool abort_on_duplicate)
381 std::string t_lhs_name =
types(t_lhs);
382 std::string t_rhs_name =
types(t_rhs);
384 if (abort_on_duplicate)
386 std::cerr <<
"duplicate assignment operator '"
387 << op_name <<
"' for types '" << t_lhs_name
388 <<
"' and '" << t_rhs_name <<
"'" << std::endl;
392 warning (
"duplicate assignment operator '%s' for types '%s' and '%s'",
393 op_name.c_str (), t_lhs_name.c_str (), t_rhs_name.c_str ());
397 =
reinterpret_cast<void *
> (
f);
404 bool abort_on_duplicate)
409 std::string t_lhs_name =
types(t_lhs);
411 if (abort_on_duplicate)
413 std::cerr <<
"duplicate assignment operator '" << op_name
414 <<
"' for types '" << t_lhs_name <<
"'" << std::endl;
418 warning (
"duplicate assignment operator '%s' for types '%s'",
419 op_name.c_str (), t_lhs_name.c_str ());
423 =
reinterpret_cast<void *
> (
f);
430 bool abort_on_duplicate)
434 std::string t_lhs_name =
types(t_lhs);
435 std::string t_rhs_name =
types(t_rhs);
437 if (abort_on_duplicate)
439 std::cerr <<
"overriding assignment conversion for types '"
440 << t_lhs_name <<
"' and '" << t_rhs_name <<
"'"
445 warning (
"overriding assignment conversion for types '%s' and '%s'",
446 t_lhs_name.c_str (), t_rhs_name.c_str ());
456 bool abort_on_duplicate)
460 std::string t_name =
types(t);
461 std::string t_result_name =
types(t_result);
463 if (abort_on_duplicate)
465 std::cerr <<
"overriding widening op for '" << t_name
466 <<
"' to '" << t_result_name <<
"'" << std::endl;
470 warning (
"overriding widening op for '%s' to '%s'",
471 t_name.c_str (), t_result_name.c_str ());
555 int t_lhs,
int t_rhs)
606 for (
int i = 0; i <
len; i++)
631 for (
int i = 0; i <
len; i++)
655 for (
int j = 0; j <
len; j++)
656 for (
int i = 0; i <
len; i++)
681 for (
int j = 0; j <
len; j++)
682 for (
int i = 0; i <
len; i++)
707 for (
int j = 0; j <
len; j++)
708 for (
int i = 0; i <
len; i++)
732 for (
int i = 0; i <
len; i++)
915 int nargin = args.length ();
927 return ovl (args(0).type_name ());
1024 DEFMETHOD (__dump_typeinfo__, interp, args, ,
1030 if (args.length () > 0)
charNDArray min(char d, const charNDArray &m)
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
octave_idx_type columns(void) const
T & xelem(octave_idx_type n)
Size of the specified dimension.
octave_idx_type numel(void) const
Number of elements in the array.
T & checkelem(octave_idx_type n)
Size of the specified dimension.
Vector representing the dimensions (size) of an Array.
unary_class_op_fcn lookup_unary_class_op(octave_value::unary_op)
octave_value(* assignany_op_fcn)(octave_base_value &, const octave_value_list &, const octave_value &)
octave_scalar_map compound_binary_ops_map(void) const
Array< void * > assignany_ops
Array< void * > unary_ops
octave_value lookup_type(const std::string &nm)
unary_op_fcn lookup_unary_op(octave_value::unary_op, int)
bool register_unary_class_op(octave_value::unary_op, unary_class_op_fcn, bool abort_on_duplicate=false)
octave_value(* binary_class_op_fcn)(const octave_value &, const octave_value &)
Array< octave_value * > vals
non_const_unary_op_fcn lookup_non_const_unary_op(octave_value::unary_op, int)
octave_scalar_map non_const_unary_ops_map(void) const
bool register_binary_class_op(octave_value::binary_op, binary_class_op_fcn, bool abort_on_duplicate=false)
octave_scalar_map binary_ops_map(void) const
Array< int > pref_assign_conv
Array< void * > non_const_unary_ops
Array< void * > compound_binary_class_ops
int lookup_pref_assign_conv(int, int)
assign_op_fcn lookup_assign_op(octave_value::assign_op, int, int)
assignany_op_fcn lookup_assignany_op(octave_value::assign_op, int)
Array< void * > binary_class_ops
Array< void * > compound_binary_ops
octave_value(* unary_class_op_fcn)(const octave_value &)
Array< void * > widening_ops
type_info(int init_tab_sz=16)
bool register_binary_op(octave_value::binary_op, int, int, binary_op_fcn, bool abort_on_duplicate=false)
bool register_cat_op(int, int, cat_op_fcn, bool abort_on_duplicate=false)
octave_scalar_map unary_ops_map(void) const
bool register_assign_op(octave_value::assign_op, int, int, assign_op_fcn, bool abort_on_duplicate=false)
octave_value(* assign_op_fcn)(octave_base_value &, const octave_value_list &, const octave_base_value &)
Array< void * > assign_ops
int register_type(const std::string &, const std::string &, const octave_value &, bool abort_on_duplicate=false)
octave_value(* binary_op_fcn)(const octave_base_value &, const octave_base_value &)
octave_scalar_map installed_type_info(void) const
octave_value(* unary_op_fcn)(const octave_base_value &)
bool register_non_const_unary_op(octave_value::unary_op, int, non_const_unary_op_fcn, bool abort_on_duplicate=false)
octave_value(* cat_op_fcn)(octave_base_value &, const octave_base_value &, const Array< octave_idx_type > &ra_idx)
binary_class_op_fcn lookup_binary_class_op(octave_value::binary_op)
Array< void * > binary_ops
octave_base_value::type_conv_fcn lookup_widening_op(int, int)
bool register_assignany_op(octave_value::assign_op, int, assignany_op_fcn, bool abort_on_duplicate=false)
bool register_widening_op(int, int, octave_base_value::type_conv_fcn, bool abort_on_duplicate=false)
binary_op_fcn lookup_binary_op(octave_value::binary_op, int, int)
Array< void * > unary_class_ops
Array< std::string > types
octave_scalar_map assign_ops_map(void) const
cat_op_fcn lookup_cat_op(int, int)
string_vector installed_type_names(void) const
void(* non_const_unary_op_fcn)(octave_base_value &)
octave_scalar_map assignany_ops_map(void) const
bool register_pref_assign_conv(int, int, int, bool abort_on_duplicate=false)
bool register_unary_op(octave_value::unary_op, int, unary_op_fcn, bool abort_on_duplicate=false)
octave_base_value *(* type_conv_fcn)(const octave_base_value &)
static std::string binary_op_as_string(binary_op)
static std::string assign_op_as_string(assign_op)
@ num_compound_binary_ops
static std::string unary_op_as_string(unary_op)
static std::string binary_op_fcn_name(binary_op)
OCTINTERP_API void print_usage(void)
#define DEFMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method.
void warning(const char *fmt,...)
F77_RET_T const F77_DBLE * x
binary_class_op_fcn lookup_binary_class_op(octave_value::binary_op op)
octave::type_info::cat_op_fcn cat_op_fcn
octave::type_info::assign_op_fcn assign_op_fcn
unary_class_op_fcn lookup_unary_class_op(octave_value::unary_op op)
int lookup_pref_assign_conv(int t_lhs, int t_rhs)
unary_op_fcn lookup_unary_op(octave_value::unary_op op, int t)
octave::type_info::unary_class_op_fcn unary_class_op_fcn
octave::type_info::assignany_op_fcn assignany_op_fcn
string_vector installed_type_names(void)
octave_value lookup_type(const std::string &nm)
assign_op_fcn lookup_assign_op(octave_value::assign_op op, int t_lhs, int t_rhs)
non_const_unary_op_fcn lookup_non_const_unary_op(octave_value::unary_op op, int t)
assignany_op_fcn lookup_assignany_op(octave_value::assign_op op, int t_lhs)
binary_op_fcn lookup_binary_op(octave_value::binary_op op, int t1, int t2)
int register_type(const std::string &t_name, const std::string &c_name, const octave_value &val)
octave_scalar_map installed_type_info(void)
octave::type_info::non_const_unary_op_fcn non_const_unary_op_fcn
octave::type_info::unary_op_fcn unary_op_fcn
octave::type_info::binary_class_op_fcn binary_class_op_fcn
octave::type_info::binary_op_fcn binary_op_fcn
octave_base_value::type_conv_fcn lookup_widening_op(int t, int t_result)
cat_op_fcn lookup_cat_op(int t1, int t2)
type_info & __get_type_info__(const std::string &who)
static double f(double k, double l_nu, double c_pm)
static NDArray as_nd_array(const Array< int > &x)
static boolNDArray as_bool_nd_array(const Array< void * > &x)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
void install_ops(octave::type_info &)
octave_value::octave_value(const Array< char > &chm, char type) return retval
void install_types(octave::type_info &ti)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.