26 #if defined (HAVE_CONFIG_H)
32 #include <type_traits>
106 static bool Voptimize_diagonal_matrix =
true;
110 static bool Voptimize_permutation_matrix =
true;
114 static bool Voptimize_range =
true;
507 #if defined (OCTAVE_HAVE_LONG_LONG_INT)
513 #if defined (OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT)
580 : m_rep (Voptimize_diagonal_matrix
588 : m_rep (Voptimize_diagonal_matrix
596 : m_rep (Voptimize_diagonal_matrix
604 : m_rep (Voptimize_diagonal_matrix
612 : m_rep (Voptimize_diagonal_matrix
620 : m_rep (Voptimize_diagonal_matrix
700 : m_rep (Voptimize_diagonal_matrix
708 : m_rep (Voptimize_diagonal_matrix
740 : m_rep (Voptimize_permutation_matrix
862 : m_rep (new octave_int8_scalar (i))
868 : m_rep (new octave_uint8_scalar (i))
874 : m_rep (new octave_int16_scalar (i))
880 : m_rep (new octave_uint16_scalar (i))
886 : m_rep (new octave_int32_scalar (i))
892 : m_rep (new octave_uint32_scalar (i))
898 : m_rep (new octave_int64_scalar (i))
910 : m_rep (new octave_int8_matrix (inda))
916 : m_rep (new octave_int8_matrix (inda))
922 : m_rep (new octave_uint8_matrix (inda))
928 : m_rep (new octave_uint8_matrix (inda))
934 : m_rep (new octave_int16_matrix (inda))
940 : m_rep (new octave_int16_matrix (inda))
946 : m_rep (new octave_uint16_matrix (inda))
952 : m_rep (new octave_uint16_matrix (inda))
958 : m_rep (new octave_int32_matrix (inda))
964 : m_rep (new octave_int32_matrix (inda))
970 : m_rep (new octave_uint32_matrix (inda))
976 : m_rep (new octave_uint32_matrix (inda))
982 : m_rep (new octave_int64_matrix (inda))
988 : m_rep (new octave_int64_matrix (inda))
1016 octave::range<double>
range;
1019 octave::idx_vector::idx_class_type idx_class;
1024 switch (idx.idx_class ())
1026 case octave::idx_vector::class_range:
1027 case octave::idx_vector::class_vector:
1037 idx.unconvert (idx_class, scalar,
range, array, mask);
1041 case octave::idx_vector::class_colon:
1045 case octave::idx_vector::class_range:
1049 case octave::idx_vector::class_scalar:
1053 case octave::idx_vector::class_vector:
1057 case octave::idx_vector::class_mask:
1077 : m_rep (force_range || Voptimize_range
1101 const std::list<std::string>& plist)
1108 const std::list<std::string>& plist)
1158 if (tmp && tmp !=
m_rep)
1169 DEFUN (
double, args, ,
1176 if (args.length () != 1)
1179 return ovl (args(0).as_double ());
1213 DEFUN (single, args, ,
1220 if (args.length () != 1)
1223 return args(0).as_single ();
1254 DEFUN (int8, args, ,
1261 if (args.length () != 1)
1264 return args(0).as_int8 ();
1276 DEFUN (int16, args, ,
1283 if (args.length () != 1)
1286 return args(0).as_int16 ();
1298 DEFUN (int32, args, ,
1305 if (args.length () != 1)
1308 return args(0).as_int32 ();
1320 DEFUN (int64, args, ,
1327 if (args.length () != 1)
1330 return args(0).as_int64 ();
1342 DEFUN (uint8, args, ,
1349 if (args.length () != 1)
1352 return args(0).as_uint8 ();
1364 DEFUN (uint16, args, ,
1371 if (args.length () != 1)
1374 return args(0).as_uint16 ();
1386 DEFUN (uint32, args, ,
1393 if (args.length () != 1)
1396 return args(0).as_uint32 ();
1408 DEFUN (uint64, args, ,
1415 if (args.length () != 1)
1418 return args(0).as_uint64 ();
1430 OCTAVE_END_NAMESPACE(
octave)
1436 std::list<octave_value_list> i;
1452 const std::list<octave_value_list>& idx,
int nargout)
1459 const std::list<octave_value_list>& idx,
1462 if (idx.size () > skip)
1464 std::list<octave_value_list> new_idx (idx);
1465 for (std::size_t i = 0; i < skip; i++)
1466 new_idx.erase (new_idx.begin ());
1467 return subsref (type.substr (skip), new_idx);
1475 const std::list<octave_value_list>& idx,
1478 if (idx.size () > skip)
1480 std::list<octave_value_list> new_idx (idx);
1481 for (std::size_t i = 0; i < skip; i++)
1482 new_idx.erase (new_idx.begin ());
1483 return subsref (type.substr (skip), new_idx, nargout);
1491 const std::list<octave_value_list>& idx,
1494 if (idx.size () > skip)
1496 std::list<octave_value_list> new_idx (idx);
1497 for (std::size_t i = 0; i < skip; i++)
1498 new_idx.erase (new_idx.begin ());
1499 return subsref (type.substr (skip), new_idx, auto_add);
1512 if (num_indices <
ndims)
1514 for (
int i = num_indices; i <
ndims; i++)
1515 dv(num_indices-1) *= dv(i);
1517 if (num_indices == 1)
1525 ndims = num_indices;
1530 return (index_position <
ndims ? dv(index_position) : 1);
1535 const std::list<octave_value_list>& idx,
1543 const std::list<octave_value_list>& idx,
1551 const std::list<octave_value_list>& idx,
1561 error (
"in computed assignment A(index) OP= X, A must be defined first");
1565 binary_op binop = op_eq_to_binary_op (op);
1570 *
this =
subsasgn (type, idx, t_rhs);
1593 f = ti.lookup_assign_op (op, tthis, trhs);
1605 binary_op binop = op_eq_to_binary_op (op);
1613 error (
"in computed assignment A OP= X, A must be defined first");
1645 for (
int i = 0; i < dv.
ndims (); i++)
1663 bool retval =
false;
1695 #if defined (OCTAVE_ENABLE_64)
1698 return int_value (req_int, frc_str_conv);
1763 make_vector_dims (
const dim_vector& dv,
bool force_vector_conversion,
1764 const std::string& my_type,
const std::string& wanted_type)
1767 retval.chop_trailing_singletons ();
1770 if (retval.ndims () > 2 || (retval(0) != 1 && retval(1) != 1))
1772 if (! force_vector_conversion)
1774 my_type.c_str (), wanted_type.c_str ());
1783 bool frc_vec_conv)
const
1791 bool frc_vec_conv)
const
1799 bool frc_vec_conv)
const
1807 bool frc_vec_conv)
const
1815 bool force_vector_conversion)
const
1819 return retval.
reshape (make_vector_dims (retval.
dims (),
1820 force_vector_conversion,
1824 template <
typename T>
1839 bool force_vector_conversion)
const
1873 double ai = a.
elem (i);
1874 int v =
static_cast<int> (ai);
1876 retval.
xelem (i) = v;
1888 return retval.
reshape (make_vector_dims (retval.
dims (),
1889 force_vector_conversion,
1893 template <
typename T>
1908 bool force_string_conv,
1909 bool force_vector_conversion)
const
1943 double ai = a.
elem (i);
1946 retval.
xelem (i) = v;
1949 error_with_cfn (
"conversion of %g to octave_idx_type value failed", ai);
1958 return retval.
reshape (make_vector_dims (retval.
dims (),
1959 force_vector_conversion,
1965 bool force_vector_conversion)
const
1969 return retval.
reshape (make_vector_dims (retval.
dims (),
1970 force_vector_conversion,
1976 bool frc_vec_conv)
const
1984 bool frc_vec_conv)
const
1993 bool frc_vec_conv)
const
2001 bool frc_vec_conv)
const
2009 bool force_vector_conversion)
const
2013 return retval.
reshape (make_vector_dims (retval.
dims (),
2014 force_vector_conversion,
2020 bool force_vector_conversion)
const
2024 return retval.
reshape (make_vector_dims (retval.
dims (),
2025 force_vector_conversion,
2033 #define XVALUE_EXTRACTOR(TYPE, NAME, FCN) \
2035 octave_value::NAME (const char *fmt, ...) const \
2043 catch (octave::execution_exception& ee) \
2048 va_start (args, fmt); \
2049 verror (ee, fmt, args); \
2180 #undef XVALUE_EXTRACTOR
2191 error (
"range with infinite number of elements cannot be stored");
2216 error (
"range with infinite number of elements cannot be stored");
2232 return m_rep->
write (os, block_size, output_type, skip, flt_fmt);
2238 os << prefix <<
"type_name: " <<
type_name () <<
"\n"
2239 << prefix <<
"m_count: " <<
get_count () <<
"\n"
2240 << prefix <<
"m_rep info: ";
2290 bool type_ok =
false;
2336 error (
"mex_get_data: unexpected type requested");
2340 error (
"mex_get_data: type mismatch");
2343 error (
"mex_get_data: objectis not complex as requested");
2349 OCTAVE_NORETURN
static void
2350 err_unary_op_conversion_failed (
const std::string& op,
2351 const std::string& tn)
2353 error (
"operator %s: type conversion for '%s' failed",
2354 op.c_str (), tn.c_str ());
2357 OCTAVE_NORETURN
static void
2358 err_unary_op (
const std::string& on,
const std::string& tn)
2360 error (
"unary operator '%s' not implemented for '%s' operands",
2361 on.c_str (), tn.c_str ());
2375 error (
"in x%s or %sx, x must be defined first",
2376 op_str.c_str (), op_str.c_str ());
2386 = ti.lookup_non_const_unary_op (op, t);
2404 err_unary_op_conversion_failed
2412 f = ti.lookup_non_const_unary_op (op, t);
2418 if (old_rep && --old_rep->
m_count == 0)
2448 f = ti.lookup_non_const_unary_op (op, t);
2462 const std::list<octave_value_list>& idx)
2472 assign_op assop = unary_op_to_assign_op (op);
2474 assign (assop, type, idx, 1.0);
2481 octave_value::unary_op_to_assign_op (
unary_op op)
2494 error (
"operator %s: no assign operator found", on.c_str ());
2500 octave_value::op_eq_to_binary_op (assign_op op)
2543 error (
"operator %s: no binary operator found", on.c_str ());
2551 if (type.length () > 0)
2556 if (type.length () > 1 && type[1] ==
'.')
2577 OCTAVE_NORETURN
static void
2578 err_binary_op (
const std::string& on,
const std::string& tn1,
2579 const std::string& tn2)
2581 error (
"binary operator '%s' not implemented for '%s' by '%s' operations",
2582 on.c_str (), tn1.c_str (), tn2.c_str ());
2585 OCTAVE_NORETURN
static void
2586 err_binary_op_conv (
const std::string& on)
2588 error (
"type conversion failed for binary operator '%s'", on.c_str ());
2611 retval =
f (v1,
v2);
2782 error (
"invalid compound operator");
2803 retval =
f (v1,
v2);
2805 retval = decompose_binary_op (ti, op, v1,
v2);
2814 retval = decompose_binary_op (ti, op, v1,
v2);
2829 OCTAVE_NORETURN
static void
2830 err_cat_op (
const std::string& tn1,
const std::string& tn2)
2832 error (
"concatenation operator not implemented for '%s' by '%s' operations",
2833 tn1.c_str (), tn2.c_str ());
2836 OCTAVE_NORETURN
static void
2839 error (
"type conversion failed for concatenation operator");
2923 if (op1_type == op2_type)
2951 template <
typename T>
2953 check_colon_operand (
const octave_value& val,
const char *op_str)
2960 static const double out_of_range_top
2964 if (dval >= out_of_range_top
2966 || std::modf (dval, &intpart) != 0.0)
2967 error (
"colon operator %s invalid (not an integer or out of range for given integer type)", op_str);
2973 template <
typename UT,
2974 typename std::enable_if<(std::is_integral<UT>::value
2975 && std::is_unsigned<UT>::value),
2978 integer_difference (UT a, UT b)
2980 return a > b ? a - b : b - a;
2986 template <
typename ST,
2987 typename UT =
typename std::make_unsigned<ST>::type,
2988 typename std::enable_if<(std::is_integral<ST>::value
2989 && std::is_signed<ST>::value),
2992 integer_difference (ST a, ST b)
2997 static const UT offset
3000 UT au =
static_cast<UT
> (a) + offset;
3001 UT bu =
static_cast<UT
> (b) + offset;
3003 return integer_difference (au, bu);
3016 template <
typename T,
3017 typename UT =
typename std::make_unsigned<T>::type,
3018 typename std::enable_if<std::is_integral<T>::value,
3021 range_numel_aux (T base, UT unsigned_increment, T limit)
3026 UT nel_m1 = integer_difference (limit, base) / unsigned_increment;
3030 error (
"too many elements for range!");
3037 template <
typename ST,
3038 typename UT =
typename std::make_unsigned<ST>::type,
3039 typename std::enable_if<(std::is_integral<ST>::value
3040 && std::is_signed<ST>::value),
3043 range_increment (ST increment)
3045 return (increment < 0
3046 ? UT (0) -
static_cast<UT
> (increment)
3047 :
static_cast<UT
> (increment));
3054 template <
typename T,
3055 typename UT =
typename std::make_unsigned<T>::type,
3056 typename std::enable_if<(std::is_integral<UT>::value
3057 && std::is_unsigned<UT>::value),
3060 range_increment (UT increment)
3067 template <
typename T,
3068 typename UT =
typename std::make_unsigned<T>::type>
3069 typename std::enable_if<(std::is_integral<UT>::value
3070 && std::is_unsigned<UT>::value), UT>::type
3071 range_increment (
double increment)
3073 double abs_increment = std::abs (increment);
3075 return static_cast<UT
> (abs_increment);
3081 template <
typename ST,
3082 typename std::enable_if<(std::is_integral<ST>::value
3083 && std::is_signed<ST>::value),
3086 range_numel (ST base, ST increment, ST limit)
3088 typedef typename std::make_unsigned<ST>::type UT;
3091 || (increment > 0 && base > limit)
3092 || (increment < 0 && base < limit))
3095 UT unsigned_increment = range_increment<ST> (increment);
3097 return range_numel_aux (base, unsigned_increment, limit);
3103 template <
typename UT,
3104 typename std::enable_if<(std::is_integral<UT>::value
3105 && std::is_unsigned<UT>::value),
3108 range_numel (UT base, UT increment, UT limit)
3111 if (increment == 0 || base > limit)
3114 return range_numel_aux (base, increment, limit);
3120 template <
typename T,
3121 typename UT =
typename std::make_unsigned<T>::type,
3122 typename std::enable_if<std::is_integral<T>::value,
3125 range_numel (T base,
double increment, T limit)
3128 if (
math::isnan (increment) || std::modf (increment, &intpart) != 0.0)
3129 error (
"colon operator increment invalid (not an integer)");
3132 || (increment > 0 && base > limit)
3133 || (increment < 0 && base < limit))
3136 static const double out_of_range_top
3139 double abs_increment = std::abs (increment);
3147 if (abs_increment >= out_of_range_top)
3150 UT unsigned_increment = range_increment<T> (increment);
3152 return range_numel_aux (base, unsigned_increment, limit);
3157 template <
typename T,
3159 typename std::enable_if<(std::is_integral<T>::value
3160 && std::is_arithmetic<IT>::value),
3163 make_int_range (T base,
IT increment, T limit)
3174 typedef typename std::make_unsigned<T>::type UT;
3176 UT unsigned_increment = range_increment<T> (increment);
3179 result.xelem (0) = val;
3185 val += unsigned_increment;
3186 result.xelem (i) = val;
3193 val -= unsigned_increment;
3194 result.xelem (i) = val;
3218 template <
typename T,
3219 typename std::enable_if<std::is_same<T, double>::value,
3222 make_float_range (T base, T increment, T limit,
bool is_for_cmd_expr)
3230 || (increment > 0 && base > limit)
3231 || (increment < 0 && base < limit))
3239 if (! is_for_cmd_expr && !
r.is_storable ())
3240 error (
"range with infinite number of elements cannot be stored");
3245 template <
typename T,
3246 typename std::enable_if<std::is_same<T, float>::value,
3249 make_float_range (T base, T increment, T limit,
bool is_for_cmd_expr)
3257 || (increment > 0 && base > limit)
3258 || (increment < 0 && base < limit))
3266 if (! is_for_cmd_expr && !
r.is_storable ())
3267 error (
"range with infinite number of elements cannot be stored");
3272 template <
typename T,
3273 typename std::enable_if<(std::is_same<T, octave_int8>::value
3274 || std::is_same<T, octave_uint8>::value
3275 || std::is_same<T, octave_int16>::value
3276 || std::is_same<T, octave_uint16>::value
3277 || std::is_same<T, octave_int32>::value
3278 || std::is_same<T, octave_uint32>::value
3279 || std::is_same<T, octave_int64>::value
3280 || std::is_same<T, octave_uint64>::value),
3289 check_colon_operand<T> (base,
"lower bound");
3290 check_colon_operand<T> (limit,
"upper bound");
3292 typename T::val_type base_val = octave_value_extract<T> (base).value ();
3293 typename T::val_type limit_val = octave_value_extract<T> (limit).value ();
3299 return make_int_range (base_val, increment_val, limit_val);
3302 check_colon_operand<T> (increment,
"increment");
3304 typename T::val_type increment_val
3305 = octave_value_extract<T> (increment).value ();
3307 return make_int_range (base_val, increment_val, limit_val);
3310 template <
typename T,
3311 typename std::enable_if<std::is_floating_point<T>::value,
3320 T base_val = octave_value_extract<T> (base);
3321 T increment_val = octave_value_extract<T> (increment);
3322 T limit_val = octave_value_extract<T> (limit);
3324 return make_float_range (base_val, increment_val, limit_val,
3338 char type = dq_str ?
'"' :
'\'';
3348 range<double> tmp (mtx_base(0), mtx_increment(0), mtx_limit(0));
3367 tmp1(1) = increment_arg;
3393 if (base.
numel () > 1 || limit.
numel () > 1 || increment.
numel () > 1)
3395 "colon arguments should be scalars");
3399 "imaginary part of complex colon arguments is ignored");
3403 builtin_type_t type_id = get_colon_op_type (base, increment, limit);
3415 return make_float_range<double> (base, increment, limit, is_for_cmd_expr);
3419 return make_float_range<float> (base, increment, limit, is_for_cmd_expr);
3422 return make_int_range<octave_int8> (base, increment, limit);
3425 return make_int_range<octave_int16> (base, increment, limit);
3428 return make_int_range<octave_int32> (base, increment, limit);
3431 return make_int_range<octave_int64> (base, increment, limit);
3434 return make_int_range<octave_uint8> (base, increment, limit);
3437 return make_int_range<octave_uint16> (base, increment, limit);
3440 return make_int_range<octave_uint32> (base, increment, limit);
3443 return make_int_range<octave_uint64> (base, increment, limit);
3446 return make_char_range (base, increment, limit);
3449 error (
"incompatible types found in range expression");
3452 error (
"invalid types found in range expression");
3458 OCTAVE_NORETURN
static void
3459 err_unary_op_conv (
const std::string& on)
3461 error (
"type conversion failed for unary operator '%s'", on.c_str ());
3522 OCTAVE_END_NAMESPACE(
octave)
3596 DEFUN (
sizeof, args, ,
3603 if (args.length () != 1)
3606 return ovl (args(0).byte_size ());
3616 decode_subscripts (
const char *name,
const octave_value& arg,
3617 std::string& type_string,
3618 std::list<octave_value_list>& idx)
3620 const octave_map m = arg.
xmap_value (
"%s: second argument must be a structure with fields 'type' and 'subs'", name);
3622 if (
m.nfields () != 2 || !
m.contains (
"type") || !
m.contains (
"subs"))
3623 error (
"%s: second argument must be a structure with fields 'type' and 'subs'",
3628 type_string = std::string (nel,
'\0');
3629 idx = std::list<octave_value_list> ();
3634 const Cell type =
m.contents (
"type");
3635 const Cell subs =
m.contents (
"subs");
3637 for (
int k = 0; k < nel; k++)
3639 std::string item = type(k).xstring_value (
"%s: type(%d) must be a string", name, k+1);
3642 type_string[k] =
'{';
3643 else if (item ==
"()")
3644 type_string[k] =
'(';
3645 else if (item ==
".")
3646 type_string[k] =
'.';
3648 error (
"%s: invalid indexing type '%s'", name, item.c_str ());
3652 if (subs(k).is_string ())
3653 idx_item(0) = subs(k);
3654 else if (subs(k).iscell ())
3656 Cell subs_cell = subs(k).cell_value ();
3658 for (
int n = 0;
n < subs_cell.
numel ();
n++)
3660 if (subs_cell(
n).is_string ()
3661 && subs_cell(
n).string_value () ==
":")
3664 idx_item(
n) = subs_cell(
n);
3668 error (
"%s: subs(%d) must be a string or cell array", name, k+1);
3670 idx.push_back (idx_item);
3674 DEFUN (subsref, args, nargout,
3713 if (args.length () != 2)
3717 std::list<octave_value_list> idx;
3719 decode_subscripts (
"subsref", args(1), type, idx);
3726 return arg0.
subsref (type, idx, nargout);
3729 DEFUN (subsasgn, args, ,
3765 if (args.length () != 3)
3769 std::list<octave_value_list> idx;
3771 decode_subscripts (
"subsasgn", args(1), type, idx);
3776 return ovl (args(2).storable_value ());
3864 DEFUN (is_sq_string, args, ,
3871 if (args.length () != 1)
3874 return ovl (args(0).is_sq_string ());
3887 DEFUN (is_dq_string, args, ,
3894 if (args.length () != 1)
3897 return ovl (args(0).is_dq_string ());
3910 DEFUN (optimize_permutation_matrix, args, nargout,
3928 "optimize_permutation_matrix");
3941 DEFUN (optimize_diagonal_matrix, args, nargout,
3959 "optimize_diagonal_matrix");
3986 DEFUN (optimize_range, args, nargout,
4020 OCTAVE_END_NAMESPACE(
octave)
charNDArray max(char d, const charNDArray &m)
charNDArray min(char d, const charNDArray &m)
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.
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.
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.
symbol_table & get_symbol_table()
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.
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 const void * mex_get_data() const
virtual octave_value_list simple_subsref(char type, octave_value_list &idx, int nargout)
octave_base_value *(* type_conv_fcn)(const octave_base_value &)
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
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 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 octave_base_value * try_narrowing_conversion()
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()
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
bool is_magic_int() 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_base_value * clone() const
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
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
int16NDArray int16_array_value() const
octave_user_function * user_function_value(bool silent=false) const
octave_value & operator=(const octave_value &a)
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
octave_scalar_map scalar_map_value() 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)
Array< FloatComplex > float_complex_vector_value(bool frc_str_conv=false, bool frc_vec_conv=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
octave_user_code * user_code_value(bool silent=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)
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()
const octave_base_value & get_rep() const
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
Array< octave_idx_type > octave_idx_type_vector_value(bool req_int=false, bool frc_str_conv=false, bool frc_vec_conv=false) 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
static std::string unary_op_as_string(unary_op)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
octave_function * function_value(bool silent=false) const
bool is_int16_type() const
octave_value reshape(const dim_vector &dv) const
octave_value & assign(assign_op op, const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
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
octave_fcn_handle * fcn_handle_value(bool silent=false) const
bool is_int64_type() const
void print_info(std::ostream &os, const std::string &prefix="") const
octave_base_value * empty_clone() const
octave_value single_subsref(const std::string &type, const octave_value_list &idx)
ComplexColumnVector complex_column_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
octave_classdef * classdef_object_value(bool silent=false) const
int64NDArray int64_array_value() const
octave_idx_type get_count() const
NDArray array_value(bool frc_str_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
octave_value & non_const_unary_op(unary_op op)
static std::string binary_op_fcn_name(binary_op)
Array< double > vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
octave_idx_type length() const
bool is_double_type() const
bool is_int32_type() const
const void * mex_get_data(mxClassID class_id=mxUNKNOWN_CLASS, mxComplexity complexity=mxREAL) const
octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
uint8NDArray uint8_array_value() const
std::string type_name() const
octave_value all(int dim=0) const
Array< float > float_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) 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()
Array< Complex > complex_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
Array< int > int_vector_value(bool req_int=false, bool frc_str_conv=false, bool frc_vec_conv=false) const
FloatNDArray float_array_value(bool frc_str_conv=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
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)
octave_user_script * user_script_value(bool silent=false) const
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,...)
#define panic_impossible()
void warn_implicit_conversion(const char *id, const char *from, const char *to)
octave::idx_vector idx_vector
interpreter & __get_interpreter__()
type_info & __get_type_info__()
F77_RET_T const F77_INT F77_CMPLX * A
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)
std::complex< double > Complex
std::complex< float > FloatComplex
const octave_base_value const Array< octave_idx_type > & ra_idx
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
const octave_char_matrix & v2
octave_double_range octave_range
int register_type(const std::string &t_name, const std::string &c_name, const octave_value &val)
octave::type_info::assign_op_fcn assign_op_fcn
octave::type_info::non_const_unary_op_fcn non_const_unary_op_fcn
#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.