23 #if !defined (octave_ov_range_h)
24 #define octave_ov_range_h 1
61 if (range.nelem () < 0)
62 ::
error (
"invalid range");
68 if (range.nelem () < 0 && range.nelem () != -2)
69 ::
error (
"invalid range");
74 idx_cache (r.idx_cache ? new
idx_vector (*r.idx_cache) : 0)
80 set_idx_cache (cache);
92 type_conv_info numeric_conversion_function (
void)
const;
97 const std::list<octave_value_list>& idx);
100 const std::list<octave_value_list>& idx,
int)
101 {
return subsref (type, idx); }
104 bool resize_ok =
false);
106 idx_vector index_vector (
bool require_integers =
false)
const;
120 {
return NDArray (array_value ().reshape (new_dims)); }
123 {
return NDArray (array_value ().permute (vec, inv)); }
144 {
return range.
sort (dim, mode); }
148 {
return range.
sort (sidx, dim, mode); }
151 {
return range.is_sorted (mode); }
171 double double_value (
bool =
false)
const;
173 float float_value (
bool =
false)
const;
176 {
return double_value (frc_str_conv); }
179 {
return float_value (frc_str_conv); }
182 {
return range.matrix_value (); }
185 {
return range.matrix_value (); }
188 {
return range.matrix_value (); }
229 Complex complex_value (
bool =
false)
const;
233 boolNDArray bool_array_value (
bool warn =
false)
const;
249 octave_value convert_to_str_internal (
bool pad,
bool force,
char type)
const;
251 void print (std::ostream& os,
bool pr_as_read_syntax =
false);
253 void print_raw (std::ostream& os,
bool pr_as_read_syntax =
false)
const;
255 bool print_name_tag (std::ostream& os,
const std::string& name)
const;
257 void short_disp (std::ostream& os)
const;
259 bool save_ascii (std::ostream& os);
261 bool load_ascii (std::istream& is);
263 bool save_binary (std::ostream& os,
bool& save_as_floats);
265 bool load_binary (std::istream& is,
bool swap,
268 bool save_hdf5 (
octave_hdf5_id loc_id,
const char *name,
bool save_as_floats);
279 return os.
write (matrix_value (), block_size, output_type, skip, flt_fmt);
282 mxArray *as_mxArray (
void)
const;
305 delete idx_cache; idx_cache = 0;
FloatMatrix float_matrix_value(bool=false) const
bool is_true(const std::string &s)
intNDArray< octave_int64 > int64NDArray
float float_scalar_value(bool frc_str_conv=false) const
dim_vector dims(void) const
int8NDArray int8_array_value(void) const
Range range_value(void) const
octave_value permute(const Array< int > &vec, bool inv=false) const
uint8NDArray uint8_array_value(void) const
uint64NDArray uint64_array_value(void) const
octave_value full_value(void) const
NDArray array_value(bool=false) const
intNDArray< octave_uint32 > uint32NDArray
intNDArray< octave_uint8 > uint8NDArray
intNDArray< octave_uint16 > uint16NDArray
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
Array< octave_idx_type > sort_rows_idx(sortmode) const
sortmode is_sorted(sortmode mode=UNSORTED) const
void error(const char *fmt,...)
int64NDArray int64_array_value(void) const
int write(octave_stream &os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
builtin_type_t builtin_type(void) const
octave_base_value * clone(void) const
octave_range(const Range &r, const idx_vector &cache)
bool is_float_type(void) const
bool is_range(void) const
SparseMatrix sparse_matrix_value(bool=false) const
uint32NDArray uint32_array_value(void) const
bool is_numeric_type(void) const
intNDArray< octave_int16 > int16NDArray
octave_range(const Range &r)
octave_value squeeze(void) const
double scalar_value(bool frc_str_conv=false) const
uint16NDArray uint16_array_value(void) const
void clear_cached_info(void) const
bool is_constant(void) const
int32NDArray int32_array_value(void) const
octave_range(const octave_range &r)
octave_value map(unary_mapper_t umap) const
bool is_defined(void) const
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
intNDArray< octave_int8 > int8NDArray
FloatNDArray float_array_value(bool=false) const
Matrix matrix_value(bool=false) const
static void cache(const std::string key, str_llist_type *value)
size_t byte_size(void) const
bool is_real_type(void) const
int16NDArray int16_array_value(void) const
Matrix matrix_value(bool frc_str_conv=false) const
octave_range(double base, double limit, double inc)
octave_base_value * empty_clone(void) const
FloatComplexNDArray float_complex_array_value(bool=false) const
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
intNDArray< octave_int32 > int32NDArray
octave_value reshape(const dim_vector &new_dims) const
octave_idx_type write(const octave_value &data, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, oct_mach_info::float_format flt_fmt)
octave_value map(unary_mapper_t umap) const
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
ComplexNDArray complex_array_value(bool=false) const
std::complex< float > FloatComplex
bool is_double_type(void) const
std::complex< double > Complex
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int)
ComplexMatrix complex_matrix_value(bool=false) const
tree_walker & operator=(const tree_walker &)
octave_value sort(Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
intNDArray< octave_uint64 > uint64NDArray
idx_vector set_idx_cache(const idx_vector &idx) const