26 #if defined (HAVE_CONFIG_H)
91 "double",
"single",
"double",
"single",
92 "int8",
"int16",
"int32",
"int64",
93 "uint8",
"uint16",
"uint32",
"uint64",
95 "struct",
"cell",
"function_handle"
99 "<unknown type>",
"unknown");
115 error (
"squeeze: invalid operation for %s type", nm.c_str ());
202 const std::list<octave_value_list>&)
205 error (
"can't perform indexing operations for %s type", nm.c_str ());
210 const std::list<octave_value_list>&,
int)
213 error (
"can't perform indexing operations for %s type", nm.c_str ());
218 const std::list<octave_value_list>& idx,
229 error (
"can't perform indexing operations for %s type", nm.c_str ());
235 std::string nm =
'<' +
type_name () +
'>';
241 const std::list<octave_value_list>& idx,
251 error (
"can't perform indexed assignment for %s type", nm.c_str ());
258 if (
type.length () == 1)
274 error (
"in indexed assignment of %s, last rhs index must be ()",
284 error (
"%s cannot be indexed with %c", nm.c_str (),
type[0]);
307 const std::list<octave_value_list>& idx,
399 (
"octave_base_value::convert_to_row_or_column_vector ()",
type_name ());
416 const std::string&
name)
const
437 const std::string&
name,
456 const std::string& )
const
458 os <<
"no info for type: " <<
type_name () <<
"\n";
461 #define INT_CONV_METHOD(T, F) \
463 octave_base_value::F ## _value (bool require_int, bool frc_str_conv) const \
471 d = double_value (frc_str_conv); \
473 catch (octave::execution_exception& e) \
475 err_wrong_type_arg (e, "octave_base_value::" #F "_value ()", type_name ()); \
478 if (require_int && octave::math::x_nint (d) != d) \
479 error_with_cfn ("conversion of %g to " #T " value failed", d); \
480 else if (d < std::numeric_limits<T>::min ()) \
481 retval = std::numeric_limits<T>::min (); \
482 else if (d > std::numeric_limits<T>::max ()) \
483 retval = std::numeric_limits<T>::max (); \
485 retval = static_cast<T> (octave::math::fix (d)); \
509 d = double_value (frc_str_conv);
511 catch (octave::execution_exception& e)
517 error (
"conversion of NaN to integer value failed");
805 return std::string ();
831 if (tmp.
numel () != 1)
832 error (
"invalid conversion of multi-dimensional struct to scalar struct");
849 std::list<std::string>
1093 (
"Octave:load-save-unavailable",
1094 "%s: loading %s files not available in this version of Octave",
1102 (
"Octave:load-save-unavailable",
1103 "%s: saving %s files not available in this version of Octave",
1134 std::map<std::string, octave_value>
m
1142 OCTAVE_NORETURN
static
1146 error (
"assignment of '%s' to indexed '%s' not implemented",
1147 tn2.c_str (), tn1.c_str ());
1150 OCTAVE_NORETURN
static
1154 error (
"type conversion for assignment of '%s' to indexed '%s' failed",
1155 tn2.c_str (), tn1.c_str ());
1158 OCTAVE_NORETURN
static
1161 const std::string& tn2)
1163 error (
"operator %s: no conversion for assignment of '%s' to indexed '%s'",
1164 on.c_str (), tn2.c_str (), tn1.c_str ());
1169 const std::list<octave_value_list>& idx,
1174 if (idx.front ().empty ())
1175 error (
"missing index in indexed assignment");
1190 f (*
this, idx.front (), rhs.
get_rep ());
1241 else if (cf_this.
type_id () >= 0
1273 if (! cf_this && ! cf_rhs)
1386 if (
retval(i).is_magic_colon ())
1395 const std::list<octave_value_list>& idx,
1396 const std::string& who)
1400 if (
len != idx.size ())
1401 error (
"invalid index for %s", who.c_str ());
1406 auto p = idx.begin ();
1408 for (
size_t i = 0; i <
len; i++)
1415 type_field(i) =
"()";
1420 type_field(i) =
"{}";
1426 type_field(i) =
".";
1430 if (vlist.
length () != 1)
1431 error (
"only single argument permitted for '.' index");
1436 error (
"string argument required for '.' index");
1438 subs_field(i) = val;
1450 m.assign (
"type", type_field);
1451 m.assign (
"subs", subs_field);
1470 return (fcn && fcn->
name () ==
"builtin");
1489 complex_matrix_conv);
1494 DEFUN (sparse_auto_mutate, args, nargout,
Vector representing the dimensions (size) of an Array.
Array< octave_idx_type > as_array(void) const
octave_idx_type ndims(void) const
Number of dimensions.
octave_function * caller_function(void) const
int lookup_pref_assign_conv(int, int)
assign_op_fcn lookup_assign_op(octave_value::assign_op, int, int)
octave_value(* assign_op_fcn)(octave_base_value &, const octave_value_list &, const octave_base_value &)
octave_base_value::type_conv_fcn lookup_widening_op(int, int)
virtual bool load_hdf5(octave_hdf5_id loc_id, const char *name)
virtual SparseMatrix sparse_matrix_value(bool=false) const
virtual type_conv_info numeric_conversion_function(void) const
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
virtual float float_value(bool=false) const
static bool beginning_of_line
virtual bool save_ascii(std::ostream &os)
octave::refcount< octave_idx_type > count
virtual int8NDArray int8_array_value(void) const
virtual FloatComplexDiagMatrix float_complex_diag_matrix_value(bool=false) const
virtual idx_vector index_vector(bool require_integers=false) const
virtual octave_value as_uint8(void) const
virtual octave_int8 int8_scalar_value(void) const
void wrong_type_arg_error(void) const
virtual octave_value as_uint32(void) const
virtual ComplexNDArray complex_array_value(bool=false) const
virtual void print_with_name(std::ostream &output_buf, const std::string &name, bool print_padding=true)
virtual octave_value fast_elem_extract(octave_idx_type n) const
virtual boolNDArray bool_array_value(bool=false) const
virtual Cell cell_value(void) const
virtual PermMatrix perm_matrix_value(void) const
virtual bool print_name_tag(std::ostream &os, const std::string &name) const
virtual octave_scalar_map scalar_map_value(void) const
virtual octave_value as_uint64(void) const
virtual octave_int32 int32_scalar_value(void) const
virtual FloatComplexNDArray float_complex_array_value(bool=false) const
virtual octave_user_script * user_script_value(bool silent=false)
virtual octave_value as_int16(void) const
virtual charNDArray char_array_value(bool=false) const
virtual Array< std::string > cellstr_value(void) const
octave_base_value *(* type_conv_fcn)(const octave_base_value &)
virtual octave_value diag(octave_idx_type k=0) const
virtual octave_idx_type nfields(void) const
virtual octave_map map_value(void) const
void indent(std::ostream &os) const
virtual octave_value permute(const Array< int > &vec, bool=false) const
virtual octave_fcn_handle * fcn_handle_value(bool silent=false)
virtual octave_value as_double(void) const
virtual charMatrix char_matrix_value(bool force=false) const
virtual octave_uint32 uint32_scalar_value(void) const
virtual bool print_as_scalar(void) const
void newline(std::ostream &os) const
virtual octave_classdef * classdef_object_value(bool silent=false)
virtual octave_idx_type nnz(void) const
virtual octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
virtual octave_value all(int=0) const
virtual octave_uint8 uint8_scalar_value(void) const
virtual sortmode is_sorted_rows(sortmode mode=UNSORTED) const
static const std::string t_name
virtual uint64NDArray uint64_array_value(void) const
virtual octave_value as_int8(void) const
virtual boolMatrix bool_matrix_value(bool=false) const
virtual octave_value as_int32(void) const
virtual FloatComplex float_complex_value(bool=false) const
virtual octave_value map(unary_mapper_t) const
virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const
virtual octave_value_list list_value(void) const
virtual mxArray * as_mxArray(void) const
virtual FloatComplexMatrix float_complex_matrix_value(bool=false) const
virtual octave_value squeeze(void) const
virtual ComplexMatrix complex_matrix_value(bool=false) const
virtual octave_int16 int16_scalar_value(void) const
virtual octave_base_value * empty_clone(void) const
virtual octave_idx_type nzmax(void) const
virtual void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
virtual octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
virtual int type_id(void) const
virtual Matrix size(void)
static int curr_print_indent_level
virtual std::string class_name(void) const
virtual octave_uint16 uint16_scalar_value(void) const
virtual uint32NDArray uint32_array_value(void) const
virtual FloatDiagMatrix float_diag_matrix_value(bool=false) const
virtual bool save_binary(std::ostream &os, bool save_as_floats)
virtual octave_value as_single(void) const
octave_value numeric_assign(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
void warn_load(const char *type) const
virtual octave_value reshape(const dim_vector &) const
virtual SparseBoolMatrix sparse_bool_matrix_value(bool=false) const
virtual string_vector parent_class_names(void) const
static const char * get_umap_name(unary_mapper_t)
virtual octave_value full_value(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 FloatNDArray float_array_value(bool=false) const
virtual Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
virtual FloatMatrix float_matrix_value(bool=false) const
virtual octave_idx_type xnumel(const octave_value_list &)
virtual DiagMatrix diag_matrix_value(bool=false) const
virtual SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
virtual dim_vector dims(void) const
virtual octave_idx_type numel(void) const
virtual octave_value as_int64(void) const
virtual bool fast_elem_insert(octave_idx_type n, const octave_value &x)
virtual octave_user_function * user_function_value(bool silent=false)
virtual bool bool_value(bool=false) const
virtual void unlock(void)
virtual octave_int64 int64_scalar_value(void) const
virtual void print_info(std::ostream &os, const std::string &prefix) const
virtual int64NDArray int64_array_value(void) const
virtual std::string xstring_value() const
virtual bool fast_elem_insert_self(void *where, builtin_type_t btyp) const
virtual ComplexDiagMatrix complex_diag_matrix_value(bool=false) const
virtual bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
virtual int32NDArray int32_array_value(void) const
virtual void print(std::ostream &os, bool pr_as_read_syntax=false)
virtual octave_value resize(const dim_vector &, bool fill=false) const
virtual int16NDArray int16_array_value(void) const
virtual void convert_to_row_or_column_vector(void)
virtual octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) 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 MatrixType matrix_type(void) const
virtual std::list< std::string > parent_class_name_list(void) const
virtual std::string type_name(void) const
virtual NDArray array_value(bool=false) const
virtual octave_uint64 uint64_scalar_value(void) const
virtual std::string string_value(bool force=false) 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 uint8NDArray uint8_array_value(void) const
virtual uint16NDArray uint16_array_value(void) 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 Matrix matrix_value(bool=false) const
virtual octave_value as_uint16(void) const
virtual sortmode issorted(sortmode mode=UNSORTED) const
virtual octave_value dump(void) const
virtual octave_function * function_value(bool silent=false)
virtual string_vector string_vector_value(bool pad=false) const
virtual size_t nparents(void) const
friend class octave_value
virtual octave_value any(int=0) const
virtual string_vector map_keys(void) const
virtual bool isnumeric(void) const
virtual bool is_defined(void) const
virtual Range range_value(void) const
virtual Complex complex_value(bool=false) const
void warn_save(const char *type) const
std::string name(void) const
octave_scalar_map checkelem(octave_idx_type n) const
octave_idx_type numel(void) const
octave_idx_type length(void) const
const octave_base_value & get_rep(void) const
charMatrix char_matrix_value(bool frc_str_conv=false) const
octave_base_value::type_conv_info numeric_conversion_function(void) const
static octave_value empty_conv(const std::string &type, const octave_value &rhs=octave_value())
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)
bool is_string(void) const
std::string string_value(bool force=false) const
string_vector string_vector_value(bool pad=false) const
octave_base_value * clone(void) const
std::string type_name(void) const
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
#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(const char *fmt,...)
#define panic_impossible()
void err_wrong_type_arg(const char *name, const char *s)
void err_invalid_conversion(const std::string &from, const std::string &to)
void warn_implicit_conversion(const char *id, const char *from, const char *to)
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
F77_RET_T const F77_DBLE * x
F77_RET_T const F77_DBLE const F77_DBLE * f
void err_invalid_index(const std::string &idx, octave_idx_type nd, octave_idx_type dim, const std::string &)
type_info & __get_type_info__(const std::string &who)
tree_evaluator & __get_evaluator__(const std::string &who)
octave_idx_type dims_to_numel(const dim_vector &dims, const octave_value_list &idx_arg)
std::complex< double > Complex
std::complex< float > FloatComplex
#define INSTALL_ASSIGNCONV_TI(ti, t1, t2, tr)
#define INSTALL_WIDENOP_TI(ti, t1, t2, f)
static octave_base_value * oct_conv_string_conv(const octave_base_value &)
void install_base_type_conversions(octave::type_info &ti)
static OCTAVE_NORETURN void err_indexed_assignment(const std::string &tn1, const std::string &tn2)
static octave_base_value * oct_conv_complex_matrix_conv(const octave_base_value &)
static octave_base_value * oct_conv_matrix_conv(const octave_base_value &)
std::string btyp_class_name[btyp_num_types]
static octave_base_value * oct_conv_cell_conv(const octave_base_value &)
octave_value make_idx_args(const std::string &type, const std::list< octave_value_list > &idx, const std::string &who)
static octave_value_list sanitize(const octave_value_list &ovl)
static OCTAVE_NORETURN void err_assign_conversion_failed(const std::string &tn1, const std::string &tn2)
bool called_from_builtin(void)
builtin_type_t btyp_mixed_numeric(builtin_type_t x, builtin_type_t y)
Determine the resulting type for a possible mixed-type operation.
static OCTAVE_NORETURN void err_no_conversion(const std::string &on, const std::string &tn1, const std::string &tn2)
#define INT_CONV_METHOD(T, F)
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
octave_value::octave_value(const Array< char > &chm, char type) return retval
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
#define SET_INTERNAL_VARIABLE(NM)