24 #if defined (HAVE_CONFIG_H) 89 "double",
"single",
"double",
"single",
90 "int8",
"int16",
"int32",
"int64",
91 "uint8",
"uint16",
"uint32",
"uint64",
93 "struct",
"cell",
"function_handle" 97 "<unknown type>",
"unknown");
113 error (
"squeeze: invalid operation for %s type",
nm.c_str ());
200 const std::list<octave_value_list>&)
203 error (
"can't perform indexing operations for %s type",
nm.c_str ());
208 const std::list<octave_value_list>&,
int)
211 error (
"can't perform indexing operations for %s type",
nm.c_str ());
216 const std::list<octave_value_list>& idx,
227 error (
"can't perform indexing operations for %s type",
nm.c_str ());
239 const std::list<octave_value_list>& idx,
249 error (
"can't perform indexed assignment for %s type",
nm.c_str ());
256 if (
type.length () == 1)
272 error (
"in indexed assignment of %s, last rhs index must be ()",
282 error (
"%s cannot be indexed with %c",
nm.c_str (),
type[0]);
305 const std::list<octave_value_list>& idx,
397 (
"octave_base_value::convert_to_row_or_column_vector ()",
type_name ());
456 os <<
"no info for type: " <<
type_name () <<
"\n";
459 #define INT_CONV_METHOD(T, F) \ 461 octave_base_value::F ## _value (bool require_int, bool frc_str_conv) const \ 469 d = double_value (frc_str_conv); \ 471 catch (octave::execution_exception& e) \ 473 err_wrong_type_arg (e, "octave_base_value::" #F "_value ()", type_name ()); \ 476 if (require_int && octave::math::x_nint (d) != d) \ 477 error_with_cfn ("conversion of %g to " #T " value failed", d); \ 478 else if (d < std::numeric_limits<T>::min ()) \ 479 retval = std::numeric_limits<T>::min (); \ 480 else if (d > std::numeric_limits<T>::max ()) \ 481 retval = std::numeric_limits<T>::max (); \ 483 retval = static_cast<T> (octave::math::fix (d)); \ 509 catch (octave::execution_exception&
e)
515 error (
"conversion of NaN to integer value failed");
624 return tmp.char_matrix_value ();
787 return tmp.string_vector_value ();
795 return tmp.string_value ();
829 if (
tmp.numel () != 1)
830 error (
"invalid conversion of multi-dimensional struct to scalar struct");
847 std::list<std::string>
1100 (
"Octave:load-save-unavailable",
1101 "%s: loading %s files not available in this version of Octave",
1109 (
"Octave:load-save-unavailable",
1110 "%s: saving %s files not available in this version of Octave",
1141 std::map<std::string, octave_value> m
1149 OCTAVE_NORETURN
static 1153 error (
"assignment of '%s' to indexed '%s' not implemented",
1154 tn2.c_str (), tn1.c_str ());
1157 OCTAVE_NORETURN
static 1161 error (
"type conversion for assignment of '%s' to indexed '%s' failed",
1162 tn2.c_str (), tn1.c_str ());
1165 OCTAVE_NORETURN
static 1170 error (
"operator %s: no conversion for assignment of '%s' to indexed '%s'",
1171 on.c_str (), tn2.c_str (), tn1.c_str ());
1176 const std::list<octave_value_list>& idx,
1181 if (idx.front ().empty ())
1182 error (
"missing index in indexed assignment");
1197 f (*
this, idx.front (), rhs.
get_rep ());
1248 else if (cf_this.
type_id () >= 0
1280 if (! cf_this && ! cf_rhs)
1402 const std::list<octave_value_list>& idx,
1405 size_t len =
type.length ();
1407 if (len != idx.size ())
1408 error (
"invalid index for %s", who.c_str ());
1410 Cell type_field (1, len);
1411 Cell subs_field (1, len);
1413 std::list<octave_value_list>::const_iterator
p = idx.begin ();
1415 for (
size_t i = 0;
i < len;
i++)
1422 type_field(
i) =
"()";
1427 type_field(
i) =
"{}";
1433 type_field(
i) =
".";
1437 if (vlist.
length () != 1)
1438 error (
"only single argument permitted for '.' index");
1442 if (!
val.is_string ())
1443 error (
"string argument required for '.' index");
1445 subs_field(
i) =
val;
1457 m.
assign (
"type", type_field);
1458 m.
assign (
"subs", subs_field);
1495 complex_matrix_conv);
double double_value(bool=false) const
virtual octave_value as_int64(void) const
bool called_from_builtin(void)
virtual octave_value as_double(void) const
virtual octave_value reshape(const dim_vector &) const
void warning_with_id(const char *id, const char *fmt,...)
virtual octave_int16 int16_scalar_value(void) const
octave_base_value * clone(void) const
virtual ComplexDiagMatrix complex_diag_matrix_value(bool=false) const
virtual octave_uint32 uint32_scalar_value(void) const
virtual octave_fcn_handle * fcn_handle_value(bool silent=false)
virtual bool save_binary(std::ostream &os, bool &save_as_floats)
virtual SparseMatrix sparse_matrix_value(bool=false) const
void assign(const std::string &k, const Cell &val)
virtual int8NDArray int8_array_value(void) const
octave_value numeric_assign(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
virtual octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
identity matrix If supplied two scalar respectively For allows like xample val
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE * f
virtual ComplexNDArray complex_array_value(bool=false) const
virtual octave_value as_uint32(void) const
virtual SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
virtual FloatDiagMatrix float_diag_matrix_value(bool=false) const
virtual octave_uint64 uint64_scalar_value(void) const
void newline(std::ostream &os) const
octave_base_value::type_conv_fcn lookup_widening_op(int, int)
virtual FloatComplex float_complex_value(bool=false) const
virtual void unlock(void)
virtual ComplexMatrix complex_matrix_value(bool=false) const
virtual uint16NDArray uint16_array_value(void) const
virtual uint8NDArray uint8_array_value(void) const
virtual int type_id(void) const
static octave_base_value * oct_conv_complex_matrix_conv(const octave_base_value &)
virtual bool print_name_tag(std::ostream &os, const std::string &name) const
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
OCTINTERP_API octave_idx_type dims_to_numel(const dim_vector &dims, const octave_value_list &idx)
void err_invalid_index(const std::string &idx, octave_idx_type nd, octave_idx_type dim, const std::string &)
void error(const char *fmt,...)
#define SET_INTERNAL_VARIABLE(NM)
bool is_magic_colon(void) const
#define INT_CONV_METHOD(T, F)
virtual octave_value permute(const Array< int > &vec, bool=false) const
void install_base_type_conversions(octave::type_info &ti)
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
virtual bool fast_elem_insert(octave_idx_type n, const octave_value &x)
virtual Cell cell_value(void) const
static std::string assign_op_as_string(assign_op)
virtual octave_value resize(const dim_vector &, bool fill=false) const
const octave_base_value & get_rep(void) const
virtual std::list< std::string > parent_class_name_list(void) const
virtual dim_vector dims(void) const
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
virtual SparseBoolMatrix sparse_bool_matrix_value(bool=false) const
virtual bool isnumeric(void) const
virtual bool save_ascii(std::ostream &os)
virtual octave_int32 int32_scalar_value(void) const
static const char * get_umap_name(unary_mapper_t)
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
virtual octave_value as_uint8(void) const
virtual octave_value map(unary_mapper_t) const
virtual octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
virtual int32NDArray int32_array_value(void) const
virtual void print(std::ostream &os, bool pr_as_read_syntax=false)
virtual Range range_value(void) const
virtual Array< std::string > cellstr_value(void) const
void warn_load(const char *type) const
octave_value(* assign_op_fcn)(octave_base_value &, const octave_value_list &, const octave_base_value &)
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
static int curr_print_indent_level
virtual octave_idx_type nzmax(void) const
virtual octave_map map_value(void) const
virtual octave_value undef_subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
assign_op_fcn lookup_assign_op(octave_value::assign_op, int, int)
virtual octave_fcn_inline * fcn_inline_value(bool silent=false)
virtual octave_value as_uint16(void) const
builtin_type_t btyp_mixed_numeric(builtin_type_t x, builtin_type_t y)
Determine the resulting type for a possible mixed-type operation.
virtual octave_value any(int=0) const
nd deftypefn *std::string name
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
virtual sortmode is_sorted_rows(sortmode mode=UNSORTED) const
virtual octave_user_function * user_function_value(bool silent=false)
virtual octave_value full_value(void) const
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
virtual octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
type_info & __get_type_info__(const std::string &who)
virtual octave_value_list list_value(void) const
virtual octave_idx_type nnz(void) const
virtual NDArray array_value(bool=false) const
octave_function * caller(void) const
int lookup_pref_assign_conv(int, int)
std::string btyp_class_name[btyp_num_types]
virtual float_display_format get_edit_display_format(void) const
virtual DiagMatrix diag_matrix_value(bool=false) const
virtual octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
virtual std::string xstring_value() const
static octave_base_value * oct_conv_string_conv(const octave_base_value &)
virtual bool fast_elem_insert_self(void *where, builtin_type_t btyp) const
virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const
static const std::string t_name
virtual string_vector parent_class_names(void) const
std::string type_name(void) const
Array< octave_idx_type > as_array(void) const
virtual sortmode issorted(sortmode mode=UNSORTED) const
static octave_base_value * oct_conv_cell_conv(const octave_base_value &)
virtual octave_uint8 uint8_scalar_value(void) const
#define panic_impossible()
virtual string_vector string_vector_value(bool pad=false) const
virtual mxArray * as_mxArray(void) const
virtual Complex complex_value(bool=false) const
virtual octave_idx_type numel(void) const
virtual octave_value dump(void) const
void warn_save(const char *type) const
virtual int nint_value(bool=false) const
virtual bool print_as_scalar(void) const
static OCTAVE_NORETURN void err_no_conversion(const std::string &on, const std::string &tn1, const std::string &tn2)
virtual FloatMatrix float_matrix_value(bool=false) const
virtual float float_value(bool=false) const
virtual bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
virtual Matrix size(void)
virtual octave_user_code * user_code_value(bool silent=false)
virtual bool load_hdf5(octave_hdf5_id loc_id, const char *name)
virtual void convert_to_row_or_column_vector(void)
virtual idx_vector index_vector(bool require_integers=false) const
void err_wrong_type_arg(const char *name, const char *s)
void indent(std::ostream &os) const
virtual type_conv_info numeric_conversion_function(void) const
friend class octave_value
virtual octave_value as_int32(void) const
virtual octave_idx_type nfields(void) const
virtual octave_value diag(octave_idx_type k=0) const
octave_base_value::type_conv_info numeric_conversion_function(void) const
#define INSTALL_ASSIGNCONV_TI(ti, t1, t2, tr)
virtual FloatNDArray float_array_value(bool=false) const
virtual octave_value fast_elem_extract(octave_idx_type n) const
virtual FloatComplexMatrix float_complex_matrix_value(bool=false) const
virtual octave_value squeeze(void) const
virtual int64NDArray int64_array_value(void) const
octave_value make_idx_args(const std::string &type, const std::list< octave_value_list > &idx, const std::string &who)
virtual bool load_ascii(std::istream &is)
void err_invalid_conversion(const std::string &from, const std::string &to)
static OCTAVE_NORETURN void err_assign_conversion_failed(const std::string &tn1, const std::string &tn2)
virtual octave_uint16 uint16_scalar_value(void) const
virtual octave_int8 int8_scalar_value(void) const
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).isinteger())
virtual std::string class_name(void) const
static octave_value_list sanitize(const octave_value_list &ovl)
virtual octave_classdef * classdef_object_value(bool silent=false)
virtual Matrix matrix_value(bool=false) const
virtual octave_value as_single(void) const
virtual int16NDArray int16_array_value(void) const
virtual octave_value all(int=0) const
virtual size_t nparents(void) const
virtual FloatComplexDiagMatrix float_complex_diag_matrix_value(bool=false) const
call_stack & __get_call_stack__(const std::string &who)
void warn_implicit_conversion(const char *id, const char *from, const char *to)
virtual uint32NDArray uint32_array_value(void) const
virtual octave_value as_uint64(void) const
virtual bool is_defined(void) const
octave_idx_type length(void) const
virtual boolMatrix bool_matrix_value(bool=false) const
static OCTAVE_NORETURN void err_indexed_assignment(const std::string &tn1, const std::string &tn2)
virtual std::string type_name(void) const
the element is set to zero In other the statement xample y
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
octave::refcount< octave_idx_type > count
virtual octave_value as_int16(void) const
static octave_base_value * oct_conv_matrix_conv(const octave_base_value &)
virtual PermMatrix perm_matrix_value(void) const
std::complex< float > FloatComplex
octave_idx_type ndims(void) const
Number of dimensions.
std::complex< double > Complex
virtual void print_info(std::ostream &os, const std::string &prefix) const
virtual octave_function * function_value(bool silent=false)
virtual octave_int64 int64_scalar_value(void) const
virtual bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
static bool beginning_of_line
#define INSTALL_WIDENOP_TI(ti, t1, t2, f)
virtual void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Vector representing the dimensions (size) of an Array.
std::string name(void) const
virtual charNDArray char_array_value(bool=false) const
virtual string_vector map_keys(void) const
std::string type_name(void) const
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
virtual uint64NDArray uint64_array_value(void) const
virtual octave_user_script * user_script_value(bool silent=false)
virtual void print_with_name(std::ostream &output_buf, const std::string &name, bool print_padding=true)
octave_base_value *(* type_conv_fcn)(const octave_base_value &)
virtual Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
void wrong_type_arg_error(void) const
virtual MatrixType matrix_type(void) const
virtual charMatrix char_matrix_value(bool force=false) const
virtual boolNDArray bool_array_value(bool=false) const
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE * x
static octave_value empty_conv(const std::string &type, const octave_value &rhs=octave_value())
virtual octave_value as_int8(void) const
virtual std::string string_value(bool force=false) const
virtual FloatComplexNDArray float_complex_array_value(bool=false) const
virtual octave_base_value * empty_clone(void) const
virtual double double_value(bool=false) const
virtual octave_scalar_map scalar_map_value(void) const
virtual bool bool_value(bool=false) const