26#if defined (HAVE_CONFIG_H)
106static bool Voptimize_diagonal_matrix =
true;
110static bool Voptimize_permutation_matrix =
true;
114static bool Voptimize_range =
true;
507#if defined (OCTAVE_HAVE_LONG_LONG_INT)
513#if defined (OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT)
574 : m_rep (Voptimize_diagonal_matrix
582 : m_rep (Voptimize_diagonal_matrix
590 : m_rep (Voptimize_diagonal_matrix
598 : m_rep (Voptimize_diagonal_matrix
606 : m_rep (Voptimize_diagonal_matrix
614 : m_rep (Voptimize_diagonal_matrix
694 : m_rep (Voptimize_diagonal_matrix
702 : m_rep (Voptimize_diagonal_matrix
734 : m_rep (Voptimize_permutation_matrix
856 : m_rep (new octave_int8_scalar (i))
862 : m_rep (new octave_uint8_scalar (i))
868 : m_rep (new octave_int16_scalar (i))
874 : m_rep (new octave_uint16_scalar (i))
880 : m_rep (new octave_int32_scalar (i))
886 : m_rep (new octave_uint32_scalar (i))
892 : m_rep (new octave_int64_scalar (i))
904 : m_rep (new octave_int8_matrix (inda))
910 : m_rep (new octave_int8_matrix (inda))
916 : m_rep (new octave_uint8_matrix (inda))
922 : m_rep (new octave_uint8_matrix (inda))
928 : m_rep (new octave_int16_matrix (inda))
934 : m_rep (new octave_int16_matrix (inda))
940 : m_rep (new octave_uint16_matrix (inda))
946 : m_rep (new octave_uint16_matrix (inda))
952 : m_rep (new octave_int32_matrix (inda))
958 : m_rep (new octave_int32_matrix (inda))
964 : m_rep (new octave_uint32_matrix (inda))
970 : m_rep (new octave_uint32_matrix (inda))
976 : m_rep (new octave_int64_matrix (inda))
982 : m_rep (new octave_int64_matrix (inda))
1010 octave::range<double>
range;
1013 octave::idx_vector::idx_class_type idx_class;
1018 switch (idx.idx_class ())
1020 case octave::idx_vector::class_range:
1021 case octave::idx_vector::class_vector:
1031 idx.unconvert (idx_class, scalar,
range, array, mask);
1035 case octave::idx_vector::class_colon:
1039 case octave::idx_vector::class_range:
1043 case octave::idx_vector::class_scalar:
1047 case octave::idx_vector::class_vector:
1051 case octave::idx_vector::class_mask:
1055 case octave::idx_vector::class_invalid:
1056 error (
"unexpected: invalid index in conversion to octave_value - please report this bug");
1076 : m_rep (force_range || Voptimize_range
1100 const std::list<std::string>& plist)
1107 const std::list<std::string>& plist)
1157 if (tmp && tmp !=
m_rep)
1168DEFUN (
double, args, ,
1175 if (args.length () != 1)
1178 return ovl (args(0).as_double ());
1212DEFUN (single, args, ,
1219 if (args.length () != 1)
1222 return args(0).as_single ();
1260 if (args.length () != 1)
1263 return args(0).as_int8 ();
1275DEFUN (int16, args, ,
1282 if (args.length () != 1)
1285 return args(0).as_int16 ();
1297DEFUN (int32, args, ,
1304 if (args.length () != 1)
1307 return args(0).as_int32 ();
1319DEFUN (int64, args, ,
1326 if (args.length () != 1)
1329 return args(0).as_int64 ();
1341DEFUN (uint8, args, ,
1348 if (args.length () != 1)
1351 return args(0).as_uint8 ();
1363DEFUN (uint16, args, ,
1370 if (args.length () != 1)
1373 return args(0).as_uint16 ();
1385DEFUN (uint32, args, ,
1392 if (args.length () != 1)
1395 return args(0).as_uint32 ();
1407DEFUN (uint64, args, ,
1414 if (args.length () != 1)
1417 return args(0).as_uint64 ();
1429OCTAVE_END_NAMESPACE(octave)
1435 std::list<octave_value_list> i;
1451 const std::list<octave_value_list>& idx,
int nargout)
1458 const std::list<octave_value_list>& idx,
1461 if (idx.size () > skip)
1463 std::list<octave_value_list> new_idx (std::next (idx.begin (), skip),
1465 return subsref (type.substr (skip), new_idx);
1473 const std::list<octave_value_list>& idx,
1476 if (idx.size () > skip)
1478 std::list<octave_value_list> new_idx (std::next (idx.begin (), skip),
1480 return subsref (type.substr (skip), new_idx, nargout);
1488 const std::list<octave_value_list>& idx,
1491 if (idx.size () > skip)
1493 std::list<octave_value_list> new_idx (std::next (idx.begin (), skip),
1495 return subsref (type.substr (skip), new_idx, auto_add);
1508 if (num_indices <
ndims)
1510 for (
int i = num_indices; i <
ndims; i++)
1511 dv(num_indices-1) *= dv(i);
1513 if (num_indices == 1)
1521 ndims = num_indices;
1526 return (index_position <
ndims ? dv(index_position) : 1);
1531 const std::list<octave_value_list>& idx,
1539 const std::list<octave_value_list>& idx,
1547 const std::list<octave_value_list>& idx,
1557 error (
"in computed assignment A(index) OP= X, A must be defined first");
1561 binary_op binop = op_eq_to_binary_op (op);
1563 t_rhs = octave::binary_op (binop, t, rhs);
1566 *
this =
subsasgn (type, idx, t_rhs);
1579 octave::type_info::assign_op_fcn
f =
nullptr;
1587 octave::type_info& ti = octave::__get_type_info__ ();
1589 f = ti.lookup_assign_op (op, tthis, trhs);
1601 binary_op binop = op_eq_to_binary_op (op);
1603 octave_value t = octave::binary_op (binop, *
this, rhs);
1609 error (
"in computed assignment A OP= X, A must be defined first");
1641 for (
int i = 0; i < dv.
ndims (); i++)
1659 bool retval =
false;
1691#if defined (OCTAVE_ENABLE_64)
1694 return int_value (req_int, frc_str_conv);
1701#if defined (OCTAVE_ENABLE_64)
1769make_vector_dims (
const dim_vector& dv,
bool force_vector_conversion,
1770 const std::string& my_type,
const std::string& wanted_type)
1773 retval.chop_trailing_singletons ();
1776 if (retval.ndims () > 2 || (retval(0) != 1 && retval(1) != 1))
1778 if (! force_vector_conversion)
1780 my_type.c_str (), wanted_type.c_str ());
1789 bool frc_vec_conv)
const
1797 bool frc_vec_conv)
const
1805 bool frc_vec_conv)
const
1813 bool frc_vec_conv)
const
1821 bool force_vector_conversion)
const
1825 return retval.
reshape (make_vector_dims (retval.
dims (),
1826 force_vector_conversion,
1830template <
typename T>
1845 bool force_vector_conversion)
const
1879 double ai = a.
elem (i);
1880 int v =
static_cast<int> (ai);
1882 retval.
xelem (i) = v;
1894 return retval.
reshape (make_vector_dims (retval.
dims (),
1895 force_vector_conversion,
1899template <
typename T>
1914 bool force_string_conv,
1915 bool force_vector_conversion)
const
1949 double ai = a.
elem (i);
1952 retval.
xelem (i) = v;
1955 error_with_cfn (
"conversion of %g to octave_idx_type value failed", ai);
1964 return retval.
reshape (make_vector_dims (retval.
dims (),
1965 force_vector_conversion,
1971 bool force_vector_conversion)
const
1975 return retval.
reshape (make_vector_dims (retval.
dims (),
1976 force_vector_conversion,
1982 bool frc_vec_conv)
const
1990 bool frc_vec_conv)
const
1999 bool frc_vec_conv)
const
2007 bool frc_vec_conv)
const
2015 bool force_vector_conversion)
const
2019 return retval.
reshape (make_vector_dims (retval.
dims (),
2020 force_vector_conversion,
2026 bool force_vector_conversion)
const
2030 return retval.
reshape (make_vector_dims (retval.
dims (),
2031 force_vector_conversion,
2039#define XVALUE_EXTRACTOR(TYPE, NAME, FCN) \
2041 octave_value::NAME (const char *fmt, ...) const \
2049 catch (octave::execution_exception& ee) \
2054 va_start (args, fmt); \
2055 verror (ee, fmt, args); \
2196#undef XVALUE_EXTRACTOR
2208 error (
"range with infinite number of elements cannot be stored");
2233 error (
"range with infinite number of elements cannot be stored");
2247 octave::mach_info::float_format flt_fmt)
const
2249 return m_rep->
write (os, block_size, output_type, skip, flt_fmt);
2255 os << prefix <<
"type_name: " <<
type_name () <<
"\n"
2256 << prefix <<
"m_count: " <<
get_count () <<
"\n"
2257 << prefix <<
"m_rep info: ";
2275 octave::mach_info::float_format fmt)
2305 if (class_id != mxUNKNOWN_CLASS)
2307 bool type_ok =
false;
2311 case mxDOUBLE_CLASS:
2315 case mxSINGLE_CLASS:
2339 case mxUINT16_CLASS:
2343 case mxUINT32_CLASS:
2347 case mxUINT64_CLASS:
2353 error (
"mex_get_data: unexpected type requested");
2357 error (
"mex_get_data: type mismatch");
2359 if (complexity == mxCOMPLEX && !
iscomplex ())
2360 error (
"mex_get_data: objectis not complex as requested");
2366OCTAVE_NORETURN
static void
2367err_unary_op_conversion_failed (
const std::string& op,
2368 const std::string& tn)
2370 error (
"operator %s: type conversion for '%s' failed",
2371 op.c_str (), tn.c_str ());
2374OCTAVE_NORETURN
static void
2375err_unary_op (
const std::string& on,
const std::string& tn)
2377 error (
"unary operator '%s' not implemented for '%s' operands",
2378 on.c_str (), tn.c_str ());
2392 error (
"in x%s or %sx, x must be defined first",
2393 op_str.c_str (), op_str.c_str ());
2400 octave::type_info& ti = octave::__get_type_info__ ();
2402 octave::type_info::non_const_unary_op_fcn
f
2403 = ti.lookup_non_const_unary_op (op, t);
2421 err_unary_op_conversion_failed
2429 f = ti.lookup_non_const_unary_op (op, t);
2435 if (old_rep && --old_rep->
m_count == 0)
2458 octave::type_info::non_const_unary_op_fcn
f =
nullptr;
2463 octave::type_info& ti = octave::__get_type_info__ ();
2465 f = ti.lookup_non_const_unary_op (op, t);
2471 *
this = octave::unary_op (op, *
this);
2479 const std::list<octave_value_list>& idx)
2489 assign_op assop = unary_op_to_assign_op (op);
2491 assign (assop, type, idx, 1.0);
2498octave_value::unary_op_to_assign_op (unary_op op)
2511 error (
"operator %s: no assign operator found", on.c_str ());
2517octave_value::op_eq_to_binary_op (assign_op op)
2560 error (
"operator %s: no binary operator found", on.c_str ());
2568 if (type.length () > 0)
2573 if (type.length () > 1 && type[1] ==
'.')
2585 error (
"unexpected: index not '(', '{', or '.' in octave_value::empty_conv - please report this bug");
2594OCTAVE_NORETURN
static void
2595err_binary_op (
const std::string& on,
const std::string& tn1,
2596 const std::string& tn2)
2598 error (
"binary operator '%s' not implemented for '%s' by '%s' operations",
2599 on.c_str (), tn1.c_str (), tn2.c_str ());
2602OCTAVE_NORETURN
static void
2603err_binary_op_conv (
const std::string& on)
2605 error (
"type conversion failed for binary operator '%s'", on.c_str ());
2628 retval =
f (v1,
v2);
2799 error (
"invalid compound operator");
2820 retval =
f (v1,
v2);
2822 retval = decompose_binary_op (ti, op, v1,
v2);
2831 retval = decompose_binary_op (ti, op, v1,
v2);
2846OCTAVE_NORETURN
static void
2847err_cat_op (
const std::string& tn1,
const std::string& tn2)
2849 error (
"concatenation operator not implemented for '%s' by '%s' operations",
2850 tn1.c_str (), tn2.c_str ());
2853OCTAVE_NORETURN
static void
2856 error (
"type conversion failed for concatenation operator");
2940 if (op1_type == op2_type)
2968template <
typename T>
2970check_colon_operand (
const octave_value& val,
const char *op_str)
2977 static constexpr double out_of_range_top
2978 =
static_cast<double> (std::numeric_limits<typename T::val_type>::max ()) + 1.0;
2980 if (dval >= out_of_range_top
2981 || dval < std::numeric_limits<typename T::val_type>::min ()
2982 || std::modf (dval, &intpart) != 0.0)
2983 error (
"colon operator %s invalid (not an integer or out of range for given integer type)", op_str);
2989template <
typename UT,
2990 typename std::enable_if<(std::is_integral<UT>::value
2991 && std::is_unsigned<UT>::value),
2994integer_difference (UT a, UT b)
2996 return a > b ? a - b : b - a;
3002template <
typename ST,
3003 typename UT =
typename std::make_unsigned<ST>::type,
3004 typename std::enable_if<(std::is_integral<ST>::value
3005 && std::is_signed<ST>::value),
3008integer_difference (ST a, ST b)
3013 static const UT offset = UT (0) -
static_cast<UT
> (std::numeric_limits<ST>::min ());
3015 UT au =
static_cast<UT
> (a) + offset;
3016 UT bu =
static_cast<UT
> (b) + offset;
3018 return integer_difference (au, bu);
3031template <
typename T,
3032 typename UT =
typename std::make_unsigned<T>::type,
3033 typename std::enable_if<std::is_integral<T>::value,
3036range_numel_aux (T base, UT unsigned_increment, T limit)
3041 UT nel_m1 = integer_difference (limit, base) / unsigned_increment;
3044 if (nel_m1 > std::numeric_limits<octave_idx_type>::max () - 1)
3045 error (
"too many elements for range!");
3052template <
typename ST,
3053 typename UT =
typename std::make_unsigned<ST>::type,
3054 typename std::enable_if<(std::is_integral<ST>::value
3055 && std::is_signed<ST>::value),
3058range_increment (ST increment)
3060 return (increment < 0
3061 ? UT (0) -
static_cast<UT
> (increment)
3062 : static_cast<UT> (increment));
3069template <
typename T,
3070 typename UT =
typename std::make_unsigned<T>::type,
3071 typename std::enable_if<(std::is_integral<UT>::value
3072 && std::is_unsigned<UT>::value),
3075range_increment (UT increment)
3082template <
typename T,
3083 typename UT =
typename std::make_unsigned<T>::type>
3084typename std::enable_if<(std::is_integral<UT>::value
3085 && std::is_unsigned<UT>::value), UT>::type
3086range_increment (
double increment)
3088 double abs_increment = std::abs (increment);
3090 return static_cast<UT
> (abs_increment);
3096template <
typename ST,
3097 typename std::enable_if<(std::is_integral<ST>::value
3098 && std::is_signed<ST>::value),
3101range_numel (ST base, ST increment, ST limit)
3103 typedef typename std::make_unsigned<ST>::type UT;
3106 || (increment > 0 && base > limit)
3107 || (increment < 0 && base < limit))
3110 UT unsigned_increment = range_increment<ST> (increment);
3112 return range_numel_aux (base, unsigned_increment, limit);
3118template <
typename UT,
3119 typename std::enable_if<(std::is_integral<UT>::value
3120 && std::is_unsigned<UT>::value),
3123range_numel (UT base, UT increment, UT limit)
3126 if (increment == 0 || base > limit)
3129 return range_numel_aux (base, increment, limit);
3135template <
typename T,
3136 typename UT =
typename std::make_unsigned<T>::type,
3137 typename std::enable_if<std::is_integral<T>::value,
3140range_numel (T base,
double increment, T limit)
3143 if (math::isnan (increment) || std::modf (increment, &intpart) != 0.0)
3144 error (
"colon operator increment invalid (not an integer)");
3147 || (increment > 0 && base > limit)
3148 || (increment < 0 && base < limit))
3151 static constexpr double out_of_range_top
3152 =
static_cast<double> (std::numeric_limits<UT>::max ()) + 1.0;
3154 double abs_increment = std::abs (increment);
3162 if (abs_increment >= out_of_range_top)
3165 UT unsigned_increment = range_increment<T> (increment);
3167 return range_numel_aux (base, unsigned_increment, limit);
3172template <
typename T,
3174 typename std::enable_if<(std::is_integral<T>::value
3175 && std::is_arithmetic<IT>::value),
3178make_int_range (T base,
IT increment, T limit)
3189 typedef typename std::make_unsigned<T>::type UT;
3191 UT unsigned_increment = range_increment<T> (increment);
3194 result.xelem (0) = val;
3200 val += unsigned_increment;
3201 result.xelem (i) = val;
3208 val -= unsigned_increment;
3209 result.xelem (i) = val;
3233template <
typename T,
3234 typename std::enable_if<std::is_same<T, double>::value,
3237make_float_range (T base, T increment, T limit,
bool is_for_cmd_expr)
3239 if (math::isnan (base)
3240 || math::isnan (increment)
3241 || math::isnan (limit))
3245 || (increment > 0 && base > limit)
3246 || (increment < 0 && base < limit))
3252 range<T> r (base, increment, limit);
3254 if (! is_for_cmd_expr && ! r.is_storable ())
3255 error (
"range with infinite number of elements cannot be stored");
3260template <
typename T,
3261 typename std::enable_if<std::is_same<T, float>::value,
3264make_float_range (T base, T increment, T limit,
bool is_for_cmd_expr)
3266 if (math::isnan (base)
3267 || math::isnan (increment)
3268 || math::isnan (limit))
3272 || (increment > 0 && base > limit)
3273 || (increment < 0 && base < limit))
3279 range<T> r (base, increment, limit);
3281 if (! is_for_cmd_expr && ! r.is_storable ())
3282 error (
"range with infinite number of elements cannot be stored");
3287template <
typename T,
3288 typename std::enable_if<(std::is_same<T, octave_int8>::value
3289 || std::is_same<T, octave_uint8>::value
3290 || std::is_same<T, octave_int16>::value
3291 || std::is_same<T, octave_uint16>::value
3292 || std::is_same<T, octave_int32>::value
3293 || std::is_same<T, octave_uint32>::value
3294 || std::is_same<T, octave_int64>::value
3295 || std::is_same<T, octave_uint64>::value),
3304 check_colon_operand<T> (base,
"lower bound");
3305 check_colon_operand<T> (limit,
"upper bound");
3307 typename T::val_type base_val = octave_value_extract<T> (base).value ();
3308 typename T::val_type limit_val = octave_value_extract<T> (limit).value ();
3314 return make_int_range (base_val, increment_val, limit_val);
3317 check_colon_operand<T> (increment,
"increment");
3319 typename T::val_type increment_val
3320 = octave_value_extract<T> (increment).value ();
3322 return make_int_range (base_val, increment_val, limit_val);
3325template <
typename T,
3326 typename std::enable_if<std::is_floating_point<T>::value,
3335 T base_val = octave_value_extract<T> (base);
3336 T increment_val = octave_value_extract<T> (increment);
3337 T limit_val = octave_value_extract<T> (limit);
3339 return make_float_range (base_val, increment_val, limit_val,
3353 char type = dq_str ?
'"' :
'\'';
3363 range<double> tmp (mtx_base(0), mtx_increment(0), mtx_limit(0));
3382 tmp1(1) = increment_arg;
3408 if (base.
numel () > 1 || limit.
numel () > 1 || increment.
numel () > 1)
3410 "colon arguments should be scalars");
3414 "imaginary part of complex colon arguments is ignored");
3418 builtin_type_t type_id = get_colon_op_type (base, increment, limit);
3430 return make_float_range<double> (base, increment, limit, is_for_cmd_expr);
3434 return make_float_range<float> (base, increment, limit, is_for_cmd_expr);
3437 return make_int_range<octave_int8> (base, increment, limit);
3440 return make_int_range<octave_int16> (base, increment, limit);
3443 return make_int_range<octave_int32> (base, increment, limit);
3446 return make_int_range<octave_int64> (base, increment, limit);
3449 return make_int_range<octave_uint8> (base, increment, limit);
3452 return make_int_range<octave_uint16> (base, increment, limit);
3455 return make_int_range<octave_uint32> (base, increment, limit);
3458 return make_int_range<octave_uint64> (base, increment, limit);
3461 return make_char_range (base, increment, limit);
3464 error (
"incompatible types found in range expression");
3467 error (
"invalid types found in range expression");
3473OCTAVE_NORETURN
static void
3474err_unary_op_conv (
const std::string& on)
3476 error (
"type conversion failed for unary operator '%s'", on.c_str ());
3537OCTAVE_END_NAMESPACE(octave)
3563 octave_int8_scalar::register_type (ti);
3564 octave_int16_scalar::register_type (ti);
3565 octave_int32_scalar::register_type (ti);
3566 octave_int64_scalar::register_type (ti);
3567 octave_uint8_scalar::register_type (ti);
3568 octave_uint16_scalar::register_type (ti);
3569 octave_uint32_scalar::register_type (ti);
3571 octave_int8_matrix::register_type (ti);
3572 octave_int16_matrix::register_type (ti);
3573 octave_int32_matrix::register_type (ti);
3574 octave_int64_matrix::register_type (ti);
3575 octave_uint8_matrix::register_type (ti);
3576 octave_uint16_matrix::register_type (ti);
3577 octave_uint32_matrix::register_type (ti);
3611DEFUN (
sizeof, args, ,
3618 if (args.length () != 1)
3621 return ovl (args(0).byte_size ());
3631decode_subscripts (
const char *name,
const octave_value& arg,
3632 std::string& type_string,
3633 std::list<octave_value_list>& idx)
3635 const octave_map m = arg.
xmap_value (
"%s: second argument must be a structure with fields 'type' and 'subs'", name);
3638 error (
"%s: second argument must be a structure with fields 'type' and 'subs'",
3643 type_string = std::string (nel,
'\0');
3644 idx = std::list<octave_value_list> ();
3652 for (
int k = 0; k < nel; k++)
3654 std::string item = type(k).xstring_value (
"%s: type(%d) must be a string", name, k+1);
3657 type_string[k] =
'{';
3658 else if (item ==
"()")
3659 type_string[k] =
'(';
3660 else if (item ==
".")
3661 type_string[k] =
'.';
3663 error (
"%s: invalid indexing type '%s'", name, item.c_str ());
3667 if (subs(k).is_string ())
3668 idx_item(0) = subs(k);
3669 else if (subs(k).iscell ())
3671 Cell subs_cell = subs(k).cell_value ();
3673 for (
int n = 0; n < subs_cell.
numel (); n++)
3675 if (subs_cell(n).is_string ()
3676 && subs_cell(n).string_value () ==
":")
3679 idx_item(n) = subs_cell(n);
3683 error (
"%s: subs(%d) must be a string or cell array", name, k+1);
3685 idx.push_back (idx_item);
3689DEFUN (subsref, args, nargout,
3728 if (args.length () != 2)
3732 std::list<octave_value_list> idx;
3734 decode_subscripts (
"subsref", args(1), type, idx);
3741 return arg0.
subsref (type, idx, nargout);
3744DEFUN (subsasgn, args, ,
3780 if (args.length () != 3)
3784 std::list<octave_value_list> idx;
3786 decode_subscripts (
"subsasgn", args(1), type, idx);
3791 return ovl (args(2).storable_value ());
3886DEFUN (is_sq_string, args, ,
3893 if (args.length () != 1)
3896 return ovl (args(0).is_sq_string ());
3909DEFUN (is_dq_string, args, ,
3916 if (args.length () != 1)
3919 return ovl (args(0).is_dq_string ());
3932DEFUN (optimize_permutation_matrix, args, nargout,
3950 "optimize_permutation_matrix");
3963DEFUN (optimize_diagonal_matrix, args, nargout,
3981 "optimize_diagonal_matrix");
4008DEFUN (optimize_range, args, nargout,
4042OCTAVE_END_NAMESPACE(octave)
N Dimensional Array with copy-on-write semantics.
const dim_vector & dims() const
Return a const-reference so that dims ()(i) works efficiently.
T & xelem(octave_idx_type n)
Size of the specified dimension.
T & elem(octave_idx_type n)
Size of the specified dimension.
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
Array< T, Alloc > reshape(octave_idx_type nr, octave_idx_type nc) const
Size of the specified dimension.
octave_idx_type numel() const
Number of elements in the array.
Vector representing the dimensions (size) of an Array.
std::string str(char sep='x') const
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
void resize(int n, int fill_value=0)
static dim_vector alloc(int n)
octave_idx_type ndims() const
Number of dimensions.
octave_value_list feval(const char *name, const octave_value_list &args=octave_value_list(), int nargout=0)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
symbol_table & get_symbol_table()
virtual bool load_hdf5(octave_hdf5_id loc_id, const char *name)
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
virtual octave_base_value * clone() const
virtual octave_user_script * user_script_value(bool silent=false)
virtual octave_value_list simple_subsref(char type, octave_value_list &idx, int nargout)
virtual octave_fcn_handle * fcn_handle_value(bool silent=false)
virtual octave_classdef * classdef_object_value(bool silent=false)
virtual float_display_format get_edit_display_format() const
octave_base_value *(* type_conv_fcn)(const octave_base_value &)
virtual octave_base_value * try_narrowing_conversion()
static void register_type()
octave::refcount< octave_idx_type > m_count
virtual type_conv_info numeric_conversion_function() const
virtual int type_id() const
virtual octave_value_list list_value() const
virtual const void * mex_get_data() const
virtual bool load_ascii(std::istream &is)
virtual bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
virtual octave_user_function * user_function_value(bool silent=false)
virtual void print_info(std::ostream &os, const std::string &prefix) const
virtual int write(octave::stream &os, int block_size, oct_data_conv::data_type output_type, int skip, octave::mach_info::float_format flt_fmt) const
virtual bool is_storable() const
virtual octave_map map_value() const
virtual octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
virtual octave_user_code * user_code_value(bool silent=false)
virtual octave_scalar_map scalar_map_value() const
virtual double double_value(bool=false) const
virtual octave_value undef_subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
virtual void break_closure_cycles(const std::shared_ptr< octave::stack_frame > &)
virtual std::string type_name() const
virtual std::string class_name() const
virtual octave_base_value * empty_clone() const
virtual octave_function * function_value(bool silent=false)
virtual Cell cell_value() const
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static int static_type_id()
static int static_type_id()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
octave_value make_weak_anonymous_handle() const
bool is_anonymous() const
octave_value make_weak_nested_handle() const
static void register_type()
bool is_weak_anonymous() const
bool is_weak_nested() const
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
octave_idx_type nfields() const
const Cell & contents(const_iterator p) const
octave_idx_type numel() const
bool contains(const std::string &name) const
static void register_type()
static void register_type()
static const octave_value instance
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
static void register_type()
bool is_function_handle() const
octave_value_list list_value() const
octave_value & operator=(const octave_value &a)
bool is_magic_int() const
const octave_base_value & get_rep() const
static std::string unary_op_fcn_name(unary_op)
bool is_undefined() const
bool is_uint32_type() const
ComplexRowVector complex_row_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
std::string class_name() const
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
octave_function * function_value(bool silent=false) const
int32NDArray int32_array_value() const
uint16NDArray uint16_array_value() const
static std::string binary_op_as_string(binary_op)
octave_map xmap_value(const char *fmt,...) const
octave_classdef * classdef_object_value(bool silent=false) const
int16NDArray int16_array_value() const
int int_value(bool req_int=false, bool frc_str_conv=false) const
bool is_dq_string() const
int8NDArray int8_array_value() const
std::string get_dims_str() const
octave_idx_type rows() const
int64_t int64_value(bool req_int=false, bool frc_str_conv=false) const
Array< float > float_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
octave_scalar_map scalar_map_value() const
octave_idx_type strict_idx_type_value(bool frc_str_conv=false) const
bool is_int8_type() const
octave_value_list simple_subsref(char type, octave_value_list &idx, int nargout)
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
octave_user_script * user_script_value(bool silent=false) const
static std::string assign_op_as_string(assign_op)
octave_value undef_subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
octave_idx_type idx_type_value(bool req_int=false, bool frc_str_conv=false) const
octave_idx_type end_index(octave_idx_type index_position, octave_idx_type num_indices) const
static octave_value empty_conv(const std::string &type, const octave_value &rhs=octave_value())
static assign_op binary_op_to_assign_op(binary_op)
FloatComplexRowVector float_complex_row_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
ComplexNDArray complex_array_value(bool frc_str_conv=false) const
octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, std::size_t skip=1)
Array< FloatComplex > float_complex_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
FloatRowVector float_row_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
bool is_single_type() const
void make_storable_value()
FloatColumnVector float_column_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
bool is_legacy_object() const
void break_closure_cycles(const std::shared_ptr< octave::stack_frame > &)
bool is_equal(const octave_value &) const
octave_value storable_value() const
bool is_uint8_type() const
bool is_uint64_type() const
float_display_format get_edit_display_format() const
octave_base_value::type_conv_info numeric_demotion_function() const
bool is_zero_by_zero() const
bool is_uint16_type() const
uint64NDArray uint64_array_value() const
octave_value & non_const_unary_op(unary_op op)
static std::string unary_op_as_string(unary_op)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
const void * mex_get_data(mxClassID class_id=mxUNKNOWN_CLASS, mxComplexity complexity=mxREAL) const
bool is_int16_type() const
octave_value reshape(const dim_vector &dv) const
FloatComplexColumnVector float_complex_column_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
octave_base_value::type_conv_info numeric_conversion_function() const
octave_idx_type numel() const
bool load_ascii(std::istream &is)
octave_map map_value() const
Array< int > int_vector_value(bool req_int=false, bool frc_str_conv=false, bool frc_vec_conv=false) const
Array< Complex > complex_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
octave_value & assign(assign_op op, const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
bool is_int64_type() const
void print_info(std::ostream &os, const std::string &prefix="") const
octave_base_value * clone() const
octave_value single_subsref(const std::string &type, const octave_value_list &idx)
octave_fcn_handle * fcn_handle_value(bool silent=false) const
ComplexColumnVector complex_column_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
int64NDArray int64_array_value() const
octave_idx_type get_count() const
NDArray array_value(bool frc_str_conv=false) const
Array< double > vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
static binary_op assign_op_to_binary_op(assign_op)
int write(octave::stream &os, int block_size, oct_data_conv::data_type output_type, int skip, octave::mach_info::float_format flt_fmt) const
static std::string binary_op_fcn_name(binary_op)
octave_idx_type length() const
bool is_double_type() const
bool is_int32_type() const
Array< octave_idx_type > octave_idx_type_vector_value(bool req_int=false, bool frc_str_conv=false, bool frc_vec_conv=false) const
octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
uint8NDArray uint8_array_value() const
octave_user_function * user_function_value(bool silent=false) const
std::string type_name() const
octave_value all(int dim=0) const
octave_base_value * m_rep
The real representation.
FloatComplexNDArray float_complex_array_value(bool frc_str_conv=false) const
ColumnVector column_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
static octave_base_value * nil_rep()
FloatNDArray float_array_value(bool frc_str_conv=false) const
octave_user_code * user_code_value(bool silent=false) const
uint32NDArray uint32_array_value() const
RowVector row_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
octave_idx_type columns() const
Matrix matrix_value(bool frc_str_conv=false) const
builtin_type_t builtin_type() const
octave_base_value * empty_clone() const
double double_value(bool frc_str_conv=false) const
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
static void register_type()
octave_value find_function(const std::string &name, const symbol_scope &search_scope=symbol_scope::invalid())
octave_value(* unary_op_fcn)(const octave_base_value &)
octave_value(* binary_op_fcn)(const octave_base_value &, const octave_base_value &)
octave_value(* binary_class_op_fcn)(const octave_value &, const octave_value &)
binary_class_op_fcn lookup_binary_class_op(octave_value::binary_op)
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 &)
unary_class_op_fcn lookup_unary_class_op(octave_value::unary_op)
cat_op_fcn lookup_cat_op(int, int)
binary_op_fcn lookup_binary_op(octave_value::binary_op, int, int)
unary_op_fcn lookup_unary_op(octave_value::unary_op, int)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void warning_with_id(const char *id, const char *fmt,...)
void error_with_cfn(const char *fmt,...)
void error(const char *fmt,...)
void warn_implicit_conversion(const char *id, const char *from, const char *to)
type_info & __get_type_info__()
interpreter & __get_interpreter__()
F77_RET_T const F77_INT F77_CMPLX * A
std::complex< double > Complex
std::complex< float > FloatComplex
const octave_base_value const Array< octave_idx_type > & ra_idx
const octave_char_matrix & v2
octave_double_range octave_range
#define XVALUE_EXTRACTOR(TYPE, NAME, FCN)
octave_value colon_op(const octave_value &base, const octave_value &increment, const octave_value &limit, bool is_for_cmd_expr=false)
void install_types(octave::type_info &)
octave_value cat_op(type_info &ti, const octave_value &a, const octave_value &b, const Array< octave_idx_type > &ra_idx)
octave_value binary_op(type_info &ti, octave_value::binary_op op, const octave_value &a, const octave_value &b)
octave_value unary_op(type_info &ti, octave_value::unary_op op, const octave_value &a)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
F77_RET_T const F77_DBLE const F77_DBLE * f
octave_value set_internal_variable(bool &var, const octave_value_list &args, int nargout, const char *nm)