26 #if ! defined (octave_ov_range_h)
27 #define octave_ov_range_h 1
29 #include "octave-config.h"
35 #include <type_traits>
70 error (
"invalid range");
75 m_idx_cache (
r.m_idx_cache
82 set_idx_cache (cache);
104 OCTINTERP_API type_conv_info numeric_conversion_function (
void)
const;
116 const std::list<octave_value_list>& idx);
119 const std::list<octave_value_list>& idx,
int)
120 {
return subsref (type, idx); }
146 std::size_t
byte_size (
void)
const {
return 3 *
sizeof (T); }
150 return raw_array_value ().
reshape (new_dims);
155 return raw_array_value ().
permute (vec, inv);
197 bool isreal (
void)
const {
return true; }
211 typename ov_mx_type::object_type
m (raw_array_value ());
221 typename ov_mx_type::object_type
m (raw_array_value ());
230 return m_range.
diag (k);
238 typename ov_mx_type::object_type
m (raw_array_value ());
240 return m.diag (nr, nc);
246 return tmp.
sort (dim, mode);
253 return tmp.
sort (sidx, dim, mode);
258 return m_range.issorted (mode);
273 OCTINTERP_API
double double_value (
bool =
false)
const;
275 OCTINTERP_API
float float_value (
bool =
false)
const;
279 return double_value (frc_str_conv);
284 return float_value (frc_str_conv);
289 return raw_array_value ();
294 return raw_array_value ();
299 return raw_array_value ();
304 return raw_array_value ();
307 OCTINTERP_API
charNDArray char_array_value (
bool =
false)
const;
315 return raw_array_value ();
320 return raw_array_value ();
325 return raw_array_value ();
330 return raw_array_value ();
335 return raw_array_value ();
340 return raw_array_value ();
345 return raw_array_value ();
350 return raw_array_value ();
363 OCTINTERP_API
Complex complex_value (
bool =
false)
const;
365 OCTINTERP_API
FloatComplex float_complex_value (
bool =
false)
const;
367 OCTINTERP_API
boolNDArray bool_array_value (
bool warn =
false)
const;
371 return raw_array_value ();
376 return raw_array_value ();
381 return raw_array_value ();
386 return raw_array_value ();
389 OCTINTERP_API octave::range<double> range_value (
void)
const;
395 OCTINTERP_API octave::range<float> float_range_value (
void)
const;
397 OCTINTERP_API octave::range<octave_int8> int8_range_value (
void)
const;
399 OCTINTERP_API octave::range<octave_int16> int16_range_value (
void)
const;
401 OCTINTERP_API octave::range<octave_int32> int32_range_value (
void)
const;
403 OCTINTERP_API octave::range<octave_int64> int64_range_value (
void)
const;
405 OCTINTERP_API octave::range<octave_uint8> uint8_range_value (
void)
const;
407 OCTINTERP_API octave::range<octave_uint16> uint16_range_value (
void)
const;
409 OCTINTERP_API octave::range<octave_uint32> uint32_range_value (
void)
const;
411 OCTINTERP_API octave::range<octave_uint64> uint64_range_value (
void)
const;
416 convert_to_str_internal (
bool pad,
bool force,
char type)
const;
431 OCTINTERP_API
void print (std::ostream& os,
bool pr_as_read_syntax =
false);
434 print_raw (std::ostream& os,
bool pr_as_read_syntax =
false)
const;
437 print_name_tag (std::ostream& os,
const std::string& name)
const;
439 OCTINTERP_API
void short_disp (std::ostream& os)
const;
443 OCTINTERP_API std::string
447 OCTINTERP_API
bool save_ascii (std::ostream& os);
449 OCTINTERP_API
bool load_ascii (std::istream& is);
451 OCTINTERP_API
bool save_binary (std::ostream& os,
bool save_as_floats);
454 load_binary (std::istream& is,
bool swap,
460 OCTINTERP_API
bool load_hdf5 (
octave_hdf5_id loc_id,
const char *name);
462 int write (octave::stream& os,
int block_size,
469 return os.write (matrix_value (), block_size, output_type, skip, flt_fmt);
472 OCTINTERP_API
mxArray * as_mxArray (
bool interleaved)
const;
477 return tmp.
map (umap);
495 delete m_idx_cache; m_idx_cache =
nullptr;
526 OCTINTERP_API octave::range<double>
534 OCTINTERP_API octave::range<float>
538 OCTINTERP_API octave::range<octave_int8>
542 OCTINTERP_API octave::range<octave_int16>
546 OCTINTERP_API octave::range<octave_int32>
550 OCTINTERP_API octave::range<octave_int64>
554 OCTINTERP_API octave::range<octave_uint8>
558 OCTINTERP_API octave::range<octave_uint16>
562 OCTINTERP_API octave::range<octave_uint32>
566 OCTINTERP_API octave::range<octave_uint64>
OCTARRAY_API Array< T, Alloc > sort(int dim=0, sortmode mode=ASCENDING) const
Size of the specified dimension.
Vector representing the dimensions (size) of an Array.
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
octave_value_list & operator=(const octave_value_list &obj)=default
octave_idx_type nnz(void) const
octave_value permute(const Array< int > &vec, bool inv=false) const
octave_value reshape(const dim_vector &dv) const
octave_value map(octave_base_value::unary_mapper_t umap) const
octave_value diag(octave_idx_type k=0) const
ComplexMatrix complex_matrix_value(bool=false) const
double scalar_value(bool frc_str_conv=false) const
octave::idx_vector set_idx_cache(const octave::idx_vector &idx) const
octave_value map(unary_mapper_t umap) const
ov_range(const ov_range< T > &r)
uint8NDArray uint8_array_value(void) const
bool is_int16_type(void) const
float float_scalar_value(bool frc_str_conv=false) const
bool is_int8_type(void) const
octave_idx_type numel(void) const
dim_vector dims(void) const
bool is_int64_type(void) const
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
octave_value diag(octave_idx_type k=0) const
ov_range(const octave::range< T > &r)
int64NDArray int64_array_value(void) const
static octave_hdf5_id hdf5_save_type
bool is_uint16_type(void) const
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
SparseMatrix sparse_matrix_value(bool=false) const
Array< T > raw_array_value(void) const
bool is_single_type(void) const
FloatNDArray float_array_value(bool=false) const
sortmode issorted(sortmode mode=UNSORTED) const
bool is_constant(void) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
OCTINTERP_API void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
NDArray array_value(bool=false) const
bool is_uint8_type(void) const
octave_value squeeze(void) const
octave_value all(int dim=0) const
uint64NDArray uint64_array_value(void) const
bool isnumeric(void) const
int16NDArray int16_array_value(void) const
bool is_uint32_type(void) const
OCTINTERP_API octave::range< double > range_value(void) const
uint16NDArray uint16_array_value(void) const
octave::range< T > m_range
bool is_storable(void) const
bool isinteger(void) const
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int)
bool is_range(void) const
void clear_cached_info(void) const
octave_value any(int dim=0) const
octave_base_value * clone(void) const
octave_value full_value(void) const
ComplexNDArray complex_array_value(bool=false) const
octave_value diag(octave_idx_type nr, octave_idx_type nc) const
octave::idx_vector * m_idx_cache
int8NDArray int8_array_value(void) const
FloatMatrix float_matrix_value(bool=false) const
std::size_t byte_size(void) const
ov_range(const octave::range< T > &r, const octave::idx_vector &cache)
Matrix matrix_value(bool=false) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
bool is_uint64_type(void) const
Array< octave_idx_type > sort_rows_idx(sortmode) const
octave_value reshape(const dim_vector &new_dims) 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
uint32NDArray uint32_array_value(void) const
bool is_int32_type(void) const
octave_value permute(const Array< int > &vec, bool inv=false) const
bool is_defined(void) const
FloatComplexNDArray float_complex_array_value(bool=false) const
bool is_double_type(void) const
octave_idx_type nnz(void) const
builtin_type_t builtin_type(void) const
octave_value sort(Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
OCTINTERP_API octave::idx_vector index_vector(bool require_integers=false) const
octave_base_value * empty_clone(void) const
int32NDArray int32_array_value(void) const
void error(const char *fmt,...)
octave::idx_vector idx_vector
class OCTAVE_API SparseMatrix
class OCTAVE_API SparseComplexMatrix
std::complex< double > Complex
std::complex< float > FloatComplex
T::size_type numel(const T &str)
static double as_double(OCTAVE_TIME_T sec, long usec)
bool btyp_isnumeric(builtin_type_t btyp)
bool btyp_isinteger(builtin_type_t btyp)
#define DECLARE_TEMPLATE_OV_TYPEID_SPECIALIZATIONS(cls, type)
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
bool btyp_isfloat(builtin_type_t btyp)
ov_range< double > octave_double_range
octave_double_range octave_range
static float_display_format get_edit_display_format(const octave_value &val)