26#if defined (HAVE_CONFIG_H)
52 for (
int i = 0; i <
x.numel (); i++)
69 : m_num_types (0), m_types (
dim_vector (init_tab_sz, 1),
""),
77 m_compound_binary_ops (
dim_vector (
octave_value::num_compound_binary_ops, init_tab_sz, init_tab_sz), nullptr),
78 m_cat_ops (
dim_vector (init_tab_sz, init_tab_sz), nullptr),
81 m_pref_assign_conv (
dim_vector (init_tab_sz, init_tab_sz), -1),
82 m_widening_ops (
dim_vector (init_tab_sz, init_tab_sz), nullptr)
92 bool abort_on_duplicate)
100 if (abort_on_duplicate)
102 std::cerr <<
"duplicate type " << t_name << std::endl;
106 warning (
"duplicate type %s\n", t_name.c_str ());
165 bool abort_on_duplicate)
171 if (abort_on_duplicate)
173 std::cerr <<
"duplicate unary operator '" << op_name
174 <<
"' for class dispatch" << std::endl;
178 warning (
"duplicate unary operator '%s' for class dispatch",
183 =
reinterpret_cast<void *
> (
f);
194 std::string type_name =
m_types(t);
196 if (abort_on_duplicate)
198 std::cerr <<
"duplicate unary operator '" << op_name
199 <<
"' for type '" << type_name <<
"'" << std::endl;
203 warning (
"duplicate unary operator '%s' for type '%s'",
204 op_name.c_str (), type_name.c_str ());
215 bool abort_on_duplicate)
220 std::string type_name =
m_types(t);
222 if (abort_on_duplicate)
224 std::cerr <<
"duplicate unary operator '" << op_name
225 <<
"' for type '" << type_name <<
"'" << std::endl;
229 warning (
"duplicate unary operator '%s' for type '%s'",
230 op_name.c_str (), type_name.c_str ());
234 =
reinterpret_cast<void *
> (
f);
242 bool abort_on_duplicate)
248 if (abort_on_duplicate)
251 std::cerr <<
"duplicate binary operator '" << op_name
252 <<
"' for class dispatch" << std::endl;
256 warning (
"duplicate binary operator '%s' for class dispatch",
261 =
reinterpret_cast<void *
> (
f);
269 bool abort_on_duplicate)
274 std::string t1_name =
m_types(t1);
275 std::string t2_name =
m_types(t2);
277 if (abort_on_duplicate)
279 std::cerr <<
"duplicate binary operator '" << op_name
280 <<
"' for types '" << t1_name <<
"' and '"
281 << t2_name <<
"'" << std::endl;
285 warning (
"duplicate binary operator '%s' for types '%s' and '%s'",
286 op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
290 =
reinterpret_cast<void *
> (
f);
298 bool abort_on_duplicate)
304 if (abort_on_duplicate)
306 std::cerr <<
"duplicate compound binary operator '"
307 << op_name <<
"' for class dispatch" << std::endl;
311 warning (
"duplicate compound binary operator '%s' for class dispatch",
316 =
reinterpret_cast<void *
> (
f);
324 bool abort_on_duplicate)
329 std::string t1_name =
m_types(t1);
330 std::string t2_name =
m_types(t2);
332 if (abort_on_duplicate)
334 std::cerr <<
"duplicate compound binary operator '"
335 << op_name <<
"' for types '" << t1_name
336 <<
"' and '" << t2_name <<
"'" << std::endl;
340 warning (
"duplicate compound binary operator '%s' for types '%s' and '%s'",
341 op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
345 =
reinterpret_cast<void *
> (
f);
351 bool abort_on_duplicate)
355 std::string t1_name =
m_types(t1);
356 std::string t2_name =
m_types(t2);
358 if (abort_on_duplicate)
360 std::cerr <<
"duplicate concatenation operator for types '"
361 << t1_name <<
"' and '" << t2_name <<
"'" << std::endl;
365 warning (
"duplicate concatenation operator for types '%s' and '%s'",
366 t1_name.c_str (), t1_name.c_str ());
375 int t_lhs,
int t_rhs,
377 bool abort_on_duplicate)
382 std::string t_lhs_name =
m_types(t_lhs);
383 std::string t_rhs_name =
m_types(t_rhs);
385 if (abort_on_duplicate)
387 std::cerr <<
"duplicate assignment operator '"
388 << op_name <<
"' for types '" << t_lhs_name
389 <<
"' and '" << t_rhs_name <<
"'" << std::endl;
393 warning (
"duplicate assignment operator '%s' for types '%s' and '%s'",
394 op_name.c_str (), t_lhs_name.c_str (), t_rhs_name.c_str ());
398 =
reinterpret_cast<void *
> (
f);
405 bool abort_on_duplicate)
410 std::string t_lhs_name =
m_types(t_lhs);
412 if (abort_on_duplicate)
414 std::cerr <<
"duplicate assignment operator '" << op_name
415 <<
"' for types '" << t_lhs_name <<
"'" << std::endl;
419 warning (
"duplicate assignment operator '%s' for types '%s'",
420 op_name.c_str (), t_lhs_name.c_str ());
424 =
reinterpret_cast<void *
> (
f);
431 bool abort_on_duplicate)
435 std::string t_lhs_name =
m_types(t_lhs);
436 std::string t_rhs_name =
m_types(t_rhs);
438 if (abort_on_duplicate)
440 std::cerr <<
"overriding assignment conversion for types '"
441 << t_lhs_name <<
"' and '" << t_rhs_name <<
"'"
446 warning (
"overriding assignment conversion for types '%s' and '%s'",
447 t_lhs_name.c_str (), t_rhs_name.c_str ());
457 bool abort_on_duplicate)
461 std::string t_name =
m_types(t);
462 std::string t_result_name =
m_types(t_result);
464 if (abort_on_duplicate)
466 std::cerr <<
"overriding widening op for '" << t_name
467 <<
"' to '" << t_result_name <<
"'" << std::endl;
471 warning (
"overriding widening op for '%s' to '%s'",
472 t_name.c_str (), t_result_name.c_str ());
556 int t_lhs,
int t_rhs)
607 for (
int i = 0; i <
len; i++)
632 for (
int i = 0; i <
len; i++)
656 for (
int j = 0; j <
len; j++)
657 for (
int i = 0; i <
len; i++)
682 for (
int j = 0; j <
len; j++)
683 for (
int i = 0; i <
len; i++)
708 for (
int j = 0; j <
len; j++)
709 for (
int i = 0; i <
len; i++)
733 for (
int i = 0; i <
len; i++)
905OCTAVE_NAMESPACE_BEGIN
919 int nargin = args.length ();
931 return ovl (args(0).type_name ());
1033DEFMETHOD (__dump_typeinfo__, interp, args, ,
1039 if (args.length () > 0)
charNDArray min(char d, const charNDArray &m)
T & xelem(octave_idx_type n)
Size of the specified dimension.
octave_idx_type numel(void) const
Number of elements in the array.
OCTARRAY_API void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
octave_idx_type columns(void) const
OCTARRAY_API T & checkelem(octave_idx_type n)
Size of the specified dimension.
Vector representing the dimensions (size) of an Array.
octave_base_value *(* type_conv_fcn)(const octave_base_value &)
void setfield(const std::string &key, const octave_value &val)
static OCTINTERP_API std::string binary_op_as_string(binary_op)
static OCTINTERP_API std::string assign_op_as_string(assign_op)
@ num_compound_binary_ops
static OCTINTERP_API std::string unary_op_as_string(unary_op)
static OCTINTERP_API std::string binary_op_fcn_name(binary_op)
bool register_assignany_op(octave_value::assign_op, int, assignany_op_fcn, bool abort_on_duplicate=false)
Array< void * > m_compound_binary_class_ops
octave_value(* unary_op_fcn)(const octave_base_value &)
Array< void * > m_compound_binary_ops
assignany_op_fcn lookup_assignany_op(octave_value::assign_op, int)
octave_value lookup_type(const std::string &nm)
octave_value(* binary_op_fcn)(const octave_base_value &, const octave_base_value &)
assign_op_fcn lookup_assign_op(octave_value::assign_op, int, int)
Array< octave_value * > m_vals
Array< void * > m_binary_ops
Array< void * > m_cat_ops
Array< void * > m_unary_class_ops
bool register_widening_op(int, int, octave_base_value::type_conv_fcn, bool abort_on_duplicate=false)
Array< std::string > m_types
bool register_cat_op(int, int, cat_op_fcn, bool abort_on_duplicate=false)
octave_scalar_map non_const_unary_ops_map(void) const
bool register_unary_class_op(octave_value::unary_op, unary_class_op_fcn, bool abort_on_duplicate=false)
Array< void * > m_assignany_ops
octave_value(* assignany_op_fcn)(octave_base_value &, const octave_value_list &, const octave_value &)
bool register_binary_class_op(octave_value::binary_op, binary_class_op_fcn, bool abort_on_duplicate=false)
octave_scalar_map compound_binary_ops_map(void) const
octave_scalar_map unary_ops_map(void) const
octave_scalar_map binary_ops_map(void) const
octave_base_value::type_conv_fcn lookup_widening_op(int, int)
non_const_unary_op_fcn lookup_non_const_unary_op(octave_value::unary_op, int)
Array< void * > m_unary_ops
Array< void * > m_widening_ops
octave_value(* binary_class_op_fcn)(const octave_value &, const octave_value &)
Array< void * > m_non_const_unary_ops
octave_scalar_map installed_type_info(void) const
binary_class_op_fcn lookup_binary_class_op(octave_value::binary_op)
type_info(int init_tab_sz=16)
Array< void * > m_assign_ops
bool register_non_const_unary_op(octave_value::unary_op, int, non_const_unary_op_fcn, bool abort_on_duplicate=false)
bool register_unary_op(octave_value::unary_op, int, unary_op_fcn, bool abort_on_duplicate=false)
bool register_binary_op(octave_value::binary_op, int, int, binary_op_fcn, bool abort_on_duplicate=false)
octave_value(* cat_op_fcn)(const octave_base_value &, const octave_base_value &, const Array< octave_idx_type > &ra_idx)
octave_value(* unary_class_op_fcn)(const octave_value &)
octave_value(* assign_op_fcn)(octave_base_value &, const octave_value_list &, const octave_base_value &)
Array< int > m_pref_assign_conv
void(* non_const_unary_op_fcn)(octave_base_value &)
Array< void * > m_binary_class_ops
octave_scalar_map assignany_ops_map(void) const
unary_class_op_fcn lookup_unary_class_op(octave_value::unary_op)
bool register_pref_assign_conv(int, int, int, bool abort_on_duplicate=false)
cat_op_fcn lookup_cat_op(int, int)
binary_op_fcn lookup_binary_op(octave_value::binary_op, int, int)
int lookup_pref_assign_conv(int, int)
octave_scalar_map assign_ops_map(void) const
string_vector installed_type_names(void) const
unary_op_fcn lookup_unary_op(octave_value::unary_op, int)
bool register_assign_op(octave_value::assign_op, int, int, assign_op_fcn, bool abort_on_duplicate=false)
int register_type(const std::string &, const std::string &, const octave_value &, bool abort_on_duplicate=false)
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
F77_RET_T const F77_DBLE const F77_DBLE * f
int register_type(const std::string &t_name, const std::string &c_name, const octave_value &val)
octave_scalar_map installed_type_info(void)
unary_op_fcn lookup_unary_op(octave_value::unary_op op, int t)
unary_class_op_fcn lookup_unary_class_op(octave_value::unary_op op)
octave::type_info::cat_op_fcn cat_op_fcn
octave::type_info::assign_op_fcn assign_op_fcn
octave::type_info::unary_class_op_fcn unary_class_op_fcn
octave_base_value::type_conv_fcn lookup_widening_op(int t, int t_result)
octave::type_info::assignany_op_fcn assignany_op_fcn
binary_class_op_fcn lookup_binary_class_op(octave_value::binary_op op)
assignany_op_fcn lookup_assignany_op(octave_value::assign_op op, int t_lhs)
int lookup_pref_assign_conv(int t_lhs, int t_rhs)
string_vector installed_type_names(void)
cat_op_fcn lookup_cat_op(int t1, int t2)
non_const_unary_op_fcn lookup_non_const_unary_op(octave_value::unary_op op, int t)
assign_op_fcn lookup_assign_op(octave_value::assign_op op, int t_lhs, int t_rhs)
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
binary_op_fcn lookup_binary_op(octave_value::binary_op op, int t1, int t2)
octave_value lookup_type(const std::string &nm)
octave::type_info::binary_op_fcn binary_op_fcn
type_info & __get_type_info__(const std::string &who)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
static boolNDArray as_bool_nd_array(const Array< void * > &x)
static NDArray as_nd_array(const Array< int > &x)
OCTAVE_NAMESPACE_BEGIN void install_ops(type_info &ti)
OCTINTERP_API void install_types(octave::type_info &)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.