26#if defined (HAVE_CONFIG_H)
507#if defined (OCTAVE_HAVE_LONG_LONG_INT)
513#if defined (OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT)
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;
1080#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
1081# pragma GCC diagnostic push
1082# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1088#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
1089# pragma GCC diagnostic pop
1097 if (! force_range && ! r.
ok ())
1098 error (
"invalid range");
1130 : dynamic_cast<
octave_base_value *> (new octave_int8_matrix (r.array_value ())))
1139 : dynamic_cast<
octave_base_value *> (new octave_int16_matrix (r.array_value ())))
1148 : dynamic_cast<
octave_base_value *> (new octave_int32_matrix (r.array_value ())))
1157 : dynamic_cast<
octave_base_value *> (new octave_int64_matrix (r.array_value ())))
1166 : dynamic_cast<
octave_base_value *> (new octave_uint8_matrix (r.array_value ())))
1175 : dynamic_cast<
octave_base_value *> (new octave_uint16_matrix (r.array_value ())))
1184 : dynamic_cast<
octave_base_value *> (new octave_uint32_matrix (r.array_value ())))
1201 : m_rep (force_range || optimize_range
1207 : m_rep (type ==
'"'
1232 const std::list<std::string>& plist)
1239 const std::list<std::string>& plist)
1296 if (tmp && tmp !=
m_rep)
1305OCTAVE_NAMESPACE_BEGIN
1307DEFUN (
double, args, ,
1314 if (args.length () != 1)
1351DEFUN (single, args, ,
1358 if (args.length () != 1)
1361 return args(0).as_single ();
1399 if (args.length () != 1)
1402 return args(0).as_int8 ();
1414DEFUN (int16, args, ,
1421 if (args.length () != 1)
1424 return args(0).as_int16 ();
1436DEFUN (int32, args, ,
1443 if (args.length () != 1)
1446 return args(0).as_int32 ();
1458DEFUN (int64, args, ,
1465 if (args.length () != 1)
1468 return args(0).as_int64 ();
1480DEFUN (uint8, args, ,
1487 if (args.length () != 1)
1490 return args(0).as_uint8 ();
1502DEFUN (uint16, args, ,
1509 if (args.length () != 1)
1512 return args(0).as_uint16 ();
1524DEFUN (uint32, args, ,
1531 if (args.length () != 1)
1534 return args(0).as_uint32 ();
1546DEFUN (uint64, args, ,
1553 if (args.length () != 1)
1556 return args(0).as_uint64 ();
1574 std::list<octave_value_list> i;
1583 const std::list<octave_value_list>& idx,
int nargout)
1590 const std::list<octave_value_list>& idx,
1593 if (idx.size () > skip)
1595 std::list<octave_value_list> new_idx (idx);
1596 for (std::size_t i = 0; i < skip; i++)
1597 new_idx.erase (new_idx.begin ());
1598 return subsref (type.substr (skip), new_idx);
1606 const std::list<octave_value_list>& idx,
1609 if (idx.size () > skip)
1611 std::list<octave_value_list> new_idx (idx);
1612 for (std::size_t i = 0; i < skip; i++)
1613 new_idx.erase (new_idx.begin ());
1614 return subsref (type.substr (skip), new_idx, nargout);
1622 const std::list<octave_value_list>& idx,
1625 if (idx.size () > skip)
1627 std::list<octave_value_list> new_idx (idx);
1628 for (std::size_t i = 0; i < skip; i++)
1629 new_idx.erase (new_idx.begin ());
1630 return subsref (type.substr (skip), new_idx, auto_add);
1638 const std::list<octave_value_list>& idx,
1646 const std::list<octave_value_list>& idx,
1654 const std::list<octave_value_list>& idx,
1664 error (
"in computed assignment A(index) OP= X, A must be defined first");
1673 *
this =
subsasgn (type, idx, t_rhs);
1694 octave::type_info& ti
1697 f = ti.lookup_assign_op (op, tthis, trhs);
1717 error (
"in computed assignment A OP= X, A must be defined first");
1749 for (
int i = 0; i < dv.
ndims (); i++)
1767 bool retval =
false;
1799#if defined (OCTAVE_ENABLE_64)
1802 return int_value (req_int, frc_str_conv);
1867make_vector_dims (
const dim_vector& dv,
bool force_vector_conversion,
1868 const std::string& my_type,
const std::string& wanted_type)
1871 retval.chop_trailing_singletons ();
1874 if (retval.ndims () > 2 || (retval(0) != 1 && retval(1) != 1))
1876 if (! force_vector_conversion)
1878 my_type.c_str (), wanted_type.c_str ());
1887 bool frc_vec_conv)
const
1895 bool frc_vec_conv)
const
1903 bool frc_vec_conv)
const
1911 bool frc_vec_conv)
const
1919 bool force_vector_conversion)
const
1923 return retval.
reshape (make_vector_dims (retval.
dims (),
1924 force_vector_conversion,
1928template <
typename T>
1943 bool force_vector_conversion)
const
1977 double ai = a.
elem (i);
1978 int v =
static_cast<int> (ai);
1980 retval.
xelem (i) = v;
1992 return retval.
reshape (make_vector_dims (retval.
dims (),
1993 force_vector_conversion,
1997template <
typename T>
2012 bool force_string_conv,
2013 bool force_vector_conversion)
const
2047 double ai = a.
elem (i);
2050 retval.
xelem (i) = v;
2053 error_with_cfn (
"conversion of %g to octave_idx_type value failed", ai);
2062 return retval.
reshape (make_vector_dims (retval.
dims (),
2063 force_vector_conversion,
2069 bool force_vector_conversion)
const
2073 return retval.
reshape (make_vector_dims (retval.
dims (),
2074 force_vector_conversion,
2080 bool frc_vec_conv)
const
2088 bool frc_vec_conv)
const
2097 bool frc_vec_conv)
const
2105 bool frc_vec_conv)
const
2113 bool force_vector_conversion)
const
2117 return retval.
reshape (make_vector_dims (retval.
dims (),
2118 force_vector_conversion,
2124 bool force_vector_conversion)
const
2128 return retval.
reshape (make_vector_dims (retval.
dims (),
2129 force_vector_conversion,
2137#define XVALUE_EXTRACTOR(TYPE, NAME, FCN) \
2139 octave_value::NAME (const char *fmt, ...) const \
2147 catch (octave::execution_exception& ee) \
2152 va_start (args, fmt); \
2153 verror (ee, fmt, args); \
2254XVALUE_EXTRACTOR (octave::range<float>, xfloat_range_value, float_range_value)
2255XVALUE_EXTRACTOR (octave::range<octave_int8>, xint8_range_value, int8_range_value)
2256XVALUE_EXTRACTOR (octave::range<octave_int16>, xint16_range_value, int16_range_value)
2257XVALUE_EXTRACTOR (octave::range<octave_int32>, xint32_range_value, int32_range_value)
2258XVALUE_EXTRACTOR (octave::range<octave_int64>, xint64_range_value, int64_range_value)
2259XVALUE_EXTRACTOR (octave::range<octave_uint8>, xuint8_range_value, uint8_range_value)
2260XVALUE_EXTRACTOR (octave::range<octave_uint16>, xuint16_range_value, uint16_range_value)
2261XVALUE_EXTRACTOR (octave::range<octave_uint32>, xuint32_range_value, uint32_range_value)
2262XVALUE_EXTRACTOR (octave::range<octave_uint64>, xuint64_range_value, uint64_range_value)
2298#undef XVALUE_EXTRACTOR
2309 error (
"range with infinite number of elements cannot be stored");
2334 error (
"range with infinite number of elements cannot be stored");
2350 return m_rep->
write (os, block_size, output_type, skip, flt_fmt);
2356 os << prefix <<
"type_name: " <<
type_name () <<
"\n"
2357 << prefix <<
"count: " <<
get_count () <<
"\n"
2358 << prefix <<
"m_rep info: ";
2403 if (class_id != mxUNKNOWN_CLASS)
2405 bool type_ok =
false;
2409 case mxDOUBLE_CLASS:
2413 case mxSINGLE_CLASS:
2437 case mxUINT16_CLASS:
2441 case mxUINT32_CLASS:
2445 case mxUINT64_CLASS:
2451 error (
"mex_get_data: unexpected type requested");
2455 error (
"mex_get_data: type mismatch");
2457 if (complexity == mxCOMPLEX && !
iscomplex ())
2458 error (
"mex_get_data: objectis not complex as requested");
2464OCTAVE_NORETURN
static void
2465err_unary_op_conversion_failed (
const std::string& op,
2466 const std::string& tn)
2468 error (
"operator %s: type conversion for '%s' failed",
2469 op.c_str (), tn.c_str ());
2472OCTAVE_NORETURN
static void
2473err_unary_op (
const std::string& on,
const std::string& tn)
2475 error (
"unary operator '%s' not implemented for '%s' operands",
2476 on.c_str (), tn.c_str ());
2490 error (
"in x%s or %sx, x must be defined first",
2491 op_str.c_str (), op_str.c_str ());
2501 = ti.lookup_non_const_unary_op (op, t);
2519 err_unary_op_conversion_failed
2527 f = ti.lookup_non_const_unary_op (op, t);
2533 if (old_rep && --old_rep->
count == 0)
2561 octave::type_info& ti
2564 f = ti.lookup_non_const_unary_op (op, t);
2578 const std::list<octave_value_list>& idx)
2590 assign (assop, type, idx, 1.0);
2610 error (
"operator %s: no assign operator found", on.c_str ());
2659 error (
"operator %s: no binary operator found", on.c_str ());
2667 if (type.length () > 0)
2672 if (type.length () > 1 && type[1] ==
'.')
2691OCTAVE_NAMESPACE_BEGIN
2693 OCTAVE_NORETURN
static void
2694 err_binary_op (
const std::string& on,
const std::string& tn1,
2695 const std::string& tn2)
2697 error (
"binary operator '%s' not implemented for '%s' by '%s' operations",
2698 on.c_str (), tn1.c_str (), tn2.c_str ());
2701 OCTAVE_NORETURN
static void
2702 err_binary_op_conv (
const std::string& on)
2704 error (
"type conversion failed for binary operator '%s'", on.c_str ());
2727 retval =
f (v1,
v2);
2898 error (
"invalid compound operator");
2919 retval =
f (v1,
v2);
2921 retval = decompose_binary_op (ti, op, v1,
v2);
2930 retval = decompose_binary_op (ti, op, v1,
v2);
2945 OCTAVE_NORETURN
static void
2946 err_cat_op (
const std::string& tn1,
const std::string& tn2)
2948 error (
"concatenation operator not implemented for '%s' by '%s' operations",
2949 tn1.c_str (), tn2.c_str ());
2952 OCTAVE_NORETURN
static void
2953 err_cat_op_conv (
void)
2955 error (
"type conversion failed for concatenation operator");
3039 if (op1_type == op2_type)
3067 template <
typename T>
3069 check_colon_operand (
const octave_value& val,
const char *op_str)
3076 static const double out_of_range_top
3080 if (dval >= out_of_range_top
3082 || std::modf (dval, &intpart) != 0.0)
3083 error (
"colon operator %s invalid (not an integer or out of range for given integer type)", op_str);
3089 template <
typename UT,
3090 typename std::enable_if<(std::is_integral<UT>::value
3091 && std::is_unsigned<UT>::value),
3094 integer_difference (UT a, UT b)
3096 return a > b ? a - b : b - a;
3102 template <
typename ST,
3103 typename UT =
typename std::make_unsigned<ST>::type,
3104 typename std::enable_if<(std::is_integral<ST>::value
3105 && std::is_signed<ST>::value),
3108 integer_difference (ST a, ST b)
3113 static const UT offset
3116 UT au =
static_cast<UT
> (a) + offset;
3117 UT bu =
static_cast<UT
> (b) + offset;
3119 return integer_difference (au, bu);
3132 template <
typename T,
3133 typename UT =
typename std::make_unsigned<T>::type,
3134 typename std::enable_if<std::is_integral<T>::value,
3137 range_numel_aux (T base, UT unsigned_increment, T limit)
3142 UT nel_m1 = integer_difference (limit, base) / unsigned_increment;
3146 error (
"too many elements for range!");
3153 template <
typename ST,
3154 typename UT =
typename std::make_unsigned<ST>::type,
3155 typename std::enable_if<(std::is_integral<ST>::value
3156 && std::is_signed<ST>::value),
3159 range_increment (ST increment)
3161 return (increment < 0
3162 ? UT (0) -
static_cast<UT
> (increment)
3163 :
static_cast<UT
> (increment));
3170 template <
typename T,
3171 typename UT =
typename std::make_unsigned<T>::type,
3172 typename std::enable_if<(std::is_integral<UT>::value
3173 && std::is_unsigned<UT>::value),
3176 range_increment (UT increment)
3183 template <
typename T,
3184 typename UT =
typename std::make_unsigned<T>::type>
3185 typename std::enable_if<(std::is_integral<UT>::value
3186 && std::is_unsigned<UT>::value), UT>::type
3187 range_increment (
double increment)
3189 double abs_increment =
std::abs (increment);
3191 return static_cast<UT
> (abs_increment);
3197 template <
typename ST,
3198 typename std::enable_if<(std::is_integral<ST>::value
3199 && std::is_signed<ST>::value),
3202 range_numel (ST base, ST increment, ST limit)
3204 typedef typename std::make_unsigned<ST>::type UT;
3207 || (increment > 0 && base > limit)
3208 || (increment < 0 && base < limit))
3211 UT unsigned_increment = range_increment<ST> (increment);
3213 return range_numel_aux (base, unsigned_increment, limit);
3219 template <
typename UT,
3220 typename std::enable_if<(std::is_integral<UT>::value
3221 && std::is_unsigned<UT>::value),
3224 range_numel (UT base, UT increment, UT limit)
3227 if (increment == 0 || base > limit)
3230 return range_numel_aux (base, increment, limit);
3236 template <
typename T,
3237 typename UT =
typename std::make_unsigned<T>::type,
3238 typename std::enable_if<std::is_integral<T>::value,
3241 range_numel (T base,
double increment, T limit)
3244 if (
math::isnan (increment) || std::modf (increment, &intpart) != 0.0)
3245 error (
"colon operator increment invalid (not an integer)");
3248 || (increment > 0 && base > limit)
3249 || (increment < 0 && base < limit))
3252 static const double out_of_range_top
3255 double abs_increment =
std::abs (increment);
3263 if (abs_increment >= out_of_range_top)
3266 UT unsigned_increment = range_increment<T> (increment);
3268 return range_numel_aux (base, unsigned_increment, limit);
3273 template <
typename T,
3275 typename std::enable_if<(std::is_integral<T>::value
3276 && std::is_arithmetic<IT>::value),
3279 make_int_range (T base,
IT increment, T limit)
3290 typedef typename std::make_unsigned<T>::type UT;
3292 UT unsigned_increment = range_increment<T> (increment);
3295 result.xelem (0) = val;
3301 val += unsigned_increment;
3302 result.xelem (i) = val;
3309 val -= unsigned_increment;
3310 result.xelem (i) = val;
3334 template <
typename T,
3335 typename std::enable_if<std::is_same<T, double>::value,
3338 make_float_range (T base, T increment, T limit,
bool is_for_cmd_expr)
3346 || (increment > 0 && base > limit)
3347 || (increment < 0 && base < limit))
3353 range<T> r (base, increment, limit);
3355 if (! is_for_cmd_expr && ! r.is_storable ())
3356 error (
"range with infinite number of elements cannot be stored");
3361 template <
typename T,
3362 typename std::enable_if<std::is_same<T, float>::value,
3365 make_float_range (T base, T increment, T limit,
bool is_for_cmd_expr)
3373 || (increment > 0 && base > limit)
3374 || (increment < 0 && base < limit))
3380 range<T> r (base, increment, limit);
3382 if (! is_for_cmd_expr && ! r.is_storable ())
3383 error (
"range with infinite number of elements cannot be stored");
3388 template <
typename T,
3389 typename std::enable_if<(std::is_same<T, octave_int8>::value
3390 || std::is_same<T, octave_uint8>::value
3391 || std::is_same<T, octave_int16>::value
3392 || std::is_same<T, octave_uint16>::value
3393 || std::is_same<T, octave_int32>::value
3394 || std::is_same<T, octave_uint32>::value
3395 || std::is_same<T, octave_int64>::value
3396 || std::is_same<T, octave_uint64>::value),
3405 check_colon_operand<T> (base,
"lower bound");
3406 check_colon_operand<T> (limit,
"upper bound");
3408 typename T::val_type base_val = octave_value_extract<T> (base).value ();
3409 typename T::val_type limit_val = octave_value_extract<T> (limit).value ();
3415 return make_int_range (base_val, increment_val, limit_val);
3418 check_colon_operand<T> (increment,
"increment");
3420 typename T::val_type increment_val
3421 = octave_value_extract<T> (increment).value ();
3423 return make_int_range (base_val, increment_val, limit_val);
3426 template <
typename T,
3427 typename std::enable_if<std::is_floating_point<T>::value,
3436 T base_val = octave_value_extract<T> (base);
3437 T increment_val = octave_value_extract<T> (increment);
3438 T limit_val = octave_value_extract<T> (limit);
3440 return make_float_range (base_val, increment_val, limit_val,
3454 char type = dq_str ?
'"' :
'\'';
3464 range<double> tmp (mtx_base(0), mtx_increment(0), mtx_limit(0));
3483 tmp1(1) = increment_arg;
3509 if (base.
numel () > 1 || limit.
numel () > 1 || increment.
numel () > 1)
3511 "colon arguments should be scalars");
3515 "imaginary part of complex colon arguments is ignored");
3519 builtin_type_t type_id = get_colon_op_type (base, increment, limit);
3531 return make_float_range<double> (base, increment, limit, is_for_cmd_expr);
3535 return make_float_range<float> (base, increment, limit, is_for_cmd_expr);
3538 return make_int_range<octave_int8> (base, increment, limit);
3541 return make_int_range<octave_int16> (base, increment, limit);
3544 return make_int_range<octave_int32> (base, increment, limit);
3547 return make_int_range<octave_int64> (base, increment, limit);
3550 return make_int_range<octave_uint8> (base, increment, limit);
3553 return make_int_range<octave_uint16> (base, increment, limit);
3556 return make_int_range<octave_uint32> (base, increment, limit);
3559 return make_int_range<octave_uint64> (base, increment, limit);
3562 return make_char_range (base, increment, limit);
3565 error (
"incompatible types found in range expression");
3568 error (
"invalid types found in range expression");
3574 OCTAVE_NORETURN
static void
3575 err_unary_op_conv (
const std::string& on)
3577 error (
"type conversion failed for unary operator '%s'", on.c_str ());
3723OCTAVE_NAMESPACE_BEGIN
3725DEFUN (
sizeof, args, ,
3732 if (args.length () != 1)
3735 return ovl (args(0).byte_size ());
3746 std::string& type_string,
3747 std::list<octave_value_list>& idx)
3749 const octave_map m = arg.
xmap_value (
"%s: second argument must be a structure with fields 'type' and 'subs'",
name);
3752 error (
"%s: second argument must be a structure with fields 'type' and 'subs'",
3757 type_string = std::string (nel,
'\0');
3758 idx = std::list<octave_value_list> ();
3766 for (
int k = 0; k < nel; k++)
3768 std::string item = type(k).xstring_value (
"%s: type(%d) must be a string",
name, k+1);
3771 type_string[k] =
'{';
3772 else if (item ==
"()")
3773 type_string[k] =
'(';
3774 else if (item ==
".")
3775 type_string[k] =
'.';
3777 error (
"%s: invalid indexing type '%s'",
name, item.c_str ());
3781 if (subs(k).is_string ())
3782 idx_item(0) = subs(k);
3783 else if (subs(k).iscell ())
3785 Cell subs_cell = subs(k).cell_value ();
3787 for (
int n = 0; n < subs_cell.
numel (); n++)
3789 if (subs_cell(n).is_string ()
3790 && subs_cell(n).string_value () ==
":")
3793 idx_item(n) = subs_cell(n);
3797 error (
"%s: subs(%d) must be a string or cell array",
name, k+1);
3799 idx.push_back (idx_item);
3803DEFUN (subsref, args, nargout,
3839 if (args.length () != 2)
3843 std::list<octave_value_list> idx;
3845 decode_subscripts (
"subsref", args(1), type, idx);
3852 return arg0.
subsref (type, idx, nargout);
3855DEFUN (subsasgn, args, ,
3888 if (args.length () != 3)
3892 std::list<octave_value_list> idx;
3894 decode_subscripts (
"subsasgn", args(1), type, idx);
3899 return ovl (args(2).storable_value ());
3987DEFUN (is_sq_string, args, ,
3994 if (args.length () != 1)
3997 return ovl (args(0).is_sq_string ());
4010DEFUN (is_dq_string, args, ,
4017 if (args.length () != 1)
4020 return ovl (args(0).is_dq_string ());
4033DEFUN (optimize_permutation_matrix, args, nargout,
4051 "optimize_permutation_matrix");
4064DEFUN (optimize_diagonal_matrix, args, nargout,
4082 "optimize_diagonal_matrix");
4109DEFUN (optimize_range, args, nargout,
charNDArray max(char d, const charNDArray &m)
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.
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
T & elem(octave_idx_type n)
Size of the specified dimension.
OCTARRAY_API 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_API Matrix matrix_value(void) const
Vector representing the dimensions (size) of an Array.
OCTAVE_API 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.
static dim_vector alloc(int n)
octave_idx_type ndims(void) const
Number of dimensions.
symbol_table & get_symbol_table(void)
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.
idx_class_type idx_class(void) const
OCTAVE_API void unconvert(idx_class_type &iclass, double &scalar, range< double > &range, Array< double > &array, Array< bool > &mask) const
virtual bool load_hdf5(octave_hdf5_id loc_id, const char *name)
virtual type_conv_info numeric_conversion_function(void) const
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
octave::refcount< octave_idx_type > count
virtual octave_base_value * try_narrowing_conversion(void)
virtual const void * mex_get_data(void) const
virtual Cell cell_value(void) const
virtual octave_scalar_map scalar_map_value(void) const
virtual octave_user_script * user_script_value(bool silent=false)
virtual bool is_storable(void) const
virtual octave_map map_value(void) const
virtual octave_fcn_handle * fcn_handle_value(bool silent=false)
virtual octave_classdef * classdef_object_value(bool silent=false)
octave_base_value *(* type_conv_fcn)(const octave_base_value &)
virtual octave_value_list list_value(void) const
virtual octave_base_value * empty_clone(void) const
virtual int type_id(void) const
virtual std::string class_name(void) 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 octave_base_value * clone(void) 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 std::string type_name(void) const
virtual float_display_format get_edit_display_format(void) 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 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 > &)
static void register_type(void)
virtual octave_function * function_value(bool silent=false)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static int static_type_id(void)
static int static_type_id(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
octave_value make_weak_nested_handle(void) const
bool is_weak_anonymous(void) const
static void register_type(void)
bool is_anonymous(void) const
octave_value make_weak_anonymous_handle(void) const
bool is_nested(void) const
bool is_weak_nested(void) const
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
octave_idx_type nfields(void) const
const Cell & contents(const_iterator p) const
octave_idx_type numel(void) const
bool contains(const std::string &name) const
static void register_type(void)
static const octave_value instance
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
static void register_type(void)
void maybe_economize(void)
OCTINTERP_API assign_op unary_op_to_assign_op(unary_op op)
octave_value & operator=(const octave_value &a)
octave_idx_type get_count(void) const
static OCTINTERP_API std::string unary_op_fcn_name(unary_op)
int32NDArray int32_array_value(void) const
OCTINTERP_API const void * mex_get_data(mxClassID class_id=mxUNKNOWN_CLASS, mxComplexity complexity=mxREAL) const
uint16NDArray uint16_array_value(void) const
static OCTINTERP_API octave_base_value * make_range_rep_deprecated(double base, double inc, double limit)
OCTINTERP_API Array< double > vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
OCTINTERP_API octave_value_list list_value(void) const
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
OCTINTERP_API binary_op op_eq_to_binary_op(assign_op op)
static OCTINTERP_API std::string binary_op_as_string(binary_op)
OCTINTERP_API ComplexRowVector complex_row_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
OCTINTERP_API octave_function * function_value(bool silent=false) const
octave_base_value::type_conv_info numeric_conversion_function(void) const
int int_value(bool req_int=false, bool frc_str_conv=false) const
bool is_uint16_type(void) const
builtin_type_t builtin_type(void) const
OCTINTERP_API bool load_ascii(std::istream &is)
int64_t int64_value(bool req_int=false, bool frc_str_conv=false) const
OCTINTERP_API octave_scalar_map scalar_map_value(void) const
OCTINTERP_API 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
OCTINTERP_API octave_fcn_handle * fcn_handle_value(bool silent=false) const
OCTINTERP_API octave_user_function * user_function_value(bool silent=false) const
bool is_int8_type(void) const
octave_idx_type rows(void) const
OCTINTERP_API octave_map xmap_value(const char *fmt,...) const
static OCTINTERP_API octave_value empty_conv(const std::string &type, const octave_value &rhs=octave_value())
static OCTINTERP_API std::string assign_op_as_string(assign_op)
octave_idx_type numel(void) const
OCTINTERP_API RowVector row_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
OCTINTERP_API FloatComplexColumnVector float_complex_column_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
octave_idx_type idx_type_value(bool req_int=false, bool frc_str_conv=false) const
bool is_magic_int(void) const
bool is_dq_string(void) const
static OCTINTERP_API assign_op binary_op_to_assign_op(binary_op)
octave_base_value * empty_clone(void) const
ComplexNDArray complex_array_value(bool frc_str_conv=false) const
OCTINTERP_API octave_value storable_value(void) const
bool is_defined(void) const
bool isinteger(void) const
bool is_double_type(void) const
Cell cell_value(void) const
void break_closure_cycles(const std::shared_ptr< octave::stack_frame > &)
bool is_function_handle(void) const
bool is_equal(const octave_value &) const
std::string class_name(void) const
bool is_uint32_type(void) const
octave_idx_type columns(void) const
OCTINTERP_API ColumnVector column_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
int8NDArray int8_array_value(void) const
static OCTINTERP_API std::string unary_op_as_string(unary_op)
OCTINTERP_API Array< int > int_vector_value(bool req_int=false, bool frc_str_conv=false, bool frc_vec_conv=false) const
bool is_int64_type(void) const
int64NDArray int64_array_value(void) const
uint8NDArray uint8_array_value(void) const
OCTINTERP_API octave_classdef * classdef_object_value(bool silent=false) const
octave_value reshape(const dim_vector &dv) const
OCTINTERP_API Array< FloatComplex > float_complex_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
bool is_zero_by_zero(void) const
OCTINTERP_API Array< octave_idx_type > octave_idx_type_vector_value(bool req_int=false, bool frc_str_conv=false, bool frc_vec_conv=false) const
OCTINTERP_API octave_value & assign(assign_op op, const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
OCTINTERP_API octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, std::size_t skip=1)
OCTINTERP_API Array< Complex > complex_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
bool is_int32_type(void) const
static OCTINTERP_API octave_base_value * nil_rep(void)
bool is_uint64_type(void) const
bool is_int16_type(void) const
uint64NDArray uint64_array_value(void) const
OCTINTERP_API FloatComplexRowVector float_complex_row_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
octave_base_value::type_conv_info numeric_demotion_function(void) const
bool is_range(void) const
OCTINTERP_API Array< float > float_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
OCTINTERP_API octave_value & non_const_unary_op(unary_op op)
NDArray array_value(bool frc_str_conv=false) const
static OCTINTERP_API binary_op assign_op_to_binary_op(assign_op)
static OCTINTERP_API std::string binary_op_fcn_name(binary_op)
bool is_single_type(void) const
uint32NDArray uint32_array_value(void) const
OCTINTERP_API std::string get_dims_str(void) const
octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
const octave_base_value & get_rep(void) const
OCTINTERP_API ComplexColumnVector complex_column_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
OCTINTERP_API octave_map map_value(void) const
octave_value all(int dim=0) const
bool isobject(void) const
octave_base_value * m_rep
The real representation.
OCTINTERP_API bool load_hdf5(octave_hdf5_id loc_id, const char *name)
bool is_undefined(void) const
FloatComplexNDArray float_complex_array_value(bool frc_str_conv=false) const
OCTINTERP_API octave_value single_subsref(const std::string &type, const octave_value_list &idx)
OCTINTERP_API octave_user_code * user_code_value(bool silent=false) const
OCTINTERP_API octave_idx_type length(void) const
FloatNDArray float_array_value(bool frc_str_conv=false) const
bool is_uint8_type(void) const
int16NDArray int16_array_value(void) const
OCTINTERP_API bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
OCTINTERP_API octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
Matrix matrix_value(bool frc_str_conv=false) const
bool iscomplex(void) const
OCTINTERP_API octave_value undef_subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
OCTINTERP_API void maybe_mutate(void)
double double_value(bool frc_str_conv=false) const
OCTINTERP_API octave_base_value * clone(void) const
OCTINTERP_API float_display_format get_edit_display_format(void) const
OCTINTERP_API void make_storable_value(void)
OCTINTERP_API octave_user_script * user_script_value(bool silent=false) const
OCTINTERP_API void print_info(std::ostream &os, const std::string &prefix="") const
std::string type_name(void) const
bool is_legacy_object(void) const
dim_vector dims(void) const
OCTINTERP_API FloatColumnVector float_column_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
OCTINTERP_API FloatRowVector float_row_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
static void register_type(void)
octave_value find_function(const std::string &name, const symbol_scope &search_scope=symbol_scope())
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)
OCTINTERP_API void print_usage(void)
#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)
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
class OCTAVE_API RowVector
class OCTAVE_API FloatColumnVector
class OCTAVE_API FloatComplexRowVector
class OCTAVE_API ComplexColumnVector
class OCTAVE_API ColumnVector
class OCTAVE_API FloatComplexColumnVector
class OCTAVE_API ComplexRowVector
class OCTAVE_API FloatRowVector
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
interpreter & __get_interpreter__(const std::string &who)
type_info & __get_type_info__(const std::string &who)
std::complex< double > Complex
std::complex< float > FloatComplex
static double as_double(OCTAVE_TIME_T sec, long usec)
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
static bool scalar(const dim_vector &dims)
static bool Voptimize_range
static bool Voptimize_diagonal_matrix
static bool Voptimize_permutation_matrix
#define XVALUE_EXTRACTOR(TYPE, NAME, FCN)
OCTINTERP_API void install_types(octave::type_info &)
OCTINTERP_API octave_value cat_op(type_info &ti, const octave_value &a, const octave_value &b, const Array< octave_idx_type > &ra_idx)
OCTINTERP_API octave_value colon_op(const octave_value &base, const octave_value &increment, const octave_value &limit, bool is_for_cmd_expr=false)
OCTAVE_NAMESPACE_BEGIN OCTINTERP_API octave_value unary_op(type_info &ti, octave_value::unary_op op, const octave_value &a)
OCTINTERP_API octave_value binary_op(type_info &ti, octave_value::binary_op op, const octave_value &a, const octave_value &b)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
octave_value set_internal_variable(bool &var, const octave_value_list &args, int nargout, const char *nm)