GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-intx.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2004-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 // FIXME: Do not uncomment these lines to have this file included only once.
27 // The build will break (2/6/2016).
28 // #if ! defined (octave_ov_intx_h)
29 // #define octave_ov_intx_h 1
30 
31 #include "octave-config.h"
32 
33 #include <cstdlib>
34 
35 #include <iosfwd>
36 #include <string>
37 
38 #include "mx-base.h"
39 #include "str-vec.h"
40 
41 #include "error.h"
42 #include "mxarray.h"
43 #include "oct-stream.h"
44 #include "ov-base.h"
45 #include "ov-base-int.h"
46 #include "ov-typeinfo.h"
47 #include "errwarn.h"
48 
49 #include "ov-re-mat.h"
50 #include "ov-scalar.h"
51 
52 class
53 OCTINTERP_API
56 {
57 public:
58 
61 
64 
67  (intNDArray<OCTAVE_INT_T> (nda)) { }
68 
69  ~OCTAVE_VALUE_INT_MATRIX_T (void) = default;
70 
71  octave_base_value * clone (void) const
72  { return new OCTAVE_VALUE_INT_MATRIX_T (*this); }
73 
75  { return new OCTAVE_VALUE_INT_MATRIX_T (); }
76 
77  bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; }
78 
79  bool isinteger (void) const { return true; }
80 
81  builtin_type_t builtin_type (void) const { return OCTAVE_INT_BTYP; }
82 
83 public:
84 
86  int8_array_value (void) const { return int8NDArray (matrix); }
87 
89  int16_array_value (void) const { return int16NDArray (matrix); }
90 
92  int32_array_value (void) const { return int32NDArray (matrix); }
93 
95  int64_array_value (void) const { return int64NDArray (matrix); }
96 
98  uint8_array_value (void) const { return uint8NDArray (matrix); }
99 
101  uint16_array_value (void) const { return uint16NDArray (matrix); }
102 
104  uint32_array_value (void) const { return uint32NDArray (matrix); }
105 
107  uint64_array_value (void) const { return uint64NDArray (matrix); }
108 
109  double
110  double_value (bool = false) const
111  {
112  double retval;
113 
114  if (isempty ())
115  err_invalid_conversion (type_name (), "real scalar");
116 
117  warn_implicit_conversion ("Octave:array-to-scalar",
118  type_name (), "real scalar");
119 
120  retval = matrix(0).double_value ();
121 
122  return retval;
123  }
124 
125  float
126  float_value (bool = false) const
127  {
128  float retval;
129 
130  if (isempty ())
131  err_invalid_conversion (type_name (), "real scalar");
132 
133  warn_implicit_conversion ("Octave:array-to-scalar",
134  type_name (), "real scalar");
135 
136  retval = matrix(0).float_value ();
137 
138  return retval;
139  }
140 
141  double scalar_value (bool = false) const { return double_value (); }
142 
143  float float_scalar_value (bool = false) const { return float_value (); }
144 
145  Matrix
146  matrix_value (bool = false) const
147  {
148  Matrix retval;
149  dim_vector dv = dims ();
150  if (dv.ndims () > 2)
151  error ("invalid conversion of %s to Matrix", type_name ().c_str ());
152 
153  retval = Matrix (dv(0), dv(1));
154  double *vec = retval.fortran_vec ();
155  octave_idx_type nel = matrix.numel ();
156  for (octave_idx_type i = 0; i < nel; i++)
157  vec[i] = matrix(i).double_value ();
158 
159  return retval;
160  }
161 
163  float_matrix_value (bool = false) const
164  {
166  dim_vector dv = dims ();
167  if (dv.ndims () > 2)
168  error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ());
169 
170  retval = FloatMatrix (dv(0), dv(1));
171  float *vec = retval.fortran_vec ();
172  octave_idx_type nel = matrix.numel ();
173  for (octave_idx_type i = 0; i < nel; i++)
174  vec[i] = matrix(i).float_value ();
175 
176  return retval;
177  }
178 
180  complex_matrix_value (bool = false) const
181  {
183  dim_vector dv = dims ();
184  if (dv.ndims () > 2)
185  error ("invalid conversion of %s to Matrix", type_name ().c_str ());
186 
187  retval = ComplexMatrix (dv(0), dv(1));
188  Complex *vec = retval.fortran_vec ();
189  octave_idx_type nel = matrix.numel ();
190  for (octave_idx_type i = 0; i < nel; i++)
191  vec[i] = Complex (matrix(i).double_value ());
192 
193  return retval;
194  }
195 
197  float_complex_matrix_value (bool = false) const
198  {
200  dim_vector dv = dims ();
201  if (dv.ndims () > 2)
202  error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ());
203 
204  retval = FloatComplexMatrix (dv(0), dv(1));
205  FloatComplex *vec = retval.fortran_vec ();
206  octave_idx_type nel = matrix.numel ();
207  for (octave_idx_type i = 0; i < nel; i++)
208  vec[i] = FloatComplex (matrix(i).float_value ());
209 
210  return retval;
211  }
212 
213  NDArray
214  array_value (bool = false) const
215  {
216  NDArray retval (matrix.dims ());
217  double *vec = retval.fortran_vec ();
218  octave_idx_type nel = matrix.numel ();
219  for (octave_idx_type i = 0; i < nel; i++)
220  vec[i] = matrix(i).double_value ();
221  return retval;
222  }
223 
225  float_array_value (bool = false) const
226  {
227  FloatNDArray retval (matrix.dims ());
228  float *vec = retval.fortran_vec ();
229  octave_idx_type nel = matrix.numel ();
230  for (octave_idx_type i = 0; i < nel; i++)
231  vec[i] = matrix(i).float_value ();
232  return retval;
233  }
234 
236  complex_array_value (bool = false) const
237  {
238  ComplexNDArray retval (matrix.dims ());
239  Complex *vec = retval.fortran_vec ();
240  octave_idx_type nel = matrix.numel ();
241  for (octave_idx_type i = 0; i < nel; i++)
242  vec[i] = Complex (matrix(i).double_value ());
243  return retval;
244  }
245 
247  float_complex_array_value (bool = false) const
248  {
249  FloatComplexNDArray retval (matrix.dims ());
250  FloatComplex *vec = retval.fortran_vec ();
251  octave_idx_type nel = matrix.numel ();
252  for (octave_idx_type i = 0; i < nel; i++)
253  vec[i] = FloatComplex (matrix(i).float_value ());
254  return retval;
255  }
256 
258  bool_array_value (bool warn = false) const
259  {
260  boolNDArray retval (dims ());
261 
262  octave_idx_type nel = numel ();
263 
264  if (warn && matrix.any_element_not_one_or_zero ())
266 
267  bool *vec = retval.fortran_vec ();
268  for (octave_idx_type i = 0; i < nel; i++)
269  vec[i] = matrix(i).bool_value ();
270 
271  return retval;
272  }
273 
275  char_array_value (bool = false) const
276  {
277  charNDArray retval (dims ());
278 
279  octave_idx_type nel = numel ();
280 
281  char *vec = retval.fortran_vec ();
282  for (octave_idx_type i = 0; i < nel; i++)
283  vec[i] = matrix(i).char_value ();
284 
285  return retval;
286  }
287 
288  // Use matrix_ref here to clear index cache.
289  void increment (void)
290  {
291  matrix_ref () += OCTAVE_INT_T (1);
292  }
293 
294  void decrement (void)
295  {
296  matrix_ref () -= OCTAVE_INT_T (1);
297  }
298 
299  void changesign (void)
300  {
301  matrix_ref ().changesign ();
302  }
303 
304  idx_vector index_vector (bool /* require_integers */ = false) const
305  {
306  return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix));
307  }
308 
309  int write (octave::stream& os, int block_size,
310  oct_data_conv::data_type output_type, int skip,
311  octave::mach_info::float_format flt_fmt) const
312  { return os.write (matrix, block_size, output_type, skip, flt_fmt); }
313 
314  // Unsafe. This function exists to support the MEX interface.
315  // You should not use it anywhere else.
316  void * mex_get_data (void) const { return matrix.mex_get_data (); }
317 
318  mxArray * as_mxArray (void) const
319  {
320  mxArray *retval = new mxArray (OCTAVE_INT_MX_CLASS, dims (), mxREAL);
321 
322  OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *>
323  (retval->get_data ());
324 
325  mwSize nel = numel ();
326 
327  const OCTAVE_INT_T *p = matrix.data ();
328 
329  for (mwIndex i = 0; i < nel; i++)
330  pr[i] = p[i].value ();
331 
332  return retval;
333  }
334 
336  {
337  switch (umap)
338  {
339  case umap_abs:
340  return matrix.abs ();
341  case umap_signum:
342  return matrix.signum ();
343  case umap_ceil:
344  case umap_conj:
345  case umap_fix:
346  case umap_floor:
347  case umap_real:
348  case umap_round:
349  return matrix;
350  case umap_imag:
351  return intNDArray<OCTAVE_INT_T> (matrix.dims (), OCTAVE_INT_T ());
352  case umap_isnan:
353  case umap_isna:
354  case umap_isinf:
355  return boolNDArray (matrix.dims (), false);
356  case umap_isfinite:
357  return boolNDArray (matrix.dims (), true);
358 
359  // Special cases for Matlab compatibility.
360  case umap_xtolower:
361  case umap_xtoupper:
362  return matrix;
363 
364  default:
365  {
366  // FIXME: we should be able to do better than converting to
367  // double here.
368  octave_matrix m (array_value ());
369  return m.map (umap);
370  }
371  }
372  }
373 
374  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
375  {
376  return save_hdf5_internal (loc_id, hdf5_save_type, name, flag);
377  }
378 
379  bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
380  {
381  return load_hdf5_internal (loc_id, hdf5_save_type, name);
382  }
383 
384 private:
385 
387 
389 };
390 
391 class
392 OCTINTERP_API
395 {
396 public:
397 
400 
403 
404  ~OCTAVE_VALUE_INT_SCALAR_T (void) = default;
405 
406  octave_base_value * clone (void) const
407  { return new OCTAVE_VALUE_INT_SCALAR_T (*this); }
408 
410  { return new OCTAVE_VALUE_INT_MATRIX_T (); }
411 
413  bool resize_ok = false)
414  {
415  // FIXME: this doesn't solve the problem of
416  //
417  // a = 1; a([1,1], [1,1], [1,1])
418  //
419  // and similar constructions. Hmm...
420 
421  // FIXME: using this constructor avoids narrowing the
422  // 1x1 matrix back to a scalar value. Need a better solution
423  // to this problem.
424 
425  octave_value tmp
428 
429  return tmp.do_index_op (idx, resize_ok);
430  }
431 
432  bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; }
433 
434  bool isinteger (void) const { return true; }
435 
436  builtin_type_t builtin_type (void) const { return OCTAVE_INT_BTYP; }
437 
438 public:
439 
441  int8_scalar_value (void) const { return octave_int8 (scalar); }
442 
444  int16_scalar_value (void) const { return octave_int16 (scalar); }
445 
447  int32_scalar_value (void) const { return octave_int32 (scalar); }
448 
450  int64_scalar_value (void) const { return octave_int64 (scalar); }
451 
453  uint8_scalar_value (void) const { return octave_uint8 (scalar); }
454 
456  uint16_scalar_value (void) const { return octave_uint16 (scalar); }
457 
459  uint32_scalar_value (void) const { return octave_uint32 (scalar); }
460 
462  uint64_scalar_value (void) const { return octave_uint64 (scalar); }
463 
465  int8_array_value (void) const
466  { return int8NDArray (dim_vector (1, 1), int8_scalar_value ()); }
467 
469  int16_array_value (void) const
470  { return int16NDArray (dim_vector (1, 1), int16_scalar_value ()); }
471 
473  int32_array_value (void) const
474  { return int32NDArray (dim_vector (1, 1), int32_scalar_value ()); }
475 
477  int64_array_value (void) const
478  { return int64NDArray (dim_vector (1, 1), int64_scalar_value ()); }
479 
481  uint8_array_value (void) const
482  { return uint8NDArray (dim_vector (1, 1), uint8_scalar_value ()); }
483 
485  uint16_array_value (void) const
486  { return uint16NDArray (dim_vector (1, 1), uint16_scalar_value ()); }
487 
489  uint32_array_value (void) const
490  { return uint32NDArray (dim_vector (1, 1), uint32_scalar_value ()); }
491 
493  uint64_array_value (void) const
494  { return uint64NDArray (dim_vector (1, 1), uint64_scalar_value ()); }
495 
496  octave_value resize (const dim_vector& dv, bool fill = false) const
497  {
498  if (fill)
499  {
501  if (dv.numel ())
502  retval(0) = scalar;
503  return retval;
504  }
505  else
506  {
508  if (dv.numel ())
509  retval(0) = scalar;
510  return retval;
511  }
512  }
513 
514  double double_value (bool = false) const { return scalar.double_value (); }
515 
516  float float_value (bool = false) const { return scalar.float_value (); }
517 
518  double scalar_value (bool = false) const { return scalar.double_value (); }
519 
520  float float_scalar_value (bool = false) const
521  { return scalar.float_value (); }
522 
523  Matrix
524  matrix_value (bool = false) const
525  {
526  Matrix retval (1, 1);
527  retval(0,0) = scalar.double_value ();
528  return retval;
529  }
530 
532  float_matrix_value (bool = false) const
533  {
534  FloatMatrix retval (1, 1);
535  retval(0,0) = scalar.float_value ();
536  return retval;
537  }
538 
540  complex_matrix_value (bool = false) const
541  {
542  ComplexMatrix retval (1, 1);
543  retval(0,0) = Complex (scalar.double_value ());
544  return retval;
545  }
546 
548  float_complex_matrix_value (bool = false) const
549  {
550  FloatComplexMatrix retval (1, 1);
551  retval(0,0) = FloatComplex (scalar.float_value ());
552  return retval;
553  }
554 
555  NDArray
556  array_value (bool = false) const
557  {
558  NDArray retval (dim_vector (1, 1));
559  retval(0) = scalar.double_value ();
560  return retval;
561  }
562 
564  float_array_value (bool = false) const
565  {
566  FloatNDArray retval (dim_vector (1, 1));
567  retval(0) = scalar.float_value ();
568  return retval;
569  }
570 
572  complex_array_value (bool = false) const
573  {
575  retval(0) = Complex (scalar.double_value ());
576  return retval;
577  }
578 
580  float_complex_array_value (bool = false) const
581  {
583  retval(0) = FloatComplex (scalar.float_value ());
584  return retval;
585  }
586 
587  bool bool_value (bool warn = false) const
588  {
589  if (warn && scalar != 0.0 && scalar != 1.0)
591 
592  return scalar.bool_value ();
593  }
594 
596  bool_array_value (bool warn = false) const
597  {
598  boolNDArray retval (dim_vector (1, 1));
599 
600  if (warn && scalar != 0.0 && scalar != 1.0)
602 
603  retval(0) = scalar.bool_value ();
604 
605  return retval;
606  }
607 
609  char_array_value (bool = false) const
610  {
611  charNDArray retval (dim_vector (1, 1));
612  retval(0) = scalar.char_value ();
613  return retval;
614  }
615 
616  void increment (void)
617  {
618  scalar += OCTAVE_INT_T (1);
619  }
620 
621  void decrement (void)
622  {
623  scalar -= OCTAVE_INT_T (1);
624  }
625 
626  idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (scalar); }
627 
628  int write (octave::stream& os, int block_size,
629  oct_data_conv::data_type output_type, int skip,
630  octave::mach_info::float_format flt_fmt) const
631  {
633  block_size, output_type, skip, flt_fmt);
634  }
635 
636  // Unsafe. This function exists to support the MEX interface.
637  // You should not use it anywhere else.
638  void * mex_get_data (void) const { return scalar.mex_get_data (); }
639 
640  mxArray * as_mxArray (void) const
641  {
643 
644  OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *>
645  (retval->get_data ());
646 
647  pr[0] = scalar.value ();
648 
649  return retval;
650  }
651 
653  {
654  switch (umap)
655  {
656  case umap_abs:
657  return scalar.abs ();
658  case umap_signum:
659  return scalar.signum ();
660  case umap_ceil:
661  case umap_conj:
662  case umap_fix:
663  case umap_floor:
664  case umap_real:
665  case umap_round:
666  return scalar;
667  case umap_imag:
668  return OCTAVE_INT_T ();
669  case umap_isnan:
670  case umap_isna:
671  case umap_isinf:
672  return false;
673  case umap_isfinite:
674  return true;
675 
676  // Special cases for Matlab compatibility.
677  case umap_xtolower:
678  case umap_xtoupper:
679  return scalar;
680 
681  default:
682  {
683  octave_scalar m (scalar_value ());
684  return m.map (umap);
685  }
686  }
687  }
688 
689  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
690  {
691  return save_hdf5_internal (loc_id, hdf5_save_type, name, flag);
692  }
693 
694  bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
695  {
696  return load_hdf5_internal (loc_id, hdf5_save_type, name);
697  }
698 
699 private:
700 
702 
704 };
N Dimensional Array with copy-on-write semantics.
Definition: Array.h:128
const T * fortran_vec(void) const
Size of the specified dimension.
Definition: Array.h:583
Definition: dMatrix.h:42
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:95
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:401
octave_idx_type ndims(void) const
Number of dimensions.
Definition: dim-vector.h:334
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)
Definition: oct-stream.cc:6777
builtin_type_t builtin_type(void) const
Definition: ov-intx.h:81
static octave_hdf5_id hdf5_save_type
Definition: ov-intx.h:386
double double_value(bool=false) const
Definition: ov-intx.h:110
float float_value(bool=false) const
Definition: ov-intx.h:126
int64NDArray int64_array_value(void) const
Definition: ov-intx.h:95
void increment(void)
Definition: ov-intx.h:289
uint16NDArray uint16_array_value(void) const
Definition: ov-intx.h:101
FloatMatrix float_matrix_value(bool=false) const
Definition: ov-intx.h:163
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:335
boolNDArray bool_array_value(bool warn=false) const
Definition: ov-intx.h:258
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Definition: ov-intx.h:197
uint64NDArray uint64_array_value(void) const
Definition: ov-intx.h:107
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
Definition: ov-intx.h:374
float float_scalar_value(bool=false) const
Definition: ov-intx.h:143
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:225
void changesign(void)
Definition: ov-intx.h:299
octave_base_value * empty_clone(void) const
Definition: ov-intx.h:74
bool isinteger(void) const
Definition: ov-intx.h:79
mxArray * as_mxArray(void) const
Definition: ov-intx.h:318
Matrix matrix_value(bool=false) const
Definition: ov-intx.h:146
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
Definition: ov-intx.h:309
void * mex_get_data(void) const
Definition: ov-intx.h:316
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition: ov-intx.h:247
ComplexNDArray complex_array_value(bool=false) const
Definition: ov-intx.h:236
uint8NDArray uint8_array_value(void) const
Definition: ov-intx.h:98
NDArray array_value(bool=false) const
Definition: ov-intx.h:214
int16NDArray int16_array_value(void) const
Definition: ov-intx.h:89
void decrement(void)
Definition: ov-intx.h:294
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov-intx.h:379
uint32NDArray uint32_array_value(void) const
Definition: ov-intx.h:104
charNDArray char_array_value(bool=false) const
Definition: ov-intx.h:275
octave_base_value * clone(void) const
Definition: ov-intx.h:71
ComplexMatrix complex_matrix_value(bool=false) const
Definition: ov-intx.h:180
int8NDArray int8_array_value(void) const
Definition: ov-intx.h:86
int32NDArray int32_array_value(void) const
Definition: ov-intx.h:92
double scalar_value(bool=false) const
Definition: ov-intx.h:141
idx_vector index_vector(bool=false) const
Definition: ov-intx.h:304
idx_vector index_vector(bool=false) const
Definition: ov-intx.h:626
Matrix matrix_value(bool=false) const
Definition: ov-intx.h:524
octave_uint32 uint32_scalar_value(void) const
Definition: ov-intx.h:459
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov-intx.h:412
int8NDArray int8_array_value(void) const
Definition: ov-intx.h:465
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:564
int32NDArray int32_array_value(void) const
Definition: ov-intx.h:473
uint64NDArray uint64_array_value(void) const
Definition: ov-intx.h:493
void increment(void)
Definition: ov-intx.h:616
octave_base_value * empty_clone(void) const
Definition: ov-intx.h:409
bool bool_value(bool warn=false) const
Definition: ov-intx.h:587
FloatMatrix float_matrix_value(bool=false) const
Definition: ov-intx.h:532
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
Definition: ov-intx.h:689
void decrement(void)
Definition: ov-intx.h:621
int64NDArray int64_array_value(void) const
Definition: ov-intx.h:477
uint8NDArray uint8_array_value(void) const
Definition: ov-intx.h:481
octave_int8 int8_scalar_value(void) const
Definition: ov-intx.h:441
NDArray array_value(bool=false) const
Definition: ov-intx.h:556
ComplexNDArray complex_array_value(bool=false) const
Definition: ov-intx.h:572
static octave_hdf5_id hdf5_save_type
Definition: ov-intx.h:701
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
Definition: ov-intx.h:628
octave_uint16 uint16_scalar_value(void) const
Definition: ov-intx.h:456
float float_value(bool=false) const
Definition: ov-intx.h:516
double double_value(bool=false) const
Definition: ov-intx.h:514
ComplexMatrix complex_matrix_value(bool=false) const
Definition: ov-intx.h:540
octave_base_value * clone(void) const
Definition: ov-intx.h:406
void * mex_get_data(void) const
Definition: ov-intx.h:638
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition: ov-intx.h:580
double scalar_value(bool=false) const
Definition: ov-intx.h:518
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Definition: ov-intx.h:548
octave_uint8 uint8_scalar_value(void) const
Definition: ov-intx.h:453
octave_int64 int64_scalar_value(void) const
Definition: ov-intx.h:450
builtin_type_t builtin_type(void) const
Definition: ov-intx.h:436
int16NDArray int16_array_value(void) const
Definition: ov-intx.h:469
uint32NDArray uint32_array_value(void) const
Definition: ov-intx.h:489
mxArray * as_mxArray(void) const
Definition: ov-intx.h:640
float float_scalar_value(bool=false) const
Definition: ov-intx.h:520
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:652
octave_uint64 uint64_scalar_value(void) const
Definition: ov-intx.h:462
bool isinteger(void) const
Definition: ov-intx.h:434
uint16NDArray uint16_array_value(void) const
Definition: ov-intx.h:485
octave_value resize(const dim_vector &dv, bool fill=false) const
Definition: ov-intx.h:496
octave_int32 int32_scalar_value(void) const
Definition: ov-intx.h:447
octave_int16 int16_scalar_value(void) const
Definition: ov-intx.h:444
charNDArray char_array_value(bool=false) const
Definition: ov-intx.h:609
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov-intx.h:694
boolNDArray bool_array_value(bool warn=false) const
Definition: ov-intx.h:596
octave_value signum(void) const
Definition: ov.h:1409
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov.h:475
octave_value abs(void) const
Definition: ov.h:1370
void error(const char *fmt,...)
Definition: error.cc:968
void err_invalid_conversion(const std::string &from, const std::string &to)
Definition: errwarn.cc:71
void warn_logical_conversion(void)
Definition: errwarn.cc:365
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Definition: errwarn.cc:344
QString name
intNDArray< octave_int16 > int16NDArray
Definition: int16NDArray.h:36
intNDArray< octave_int32 > int32NDArray
Definition: int32NDArray.h:36
intNDArray< octave_int64 > int64NDArray
Definition: int64NDArray.h:36
intNDArray< octave_int8 > int8NDArray
Definition: int8NDArray.h:36
void mxArray
Definition: mex.h:58
T octave_idx_type m
Definition: mx-inlines.cc:773
OCTAVE_IDX_TYPE mwSize
Definition: mxarray.in.h:97
OCTAVE_IDX_TYPE mwIndex
Definition: mxarray.in.h:98
@ mxREAL
Definition: mxarray.in.h:80
std::complex< double > Complex
Definition: oct-cmplx.h:33
std::complex< float > FloatComplex
Definition: oct-cmplx.h:34
int64_t octave_hdf5_id
octave_int< uint32_t > octave_uint32
octave_int< int32_t > octave_int32
octave_int< int16_t > octave_int16
octave_int< int8_t > octave_int8
octave_int< int64_t > octave_int64
octave_int< uint64_t > octave_uint64
octave_int< uint16_t > octave_uint16
octave_int< uint8_t > octave_uint8
T::size_type numel(const T &str)
Definition: oct-string.cc:71
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:158
builtin_type_t
Definition: ov-base.h:72
#define OCTAVE_INT_MX_CLASS
Definition: ov-int16.h:41
#define OCTAVE_TYPE_PREDICATE_FUNCTION
Definition: ov-int16.h:39
#define OCTAVE_INT_BTYP
Definition: ov-int16.h:43
#define OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION
Definition: ov-int16.h:34
#define OCTAVE_INT_T
Definition: ov-int16.h:31
#define OCTAVE_VALUE_INT_MATRIX_T
Definition: ov-int16.h:33
#define OCTAVE_VALUE_INT_SCALAR_T
Definition: ov-int16.h:36
static bool scalar(const dim_vector &dims)
Definition: ov-struct.cc:669
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811
intNDArray< octave_uint16 > uint16NDArray
Definition: uint16NDArray.h:36
intNDArray< octave_uint32 > uint32NDArray
Definition: uint32NDArray.h:36
intNDArray< octave_uint64 > uint64NDArray
Definition: uint64NDArray.h:36
intNDArray< octave_uint8 > uint8NDArray
Definition: uint8NDArray.h:36