76 retval = (x > y) ? x : y;
83 "double",
"single",
"double",
"single",
84 "int8",
"int16",
"int32",
"int64",
85 "uint8",
"uint16",
"uint32",
"uint64",
87 "struct",
"cell",
"function_handle"
112 "<unknown type>",
"unknown");
128 error (
"squeeze: invalid operation for %s type", nm.c_str ());
157 const std::list<octave_value_list>&)
160 error (
"can't perform indexing operations for %s type", nm.c_str ());
166 const std::list<octave_value_list>&,
int)
169 error (
"can't perform indexing operations for %s type", nm.c_str ());
175 const std::list<octave_value_list>& idx,
184 const std::list<octave_value_list>& idx,
186 const std::list<octave_lvalue> *)
189 return subsref (type, idx, nargout);
196 error (
"can't perform indexing operations for %s type", nm.c_str ());
204 error (
"can't perform indexing operations for %s type", nm.c_str ());
210 const std::list<octave_lvalue> *)
220 error (
"%s type invalid as index value", nm.c_str ());
226 const std::list<octave_value_list>& idx,
239 if (type.length () == 1)
250 retval = tmp.
subsasgn (type, idx, rhs);
255 error (
"in indexed assignment of %s, last rhs index must be ()",
265 error (
"%s cannot be indexed with %c", nm.c_str (), type[0]);
276 error (
"can't perform indexed assignment for %s type", nm.c_str ());
294 const std::list<octave_value_list>& idx,
394 (
"octave_base_value::convert_to_row_or_column_vector ()",
412 const std::string& name)
const
435 const std::string& name,
448 const std::string& )
const
450 os <<
"no info for type: " <<
type_name () <<
"\n";
453 #define INT_CONV_METHOD(T, F) \
455 octave_base_value::F ## _value (bool require_int, bool frc_str_conv) const \
459 double d = double_value (frc_str_conv); \
463 if (require_int && D_NINT (d) != d) \
464 error_with_cfn ("conversion of %g to " #T " value failed", d); \
465 else if (d < std::numeric_limits<T>::min ()) \
466 retval = std::numeric_limits<T>::min (); \
467 else if (d > std::numeric_limits<T>::max ()) \
468 retval = std::numeric_limits<T>::max (); \
470 retval = static_cast<T> (::fix (d)); \
473 gripe_wrong_type_arg ("octave_base_value::" #F "_value ()", \
502 error (
"conversion of NaN to integer value failed");
506 retval =
static_cast<int> (
::fix (d));
944 if (tmp.
numel () == 1)
949 error (
"invalid conversion of multi-dimensional struct to scalar struct");
971 std::list<std::string>
974 std::list<std::string> retval;
1092 #if defined (HAVE_HDF5)
1285 <<
" dims: " << dv.
str ();
1291 error (
"assignment of '%s' to indexed '%s' not implemented",
1292 tn2.c_str (), tn1.c_str ());
1297 const std::string& tn2)
1299 error (
"type conversion for assignment of '%s' to indexed '%s' failed",
1300 tn2.c_str (), tn1.c_str ());
1305 const std::string& tn2)
1307 error (
"operator %s: no conversion for assignment of '%s' to indexed '%s'",
1308 on.c_str (), tn2.c_str (), tn1.c_str ());
1313 const std::list<octave_value_list>& idx,
1318 if (idx.front ().empty ())
1320 error (
"missing index in indexed assignment");
1335 f (*
this, idx.front (), rhs.
get_rep ());
1363 retval = val.
subsasgn (type, idx, rhs);
1393 else if (cf_this.
type_id () >= 0
1433 if (cf_this || cf_rhs)
1435 retval = tmp_lhs.
subsasgn (type, idx, tmp_rhs);
1554 complex_matrix_conv);
1559 DEFUN (sparse_auto_mutate, args, nargout,
1561 @deftypefn {Built-in Function} {@var{val} =} sparse_auto_mutate ()\n\
1562 @deftypefnx {Built-in Function} {@var{old_val} =} sparse_auto_mutate (@var{new_val})\n\
1563 @deftypefnx {Built-in Function} {} sparse_auto_mutate (@var{new_val}, \"local\")\n\
1564 Query or set the internal variable that controls whether Octave will\n\
1565 automatically mutate sparse matrices to full matrices to save memory.\n\
1571 sparse_auto_mutate (false);\n\
1574 @result{} sparse matrix\n\
1575 sparse_auto_mutate (true);\n\
1582 When called from inside a function with the @qcode{\"local\"} option, the\n\
1583 variable is changed locally for the function and any subroutines it calls. \n\
1584 The original variable value is restored when exiting the function.\n\