23 #if defined (HAVE_CONFIG_H)
108 const std::list<octave_value_list>& idx)
122 error (
"%s cannot be indexed with %c", nm.c_str (), type[0]);
136 if (idx.
length () == 1 && ! resize_ok)
177 || ! Vallow_noninteger_range_as_index
183 "non-integer range used as index");
199 "range",
"real scalar");
213 "range",
"real scalar");
227 retval.
elem (
i) =
static_cast<char>(matrix.
elem (
i));
266 return mat.
diag (m, n);
282 double base = r.
base ();
283 double limit = r.
limit ();
286 if (((base > 0 && limit > 0) || (base < 0 && limit < 0)) &&
numel () > 0)
316 "range",
"complex scalar");
334 "range",
"complex scalar");
369 return tmp.convert_to_str (pad, force, type);
455 if (n == 0 || n == 1)
499 if (c ==
' ' || c ==
'\t' || c ==
'\n')
512 double base = r.
base ();
513 double limit = r.
limit ();
514 double inc = r.
inc ();
518 os <<
"# base, limit, increment\n";
520 os <<
"# base, length, increment\n";
541 double base, limit, inc;
542 is >> base >> limit >> inc;
545 error (
"load: failed to load range constant");
550 range =
Range (base, inc, static_cast<octave_idx_type> (limit));
559 os.write (reinterpret_cast<char *> (&tmp), 1);
561 double bas = r.
base ();
562 double lim = r.
limit ();
563 double inc = r.
inc ();
567 os.write (reinterpret_cast<char *> (&bas), 8);
568 os.write (reinterpret_cast<char *> (&lim), 8);
569 os.write (reinterpret_cast<char *> (&inc), 8);
579 if (! is.read (reinterpret_cast<char *> (&tmp), 1))
581 double bas, lim, inc;
582 if (! is.read (reinterpret_cast<char *> (&bas), 8))
586 if (! is.read (reinterpret_cast<char *> (&lim), 8))
590 if (! is.read (reinterpret_cast<char *> (&inc), 8))
597 range =
Range (bas, inc, static_cast<octave_idx_type> (lim));
602 #if defined (HAVE_HDF5)
613 hid_t type_id = H5Tcreate (H5T_COMPOUND,
sizeof (
double) * 3);
615 H5Tinsert (type_id,
"base", 0 *
sizeof (
double), num_type);
616 H5Tinsert (type_id,
"limit", 1 *
sizeof (
double), num_type);
617 H5Tinsert (type_id,
"increment", 2 *
sizeof (
double), num_type);
630 #if defined (HAVE_HDF5)
633 hid_t space_hid, type_hid, data_hid;
634 space_hid = type_hid = data_hid = -1;
636 space_hid = H5Screate_simple (0, dimens, 0);
637 if (space_hid < 0)
return false;
642 H5Sclose (space_hid);
645 #if defined (HAVE_HDF5_18)
646 data_hid = H5Dcreate (loc_id, name, type_hid, space_hid,
653 H5Sclose (space_hid);
659 double range_vals[3];
660 range_vals[0] = r.
base ();
662 range_vals[2] = r.
inc ();
670 "OCTAVE_RANGE_NELEM", &nel) >= 0;
677 H5Sclose (space_hid);
680 octave_unused_parameter (loc_id);
681 octave_unused_parameter (name);
694 #if defined (HAVE_HDF5)
696 #if defined (HAVE_HDF5_18)
699 hid_t data_hid = H5Dopen (loc_id, name);
701 hid_t type_hid = H5Dget_type (data_hid);
707 H5Tclose (range_type);
712 hid_t space_hid = H5Dget_space (data_hid);
713 hsize_t rank = H5Sget_simple_extent_ndims (space_hid);
717 H5Tclose (range_type);
718 H5Sclose (space_hid);
731 "OCTAVE_RANGE_NELEM", &nel))
732 range =
Range (rangevals[0], rangevals[2], nel);
735 if (rangevals[2] != 0)
736 range =
Range (rangevals[0], rangevals[1], rangevals[2]);
739 static_cast<octave_idx_type> (rangevals[1]));
743 H5Tclose (range_type);
744 H5Sclose (space_hid);
748 octave_unused_parameter (loc_id);
749 octave_unused_parameter (name);
762 double *pr =
static_cast<double *
> (retval->
get_data ());
768 const double *
p = m.
data ();
800 static bool warned =
false;
805 "allow_noninteger_range_as_index is obsolete and will be removed from a future version of Octave");
Matrix diag(octave_idx_type k=0) const
void octave_write_double(std::ostream &os, double d)
type_conv_info numeric_conversion_function(void) const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
void warning_with_id(const char *id, const char *fmt,...)
octave_value convert_to_str_internal(bool pad, bool force, char type) const
static hid_t hdf5_make_range_type(hid_t num_type)
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
octave_hdf5_err hdf5_add_scalar_attr(octave_hdf5_id loc_id, octave_hdf5_id type_id, const char *attr_name, void *buf)
mxArray * as_mxArray(void) const
intNDArray< octave_int64 > int64NDArray
boolMatrix any(int dim=-1) const
dim_vector dims(void) const
Range range_value(void) const
static void skip_comments(std::istream &is)
void warn_logical_conversion(void)
const octave_hdf5_id octave_H5S_ALL
void set_pos_if_unset(octave_idx_type nd_arg, octave_idx_type dim_arg)
NDArray array_value(bool=false) const
octave_idx_type length(void) const
intNDArray< octave_uint32 > uint32NDArray
intNDArray< octave_uint8 > uint8NDArray
intNDArray< octave_uint16 > uint16NDArray
void skip_until_newline(std::istream &is, bool keep_newline)
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the then the first element defines the pivoting tolerance for the unsymmetric the values defined such that for full matrix
charNDArray char_array_value(bool=false) const
void swap_bytes< 8 >(void *ptr)
#define DEFUN(name, args_name, nargout_name, doc)
std::string type_name(void) const
void error(const char *fmt,...)
octave_base_value * try_narrowing_conversion(void)
#define SET_INTERNAL_VARIABLE(NM)
float float_value(bool=false) const
void indent(std::ostream &os) const
bool load_ascii(std::istream &is)
void * get_data(void) const
bool save_binary(std::ostream &os, bool &save_as_floats)
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
T & elem(octave_idx_type n)
octave_value as_int8(void) const
octave_value as_uint16(void) const
intNDArray< octave_int16 > int16NDArray
bool any_element_is_nan(void) const
void err_nan_to_logical_conversion(void)
void newline(std::ostream &os) const
static octave_base_value * default_numeric_conversion_function(const octave_base_value &a)
double double_value(bool=false) const
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
bool hdf5_get_scalar_attr(octave_hdf5_id loc_id, octave_hdf5_id type_id, const char *attr_name, void *buf)
bool save_ascii(std::ostream &os)
virtual octave_idx_type numel(void) const
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
octave_value any(int dim=0) const
bool any_element_not_one_or_zero(void) const
void warn_load(const char *type) const
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
octave_value as_int32(void) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
octave_value as_double(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)
intNDArray< octave_int8 > int8NDArray
octave_value as_int64(void) const
void short_disp(std::ostream &os) const
nd deftypefn *octave_map m
octave_value fast_elem_extract(octave_idx_type n) const
bool hdf5_types_compatible(octave_hdf5_id t1, octave_hdf5_id t2)
static int static_type_id(void)
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
octave_idx_type numel(void) const
const T * data(void) const
bool is_empty(void) const
Matrix diag(octave_idx_type k=0) const
Matrix matrix_value(bool=false) const
octave_value as_int16(void) const
void resize(const dim_vector &dv, const T &rfv)
double elem(octave_idx_type i) const
octave_value as_uint32(void) const
#define panic_impossible()
Matrix matrix_value(void) const
bool print_name_tag(std::ostream &os, const std::string &name) const
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
octave_value as_uint64(void) const
boolNDArray bool_array_value(bool warn=false) const
float lo_ieee_float_nan_value(void)
void warn_save(const char *type) const
friend class octave_value
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
Array< double > index(const idx_vector &i) const
intNDArray< octave_int32 > int32NDArray
void err_invalid_conversion(const std::string &from, const std::string &to)
=val(i)}if ode{val(i)}occurs in table i
boolMatrix all(int dim=-1) const
int current_print_indent_level(void) const
void octave_print_internal(std::ostream &, char, bool)
void warn_implicit_conversion(const char *id, const char *from, const char *to)
bool is_scalar(void) const
void print(std::ostream &os, bool pr_as_read_syntax=false)
bool all_elements_are_ints(void) const
idx_vector index_vector(bool require_integers=false) const
octave_value as_single(void) const
static bool Vallow_noninteger_range_as_index
void warn_array_as_logical(const dim_vector &dv)
octave_value resize(const dim_vector &dv, bool fill=false) const
const octave_hdf5_id octave_H5P_DEFAULT
bool is_empty(void) const
std::complex< float > FloatComplex
std::complex< double > Complex
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
FloatComplex float_complex_value(bool=false) const
write the output to stdout if nargout is
Vector representing the dimensions (size) of an Array.
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
octave_value diag(octave_idx_type k=0) const
octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, size_t skip=1)
octave_value as_uint8(void) const
Complex complex_value(bool=false) const
octave_value all(int dim=0) const
intNDArray< octave_uint64 > uint64NDArray
idx_vector set_idx_cache(const idx_vector &idx) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)