26 #if ! defined (octave_ov_range_h)
27 #define octave_ov_range_h 1
29 #include "octave-config.h"
64 if (range.numel () < 0)
65 error (
"invalid range");
71 if (range.numel () < 0 && range.numel () != -2)
72 error (
"invalid range");
77 idx_cache (
r.idx_cache ? new
idx_vector (*
r.idx_cache) : nullptr)
83 set_idx_cache (cache);
95 type_conv_info numeric_conversion_function (
void)
const;
105 const std::list<octave_value_list>& idx);
108 const std::list<octave_value_list>& idx,
int)
109 {
return subsref (
type, idx); }
112 bool resize_ok =
false);
114 idx_vector index_vector (
bool require_integers =
false)
const;
126 size_t byte_size (
void)
const {
return 3 *
sizeof (double); }
153 {
return range.
sort (dim, mode); }
157 {
return range.
sort (sidx, dim, mode); }
160 {
return range.issorted (mode); }
170 bool isreal (
void)
const {
return true; }
180 double double_value (
bool =
false)
const;
182 float float_value (
bool =
false)
const;
185 {
return double_value (frc_str_conv); }
188 {
return float_value (frc_str_conv); }
191 {
return range.matrix_value (); }
194 {
return range.matrix_value (); }
197 {
return range.matrix_value (); }
238 Complex complex_value (
bool =
false)
const;
242 boolNDArray bool_array_value (
bool warn =
false)
const;
258 octave_value convert_to_str_internal (
bool pad,
bool force,
char type)
const;
273 void print (std::ostream& os,
bool pr_as_read_syntax =
false);
275 void print_raw (std::ostream& os,
bool pr_as_read_syntax =
false)
const;
277 bool print_name_tag (std::ostream& os,
const std::string&
name)
const;
279 void short_disp (std::ostream& os)
const;
286 bool save_ascii (std::ostream& os);
288 bool load_ascii (std::istream& is);
290 bool save_binary (std::ostream& os,
bool save_as_floats);
292 bool load_binary (std::istream& is,
bool swap,
306 return os.
write (matrix_value (), block_size, output_type, skip, flt_fmt);
309 mxArray * as_mxArray (
void)
const;
326 idx_cache = (idx ?
new idx_vector (idx) :
nullptr);
332 delete idx_cache; idx_cache =
nullptr;
template class OCTAVE_API Array< octave_idx_type >
Vector representing the dimensions (size) of an Array.
octave_idx_type write(const octave_value &data, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, mach_info::float_format flt_fmt)
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
double scalar_value(bool frc_str_conv=false) const
octave_value map(unary_mapper_t umap) const
FloatNDArray float_array_value(bool=false) const
bool is_defined(void) const
octave_value reshape(const dim_vector &new_dims) const
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
dim_vector dims(void) const
octave_value squeeze(void) const
octave_value sort(Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
uint8NDArray uint8_array_value(void) const
int8NDArray int8_array_value(void) const
builtin_type_t builtin_type(void) const
octave_value full_value(void) const
int64NDArray int64_array_value(void) const
size_t byte_size(void) const
int32NDArray int32_array_value(void) const
octave_range(double base, double limit, double inc)
SparseMatrix sparse_matrix_value(bool=false) const
bool is_constant(void) const
octave_base_value * empty_clone(void) const
void clear_cached_info(void) const
uint32NDArray uint32_array_value(void) const
ComplexMatrix complex_matrix_value(bool=false) const
uint64NDArray uint64_array_value(void) const
int16NDArray int16_array_value(void) const
uint16NDArray uint16_array_value(void) const
sortmode issorted(sortmode mode=UNSORTED) const
idx_vector set_idx_cache(const idx_vector &idx) const
octave_range(const Range &r)
float float_scalar_value(bool frc_str_conv=false) const
NDArray array_value(bool=false) const
octave_range(const Range &r, const idx_vector &cache)
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
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_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int)
bool isnumeric(void) const
bool is_double_type(void) const
bool is_range(void) const
Matrix matrix_value(bool=false) const
octave_base_value * clone(void) const
FloatComplexNDArray float_complex_array_value(bool=false) const
FloatMatrix float_matrix_value(bool=false) const
Array< octave_idx_type > sort_rows_idx(sortmode) const
octave_value permute(const Array< int > &vec, bool inv=false) const
Range range_value(void) const
octave_idx_type nnz(void) const
octave_range(const octave_range &r)
ComplexNDArray complex_array_value(bool=false) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
Array< octave_value > array_value(void) const
octave_value_list & operator=(const octave_value_list &obj)=default
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
Matrix matrix_value(bool frc_str_conv=false) const
void error(const char *fmt,...)
intNDArray< octave_int16 > int16NDArray
intNDArray< octave_int32 > int32NDArray
intNDArray< octave_int64 > int64NDArray
intNDArray< octave_int8 > int8NDArray
bool is_true(const std::string &s)
static float_display_format get_edit_display_format(const octave_value &val)
std::complex< double > Complex
std::complex< float > FloatComplex
static double as_double(time_t sec, long usec)
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
intNDArray< octave_uint16 > uint16NDArray
intNDArray< octave_uint32 > uint32NDArray
intNDArray< octave_uint64 > uint64NDArray
intNDArray< octave_uint8 > uint8NDArray