137 retval =
"<unknown>";
163 retval =
"transpose";
167 retval =
"ctranspose";
269 retval =
"<unknown>";
369 retval =
"transtimes";
373 retval =
"timestrans";
377 retval =
"hermtimes";
381 retval =
"timesherm";
385 retval =
"transldiv";
483 retval =
"<unknown>";
596 #if defined (HAVE_LONG_LONG_INT)
603 #if defined (HAVE_UNSIGNED_LONG_LONG_INT)
965 : rep (new octave_int8_scalar (i))
971 : rep (new octave_uint8_scalar (i))
977 : rep (new octave_int16_scalar (i))
983 : rep (new octave_uint16_scalar (i))
989 : rep (new octave_int32_scalar (i))
995 : rep (new octave_uint32_scalar (i))
1001 : rep (new octave_int64_scalar (i))
1007 : rep (new octave_uint64_scalar (i))
1013 : rep (new octave_int8_matrix (inda))
1019 : rep (new octave_int8_matrix (inda))
1025 : rep (new octave_uint8_matrix (inda))
1031 : rep (new octave_uint8_matrix (inda))
1037 : rep (new octave_int16_matrix (inda))
1043 : rep (new octave_int16_matrix (inda))
1049 : rep (new octave_uint16_matrix (inda))
1055 : rep (new octave_uint16_matrix (inda))
1061 : rep (new octave_int32_matrix (inda))
1067 : rep (new octave_int32_matrix (inda))
1073 : rep (new octave_uint32_matrix (inda))
1079 : rep (new octave_uint32_matrix (inda))
1085 : rep (new octave_int64_matrix (inda))
1091 : rep (new octave_int64_matrix (inda))
1097 : rep (new octave_uint64_matrix (inda))
1103 : rep (new octave_uint64_matrix (inda))
1139 idx.
unconvert (idx_class, scalar, range, array, mask);
1203 const std::list<std::string>& plist)
1242 if (tmp && tmp !=
rep)
1255 std::list<octave_value_list> i;
1264 const std::list<octave_value_list>& idx,
int nargout)
1274 const std::list<octave_value_list>& idx,
int nargout,
1275 const std::list<octave_lvalue> *lvalue_list)
1278 return rep->
subsref (type, idx, nargout, lvalue_list);
1280 return subsref (type, idx, nargout);
1285 const std::list<octave_value_list>& idx,
1290 std::list<octave_value_list> new_idx (idx);
1291 for (
size_t i = 0; i < skip; i++)
1292 new_idx.erase (new_idx.begin ());
1293 return subsref (type.substr (skip), new_idx);
1301 const std::list<octave_value_list>& idx,
1306 std::list<octave_value_list> new_idx (idx);
1307 for (
size_t i = 0; i < skip; i++)
1308 new_idx.erase (new_idx.begin ());
1309 return subsref (type.substr (skip), new_idx, nargout);
1317 const std::list<octave_value_list>& idx,
1318 const std::list<octave_lvalue> *lvalue_list,
1323 std::list<octave_value_list> new_idx (idx);
1324 for (
size_t i = 0; i < skip; i++)
1325 new_idx.erase (new_idx.begin ());
1326 return subsref (type.substr (skip), new_idx, nargout, lvalue_list);
1334 const std::list<octave_value_list>& idx,
1339 std::list<octave_value_list> new_idx (idx);
1340 for (
size_t i = 0; i < skip; i++)
1341 new_idx.erase (new_idx.begin ());
1342 return subsref (type.substr (skip), new_idx, auto_add);
1356 const std::list<octave_lvalue> *lvalue_list)
1363 gripe_assign_failed (
const std::string& on,
const std::string& tn1,
1364 const std::string& tn2)
1366 error (
"assignment failed for '%s %s %s'",
1367 tn1.c_str (), on.c_str (), tn2.c_str ());
1373 const std::string& tn1,
1374 const std::string& tn2)
1376 error (
"assignment failed, or no method for '%s %s %s'",
1377 tn1.c_str (), on.c_str (), tn2.c_str ());
1382 const std::list<octave_value_list>& idx,
1390 const std::list<octave_value_list>& idx,
1398 const std::list<octave_value_list>& idx,
1422 error (
"in computed assignment A(index) OP= X, A must be defined first");
1466 catch (octave_execution_exception)
1486 error (
"in computed assignment A OP= X, A must be defined first");
1498 for (
int i = 0; i < dv.
length (); i++)
1516 bool retval =
false;
1544 #if defined (USE_64_BIT_IDX_T)
1547 return int_value (req_int, frc_str_conv);
1607 const std::string& my_type,
const std::string& wanted_type)
1613 if (retval.
length () > 2 || (retval(0) != 1 && retval(1) != 1))
1615 if (!force_vector_conversion)
1617 my_type.c_str (), wanted_type.c_str ());
1626 bool frc_vec_conv)
const
1634 bool frc_vec_conv)
const
1642 bool frc_vec_conv)
const
1650 bool frc_vec_conv)
const
1658 bool force_vector_conversion)
const
1666 force_vector_conversion,
1685 bool force_vector_conversion)
const
1720 double ai = a.
elem (i);
1721 int v =
static_cast<int> (ai);
1723 retval.
xelem (i) = v;
1741 force_vector_conversion,
1760 bool force_string_conv,
1761 bool force_vector_conversion)
const
1796 double ai = a.
elem (i);
1799 retval.
xelem (i) = v;
1817 force_vector_conversion,
1823 bool force_vector_conversion)
const
1831 force_vector_conversion,
1837 bool frc_vec_conv)
const
1845 bool frc_vec_conv)
const
1854 bool frc_vec_conv)
const
1862 bool frc_vec_conv)
const
1870 bool force_vector_conversion)
const
1878 force_vector_conversion,
1884 bool force_vector_conversion)
const
1892 force_vector_conversion,
1927 return rep->
write (os, block_size, output_type, skip, flt_fmt);
1932 const std::string& tn2)
1934 error (
"binary operator '%s' not implemented for '%s' by '%s' operations",
1935 on.c_str (), tn1.c_str (), tn2.c_str ());
1941 error (
"type conversion failed for binary operator '%s'", on.c_str ());
1963 retval =
f (v1, v2);
1965 catch (octave_execution_exception)
1986 retval =
f (*v1.
rep, *v2.
rep);
1988 catch (octave_execution_exception)
2065 else if (cf1.
type_id () >= 0 &&
2113 retval =
f (*tv1.
rep, *tv2.
rep);
2115 catch (octave_execution_exception)
2193 error (
"invalid compound operator");
2219 retval =
f (v1, v2);
2221 catch (octave_execution_exception)
2238 retval =
f (*v1.
rep, *v2.
rep);
2240 catch (octave_execution_exception)
2255 error (
"concatenation operator not implemented for '%s' by '%s' operations",
2256 tn1.c_str (), tn2.c_str ());
2262 error (
"type conversion failed for concatenation operator");
2284 retval =
f (*v1.
rep, *v2.
rep, ra_idx);
2286 catch (octave_execution_exception)
2357 os << prefix <<
"type_name: " <<
type_name () <<
"\n"
2358 << prefix <<
"count: " <<
get_count () <<
"\n"
2359 << prefix <<
"rep info: ";
2367 error (
"unary operator '%s' not implemented for '%s' operands",
2368 on.c_str (), tn.c_str ());
2374 error (
"type conversion failed for unary operator '%s'", on.c_str ());
2395 catch (octave_execution_exception)
2416 retval =
f (*v.
rep);
2418 catch (octave_execution_exception)
2452 const std::string& tn)
2454 error (
"operator %s: type conversion for '%s' failed",
2455 op.c_str (), tn.c_str ());
2469 error (
"in x%s or %sx, x must be defined first",
2470 op_str.c_str (), op_str.c_str ());
2488 catch (octave_execution_exception)
2516 catch (octave_execution_exception)
2521 if (old_rep && --old_rep->
count == 0)
2564 catch (octave_execution_exception)
2578 const std::list<octave_value_list>& idx)
2590 assign (assop, type, idx, 1.0);
2614 error (
"operator %s: no assign operator found", on.c_str ());
2687 error (
"operator %s: no binary operator found", on.c_str ());
2699 if (type.length () > 0)
2705 if (type.length () > 1 && type[1] ==
'.')
2746 octave_int8_scalar::register_type ();
2747 octave_int16_scalar::register_type ();
2748 octave_int32_scalar::register_type ();
2749 octave_int64_scalar::register_type ();
2750 octave_uint8_scalar::register_type ();
2751 octave_uint16_scalar::register_type ();
2752 octave_uint32_scalar::register_type ();
2753 octave_uint64_scalar::register_type ();
2754 octave_int8_matrix::register_type ();
2755 octave_int16_matrix::register_type ();
2756 octave_int32_matrix::register_type ();
2757 octave_int64_matrix::register_type ();
2758 octave_uint8_matrix::register_type ();
2759 octave_uint16_matrix::register_type ();
2760 octave_uint32_matrix::register_type ();
2761 octave_uint64_matrix::register_type ();
2794 @deftypefn {Built-in Function} {} sizeof (@var{val})\n\
2795 Return the size of @var{val} in bytes.\n\
2801 if (args.length () == 1)
2817 std::string& type_string,
2818 std::list<octave_value_list>& idx)
2827 type_string = std::string (nel,
'\0');
2828 idx = std::list<octave_value_list> ();
2836 for (
int k = 0; k < nel; k++)
2838 std::string item =
type(k).string_value ();
2843 type_string[k] =
'{';
2844 else if (item ==
"()")
2845 type_string[k] =
'(';
2846 else if (item ==
".")
2847 type_string[k] =
'.';
2850 error (
"%s: invalid indexing type '%s'", name, item.c_str ());
2856 error (
"%s: expecting type(%d) to be a character string",
2863 if (subs(k).is_string ())
2864 idx_item(0) = subs(k);
2865 else if (subs(k).is_cell ())
2867 Cell subs_cell = subs(k).cell_value ();
2869 for (
int n = 0; n < subs_cell.
length (); n++)
2871 if (subs_cell(n).is_string ()
2872 && subs_cell(n).string_value () ==
":")
2875 idx_item(n) = subs_cell(n);
2880 error (
"%s: expecting subs(%d) to be a character string or cell array",
2885 idx.push_back (idx_item);
2889 error (
"%s: second argument must be a structure with fields 'type' and 'subs'",
2895 @deftypefn {Built-in Function} {} subsref (@var{val}, @var{idx})\n\
2896 Perform the subscripted element selection operation according to\n\
2897 the subscript specified by @var{idx}.\n\
2899 The subscript @var{idx} is expected to be a structure array with\n\
2900 fields @samp{type} and @samp{subs}. Valid values for @samp{type}\n\
2901 are @samp{\"()\"}, @samp{\"@{@}\"}, and @samp{\".\"}.\n\
2902 The @samp{subs} field may be either @samp{\":\"} or a cell array\n\
2905 The following example shows how to extract the two first columns of\n\
2911 @result{} val = [ 8 1 6\n\
2914 idx.type = \"()\";\n\
2915 idx.subs = @{\":\", 1:2@};\n\
2916 subsref (val, idx)\n\
2924 Note that this is the same as writing @code{val(:,1:2)}.\n\
2926 If @var{idx} is an empty structure array with fields @samp{type}\n\
2927 and @samp{subs}, return @var{val}.\n\
2928 @seealso{subsasgn, substruct}\n\
2933 if (args.length () == 2)
2936 std::list<octave_value_list> idx;
2947 retval = arg0.
subsref (type, idx, nargout);
2958 @deftypefn {Built-in Function} {} subsasgn (@var{val}, @var{idx}, @var{rhs})\n\
2959 Perform the subscripted assignment operation according to\n\
2960 the subscript specified by @var{idx}.\n\
2962 The subscript @var{idx} is expected to be a structure array with\n\
2963 fields @samp{type} and @samp{subs}. Valid values for @samp{type}\n\
2964 are @samp{\"()\"}, @samp{\"@{@}\"}, and @samp{\".\"}.\n\
2965 The @samp{subs} field may be either @samp{\":\"} or a cell array\n\
2968 The following example shows how to set the two first columns of a\n\
2969 3-by-3 matrix to zero.\n\
2974 idx.type = \"()\";\n\
2975 idx.subs = @{\":\", 1:2@};\n\
2976 subsasgn (val, idx, 0)\n\
2977 @result{} [ 0 0 6\n\
2983 Note that this is the same as writing @code{val(:,1:2) = 0}.\n\
2985 If @var{idx} is an empty structure array with fields @samp{type}\n\
2986 and @samp{subs}, return @var{rhs}.\n\
2987 @seealso{subsref, substruct}\n\
2992 if (args.length () == 3)
2995 std::list<octave_value_list> idx;
3014 retval= arg0.
subsasgn (type, idx, args(2));
3093 @deftypefn {Built-in Function} {} is_sq_string (@var{x})\n\
3094 Return true if @var{x} is a single-quoted character string.\n\
3095 @seealso{is_dq_string, ischar}\n\
3100 if (args.length () == 1)
3120 @deftypefn {Built-in Function} {} is_dq_string (@var{x})\n\
3121 Return true if @var{x} is a double-quoted character string.\n\
3122 @seealso{is_sq_string, ischar}\n\
3127 if (args.length () == 1)