23 #if !defined (octave_ov_range_h)
24 #define octave_ov_range_h 1
62 if (range.nelem () < 0)
63 ::
error (
"invalid range");
69 if (range.nelem () < 0 && range.nelem () != -2)
70 ::
error (
"invalid range");
75 idx_cache (r.idx_cache ? new
idx_vector (*r.idx_cache) : 0)
81 set_idx_cache (cache);
93 type_conv_info numeric_conversion_function (
void)
const;
98 const std::list<octave_value_list>& idx);
101 const std::list<octave_value_list>& idx,
int)
102 {
return subsref (type, idx); }
105 bool resize_ok =
false);
121 {
return NDArray (array_value ().reshape (new_dims)); }
124 {
return NDArray (array_value ().permute (vec, inv)); }
145 {
return range.
sort (dim, mode); }
149 {
return range.
sort (sidx, dim, mode); }
172 double double_value (
bool =
false)
const;
174 float float_value (
bool =
false)
const;
176 double scalar_value (
bool frc_str_conv =
false)
const
177 {
return double_value (frc_str_conv); }
179 float float_scalar_value (
bool frc_str_conv =
false)
const
180 {
return float_value (frc_str_conv); }
183 {
return range.matrix_value (); }
186 {
return range.matrix_value (); }
230 Complex complex_value (
bool =
false)
const;
234 boolNDArray bool_array_value (
bool warn =
false)
const;
250 octave_value convert_to_str_internal (
bool pad,
bool force,
char type)
const;
252 void print (std::ostream& os,
bool pr_as_read_syntax =
false)
const;
254 void print_raw (std::ostream& os,
bool pr_as_read_syntax =
false)
const;
256 bool print_name_tag (std::ostream& os,
const std::string& name)
const;
258 void short_disp (std::ostream& os)
const;
260 bool save_ascii (std::ostream& os);
262 bool load_ascii (std::istream& is);
264 bool save_binary (std::ostream& os,
bool& save_as_floats);
266 bool load_binary (std::istream& is,
bool swap,
269 #if defined (HAVE_HDF5)
270 bool save_hdf5 (hid_t loc_id,
const char *name,
bool save_as_floats);
272 bool load_hdf5 (hid_t loc_id,
const char *name);
282 return os.
write (matrix_value (), block_size, output_type, skip, flt_fmt);
285 mxArray *as_mxArray (
void)
const;
304 void clear_cached_info (
void)
const
306 delete idx_cache; idx_cache = 0;