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),
""),
79 m_cat_ops (
dim_vector (init_tab_sz, init_tab_sz), nullptr),
82 m_pref_assign_conv (
dim_vector (init_tab_sz, init_tab_sz), -1),
83 m_widening_ops (
dim_vector (init_tab_sz, init_tab_sz), nullptr)
93 bool abort_on_duplicate)
101 if (abort_on_duplicate)
103 std::cerr <<
"duplicate type " << t_name << std::endl;
107 warning (
"duplicate type %s\n", t_name.c_str ());
166 bool abort_on_duplicate)
172 if (abort_on_duplicate)
174 std::cerr <<
"duplicate unary operator '" << op_name
175 <<
"' for class dispatch" << std::endl;
179 warning (
"duplicate unary operator '%s' for class dispatch",
184 =
reinterpret_cast<void *
> (
f);
195 std::string type_name =
m_types(t);
197 if (abort_on_duplicate)
199 std::cerr <<
"duplicate unary operator '" << op_name
200 <<
"' for type '" << type_name <<
"'" << std::endl;
204 warning (
"duplicate unary operator '%s' for type '%s'",
205 op_name.c_str (), type_name.c_str ());
216 bool abort_on_duplicate)
221 std::string type_name =
m_types(t);
223 if (abort_on_duplicate)
225 std::cerr <<
"duplicate unary operator '" << op_name
226 <<
"' for type '" << type_name <<
"'" << std::endl;
230 warning (
"duplicate unary operator '%s' for type '%s'",
231 op_name.c_str (), type_name.c_str ());
235 =
reinterpret_cast<void *
> (
f);
243 bool abort_on_duplicate)
249 if (abort_on_duplicate)
252 std::cerr <<
"duplicate binary operator '" << op_name
253 <<
"' for class dispatch" << std::endl;
257 warning (
"duplicate binary operator '%s' for class dispatch",
262 =
reinterpret_cast<void *
> (
f);
270 bool abort_on_duplicate)
275 std::string t1_name =
m_types(t1);
276 std::string t2_name =
m_types(t2);
278 if (abort_on_duplicate)
280 std::cerr <<
"duplicate binary operator '" << op_name
281 <<
"' for types '" << t1_name <<
"' and '"
282 << t2_name <<
"'" << std::endl;
286 warning (
"duplicate binary operator '%s' for types '%s' and '%s'",
287 op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
291 =
reinterpret_cast<void *
> (
f);
299 bool abort_on_duplicate)
305 if (abort_on_duplicate)
307 std::cerr <<
"duplicate compound binary operator '"
308 << op_name <<
"' for class dispatch" << std::endl;
312 warning (
"duplicate compound binary operator '%s' for class dispatch",
317 =
reinterpret_cast<void *
> (
f);
325 bool abort_on_duplicate)
330 std::string t1_name =
m_types(t1);
331 std::string t2_name =
m_types(t2);
333 if (abort_on_duplicate)
335 std::cerr <<
"duplicate compound binary operator '"
336 << op_name <<
"' for types '" << t1_name
337 <<
"' and '" << t2_name <<
"'" << std::endl;
341 warning (
"duplicate compound binary operator '%s' for types '%s' and '%s'",
342 op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
346 =
reinterpret_cast<void *
> (
f);
352 bool abort_on_duplicate)
356 std::string t1_name =
m_types(t1);
357 std::string t2_name =
m_types(t2);
359 if (abort_on_duplicate)
361 std::cerr <<
"duplicate concatenation operator for types '"
362 << t1_name <<
"' and '" << t2_name <<
"'" << std::endl;
366 warning (
"duplicate concatenation operator for types '%s' and '%s'",
367 t1_name.c_str (), t1_name.c_str ());
376 int t_lhs,
int t_rhs,
378 bool abort_on_duplicate)
383 std::string t_lhs_name =
m_types(t_lhs);
384 std::string t_rhs_name =
m_types(t_rhs);
386 if (abort_on_duplicate)
388 std::cerr <<
"duplicate assignment operator '"
389 << op_name <<
"' for types '" << t_lhs_name
390 <<
"' and '" << t_rhs_name <<
"'" << std::endl;
394 warning (
"duplicate assignment operator '%s' for types '%s' and '%s'",
395 op_name.c_str (), t_lhs_name.c_str (), t_rhs_name.c_str ());
399 =
reinterpret_cast<void *
> (
f);
406 bool abort_on_duplicate)
411 std::string t_lhs_name =
m_types(t_lhs);
413 if (abort_on_duplicate)
415 std::cerr <<
"duplicate assignment operator '" << op_name
416 <<
"' for types '" << t_lhs_name <<
"'" << std::endl;
420 warning (
"duplicate assignment operator '%s' for types '%s'",
421 op_name.c_str (), t_lhs_name.c_str ());
425 =
reinterpret_cast<void *
> (
f);
432 bool abort_on_duplicate)
436 std::string t_lhs_name =
m_types(t_lhs);
437 std::string t_rhs_name =
m_types(t_rhs);
439 if (abort_on_duplicate)
441 std::cerr <<
"overriding assignment conversion for types '"
442 << t_lhs_name <<
"' and '" << t_rhs_name <<
"'"
447 warning (
"overriding assignment conversion for types '%s' and '%s'",
448 t_lhs_name.c_str (), t_rhs_name.c_str ());
458 bool abort_on_duplicate)
462 std::string t_name =
m_types(t);
463 std::string t_result_name =
m_types(t_result);
465 if (abort_on_duplicate)
467 std::cerr <<
"overriding widening op for '" << t_name
468 <<
"' to '" << t_result_name <<
"'" << std::endl;
472 warning (
"overriding widening op for '%s' to '%s'",
473 t_name.c_str (), t_result_name.c_str ());
557 int t_lhs,
int t_rhs)
608 for (
int i = 0; i <
len; i++)
633 for (
int i = 0; i <
len; i++)
658 for (
int j = 0; j <
len; j++)
659 for (
int i = 0; i <
len; i++)
684 for (
int j = 0; j <
len; j++)
685 for (
int i = 0; i <
len; i++)
711 for (
int j = 0; j <
len; j++)
712 for (
int i = 0; i <
len; i++)
737 for (
int i = 0; i <
len; i++)
908 int nargin = args.length ();
920 return ovl (args(0).type_name ());
1022 DEFMETHOD (__dump_typeinfo__, interp, args, ,
1028 if (args.length () > 0)
charNDArray min(char d, const charNDArray &m)
N Dimensional Array with copy-on-write semantics.
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type columns(void) const
OCTARRAY_OVERRIDABLE_FUNC_API 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.
OCTARRAY_API T & checkelem(octave_idx_type n)
Size of the specified dimension.
OCTARRAY_OVERRIDABLE_FUNC_API T & xelem(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)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
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,...)
type_info & __get_type_info__(void)
F77_RET_T const F77_DBLE * x
F77_RET_T const F77_DBLE const F77_DBLE * f
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value lookup_type(const std::string &nm)
octave_base_value::type_conv_fcn lookup_widening_op(int t, int t_result)
unary_class_op_fcn lookup_unary_class_op(octave_value::unary_op op)
non_const_unary_op_fcn lookup_non_const_unary_op(octave_value::unary_op op, int t)
octave_scalar_map installed_type_info(void)
int register_type(const std::string &t_name, const std::string &c_name, const octave_value &val)
binary_op_fcn lookup_binary_op(octave_value::binary_op op, int t1, int t2)
static boolNDArray as_bool_nd_array(const Array< void * > &x)
binary_class_op_fcn lookup_binary_class_op(octave_value::binary_op op)
assign_op_fcn lookup_assign_op(octave_value::assign_op op, int t_lhs, int t_rhs)
string_vector installed_type_names(void)
static NDArray as_nd_array(const Array< int > &x)
unary_op_fcn lookup_unary_op(octave_value::unary_op op, int t)
assignany_op_fcn lookup_assignany_op(octave_value::assign_op op, int t_lhs)
void install_ops(type_info &ti)
int lookup_pref_assign_conv(int t_lhs, int t_rhs)
cat_op_fcn lookup_cat_op(int t1, int t2)
octave::type_info::binary_op_fcn binary_op_fcn
octave::type_info::binary_class_op_fcn binary_class_op_fcn
octave::type_info::assign_op_fcn assign_op_fcn
octave::type_info::non_const_unary_op_fcn non_const_unary_op_fcn
octave::type_info::assignany_op_fcn assignany_op_fcn
octave::type_info::unary_op_fcn unary_op_fcn
octave::type_info::cat_op_fcn cat_op_fcn
octave::type_info::unary_class_op_fcn unary_class_op_fcn
OCTINTERP_API void install_types(octave::type_info &)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.