GNU Octave  9.1.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-2024 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 
70 
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 () const { return true; }
78 
79  bool isinteger () const { return true; }
80 
82 
83 public:
84 
86  int8_array_value () const { return int8NDArray (m_matrix); }
87 
89  int16_array_value () const { return int16NDArray (m_matrix); }
90 
92  int32_array_value () const { return int32NDArray (m_matrix); }
93 
95  int64_array_value () const { return int64NDArray (m_matrix); }
96 
98  uint8_array_value () const { return uint8NDArray (m_matrix); }
99 
101  uint16_array_value () const { return uint16NDArray (m_matrix); }
102 
104  uint32_array_value () const { return uint32NDArray (m_matrix); }
105 
107  uint64_array_value () const { return uint64NDArray (m_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 = m_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 = m_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 = m_matrix.numel ();
156  for (octave_idx_type i = 0; i < nel; i++)
157  vec[i] = m_matrix(i).double_value ();
158 
159  return retval;
160  }
161 
163  float_matrix_value (bool = false) const
164  {
165  FloatMatrix retval;
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 = m_matrix.numel ();
173  for (octave_idx_type i = 0; i < nel; i++)
174  vec[i] = m_matrix(i).float_value ();
175 
176  return retval;
177  }
178 
180  complex_matrix_value (bool = false) const
181  {
182  ComplexMatrix retval;
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 = m_matrix.numel ();
190  for (octave_idx_type i = 0; i < nel; i++)
191  vec[i] = Complex (m_matrix(i).double_value ());
192 
193  return retval;
194  }
195 
197  float_complex_matrix_value (bool = false) const
198  {
199  FloatComplexMatrix retval;
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 = m_matrix.numel ();
207  for (octave_idx_type i = 0; i < nel; i++)
208  vec[i] = FloatComplex (m_matrix(i).float_value ());
209 
210  return retval;
211  }
212 
213  NDArray
214  array_value (bool = false) const
215  {
216  NDArray retval (m_matrix.dims ());
217  double *vec = retval.fortran_vec ();
218  octave_idx_type nel = m_matrix.numel ();
219  for (octave_idx_type i = 0; i < nel; i++)
220  vec[i] = m_matrix(i).double_value ();
221  return retval;
222  }
223 
225  float_array_value (bool = false) const
226  {
227  FloatNDArray retval (m_matrix.dims ());
228  float *vec = retval.fortran_vec ();
229  octave_idx_type nel = m_matrix.numel ();
230  for (octave_idx_type i = 0; i < nel; i++)
231  vec[i] = m_matrix(i).float_value ();
232  return retval;
233  }
234 
236  complex_array_value (bool = false) const
237  {
238  ComplexNDArray retval (m_matrix.dims ());
239  Complex *vec = retval.fortran_vec ();
240  octave_idx_type nel = m_matrix.numel ();
241  for (octave_idx_type i = 0; i < nel; i++)
242  vec[i] = Complex (m_matrix(i).double_value ());
243  return retval;
244  }
245 
247  float_complex_array_value (bool = false) const
248  {
249  FloatComplexNDArray retval (m_matrix.dims ());
250  FloatComplex *vec = retval.fortran_vec ();
251  octave_idx_type nel = m_matrix.numel ();
252  for (octave_idx_type i = 0; i < nel; i++)
253  vec[i] = FloatComplex (m_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 && m_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] = m_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] = m_matrix(i).char_value ();
284 
285  return retval;
286  }
287 
288  // Use matrix_ref here to clear index cache.
289  void increment ()
290  {
291  matrix_ref () += OCTAVE_INT_T (1);
292  }
293 
294  void decrement ()
295  {
296  matrix_ref () -= OCTAVE_INT_T (1);
297  }
298 
299  void changesign ()
300  {
301  matrix_ref ().changesign ();
302  }
303 
304  octave::idx_vector index_vector (bool /* require_integers */ = false) const
305  {
306  return m_idx_cache ? *m_idx_cache
307  : set_idx_cache (octave::idx_vector (m_matrix));
308  }
309 
310  int write (octave::stream& os, int block_size,
311  oct_data_conv::data_type output_type, int skip,
312  octave::mach_info::float_format flt_fmt) const
313  { return os.write (m_matrix, block_size, output_type, skip, flt_fmt); }
314 
315  mxArray * as_mxArray (bool interleaved) const
316  {
317  mxArray *retval = new mxArray (interleaved, OCTAVE_INT_MX_CLASS, dims (),
318  mxREAL);
319 
320  OCTAVE_INT_T::val_type *pd
321  = static_cast<OCTAVE_INT_T::val_type *> (retval->get_data ());
322 
323  mwSize nel = numel ();
324 
325  const OCTAVE_INT_T *pdata = m_matrix.data ();
326 
327  for (mwIndex i = 0; i < nel; i++)
328  pd[i] = pdata[i].value ();
329 
330  return retval;
331  }
332 
334  {
335  switch (umap)
336  {
337  case umap_abs:
338  return m_matrix.abs ();
339  case umap_signum:
340  return m_matrix.signum ();
341  case umap_ceil:
342  case umap_conj:
343  case umap_fix:
344  case umap_floor:
345  case umap_real:
346  case umap_round:
347  return m_matrix;
348  case umap_imag:
349  return intNDArray<OCTAVE_INT_T> (m_matrix.dims (), OCTAVE_INT_T ());
350  case umap_isnan:
351  case umap_isna:
352  case umap_isinf:
353  return boolNDArray (m_matrix.dims (), false);
354  case umap_isfinite:
355  return boolNDArray (m_matrix.dims (), true);
356 
357  // Special cases for Matlab compatibility.
358  case umap_xtolower:
359  case umap_xtoupper:
360  return m_matrix;
361 
362  default:
363  {
364  // FIXME: we should be able to do better than converting to
365  // double here.
366  octave_matrix m (array_value ());
367  return m.map (umap);
368  }
369  }
370  }
371 
372  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
373  {
374  return save_hdf5_internal (loc_id, s_hdf5_save_type, name, flag);
375  }
376 
377  bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
378  {
379  return load_hdf5_internal (loc_id, s_hdf5_save_type, name);
380  }
381 
382 private:
383 
384  static octave_hdf5_id s_hdf5_save_type;
385 
387 };
388 
389 class
390 OCTINTERP_API
393 {
394 public:
395 
398 
401 
403 
405  { return new OCTAVE_VALUE_INT_SCALAR_T (*this); }
406 
408  { return new OCTAVE_VALUE_INT_MATRIX_T (); }
409 
411  bool resize_ok = false)
412  {
413  // FIXME: this doesn't solve the problem of
414  //
415  // a = 1; a([1,1], [1,1], [1,1])
416  //
417  // and similar constructions. Hmm...
418 
419  // FIXME: using this constructor avoids narrowing the
420  // 1x1 matrix back to a scalar value. Need a better solution
421  // to this problem.
422 
423  octave_value tmp
426 
427  return tmp.index_op (idx, resize_ok);
428  }
429 
430  bool OCTAVE_TYPE_PREDICATE_FUNCTION () const { return true; }
431 
432  bool isinteger () const { return true; }
433 
435 
436 public:
437 
439  int8_scalar_value () const { return octave_int8 (scalar); }
440 
442  int16_scalar_value () const { return octave_int16 (scalar); }
443 
445  int32_scalar_value () const { return octave_int32 (scalar); }
446 
448  int64_scalar_value () const { return octave_int64 (scalar); }
449 
451  uint8_scalar_value () const { return octave_uint8 (scalar); }
452 
454  uint16_scalar_value () const { return octave_uint16 (scalar); }
455 
457  uint32_scalar_value () const { return octave_uint32 (scalar); }
458 
460  uint64_scalar_value () const { return octave_uint64 (scalar); }
461 
464  { return int8NDArray (dim_vector (1, 1), int8_scalar_value ()); }
465 
468  { return int16NDArray (dim_vector (1, 1), int16_scalar_value ()); }
469 
472  { return int32NDArray (dim_vector (1, 1), int32_scalar_value ()); }
473 
476  { return int64NDArray (dim_vector (1, 1), int64_scalar_value ()); }
477 
480  { return uint8NDArray (dim_vector (1, 1), uint8_scalar_value ()); }
481 
484  { return uint16NDArray (dim_vector (1, 1), uint16_scalar_value ()); }
485 
488  { return uint32NDArray (dim_vector (1, 1), uint32_scalar_value ()); }
489 
492  { return uint64NDArray (dim_vector (1, 1), uint64_scalar_value ()); }
493 
494  octave_value resize (const dim_vector& dv, bool fill = false) const
495  {
496  if (fill)
497  {
498  intNDArray<OCTAVE_INT_T> retval (dv, 0);
499  if (dv.numel ())
500  retval(0) = scalar;
501  return retval;
502  }
503  else
504  {
505  intNDArray<OCTAVE_INT_T> retval (dv);
506  if (dv.numel ())
507  retval(0) = scalar;
508  return retval;
509  }
510  }
511 
512  double double_value (bool = false) const { return scalar.double_value (); }
513 
514  float float_value (bool = false) const { return scalar.float_value (); }
515 
516  double scalar_value (bool = false) const { return scalar.double_value (); }
517 
518  float float_scalar_value (bool = false) const
519  { return scalar.float_value (); }
520 
521  Matrix
522  matrix_value (bool = false) const
523  {
524  Matrix retval (1, 1);
525  retval(0, 0) = scalar.double_value ();
526  return retval;
527  }
528 
530  float_matrix_value (bool = false) const
531  {
532  FloatMatrix retval (1, 1);
533  retval(0, 0) = scalar.float_value ();
534  return retval;
535  }
536 
538  complex_matrix_value (bool = false) const
539  {
540  ComplexMatrix retval (1, 1);
541  retval(0, 0) = Complex (scalar.double_value ());
542  return retval;
543  }
544 
546  float_complex_matrix_value (bool = false) const
547  {
548  FloatComplexMatrix retval (1, 1);
549  retval(0, 0) = FloatComplex (scalar.float_value ());
550  return retval;
551  }
552 
553  NDArray
554  array_value (bool = false) const
555  {
556  NDArray retval (dim_vector (1, 1));
557  retval(0) = scalar.double_value ();
558  return retval;
559  }
560 
562  float_array_value (bool = false) const
563  {
564  FloatNDArray retval (dim_vector (1, 1));
565  retval(0) = scalar.float_value ();
566  return retval;
567  }
568 
570  complex_array_value (bool = false) const
571  {
572  ComplexNDArray retval (dim_vector (1, 1));
573  retval(0) = Complex (scalar.double_value ());
574  return retval;
575  }
576 
578  float_complex_array_value (bool = false) const
579  {
580  FloatComplexNDArray retval (dim_vector (1, 1));
581  retval(0) = FloatComplex (scalar.float_value ());
582  return retval;
583  }
584 
585  bool bool_value (bool warn = false) const
586  {
587  if (warn && scalar != 0.0 && scalar != 1.0)
589 
590  return scalar.bool_value ();
591  }
592 
594  bool_array_value (bool warn = false) const
595  {
596  boolNDArray retval (dim_vector (1, 1));
597 
598  if (warn && scalar != 0.0 && scalar != 1.0)
600 
601  retval(0) = scalar.bool_value ();
602 
603  return retval;
604  }
605 
607  char_array_value (bool = false) const
608  {
609  charNDArray retval (dim_vector (1, 1));
610  retval(0) = scalar.char_value ();
611  return retval;
612  }
613 
614  void increment ()
615  {
616  scalar += OCTAVE_INT_T (1);
617  }
618 
619  void decrement ()
620  {
621  scalar -= OCTAVE_INT_T (1);
622  }
623 
624  octave::idx_vector index_vector (bool /* require_integers */ = false) const
625  { return octave::idx_vector (scalar); }
626 
627  int write (octave::stream& os, int block_size,
628  oct_data_conv::data_type output_type, int skip,
629  octave::mach_info::float_format flt_fmt) const
630  {
632  block_size, output_type, skip, flt_fmt);
633  }
634 
635  mxArray * as_mxArray (bool interleaved) const
636  {
637  mxArray *retval = new mxArray (interleaved, OCTAVE_INT_MX_CLASS, 1, 1,
638  mxREAL);
639 
640  OCTAVE_INT_T::val_type *pd
641  = static_cast<OCTAVE_INT_T::val_type *> (retval->get_data ());
642 
643  pd[0] = scalar.value ();
644 
645  return retval;
646  }
647 
649  {
650  switch (umap)
651  {
652  case umap_abs:
653  return scalar.abs ();
654  case umap_signum:
655  return scalar.signum ();
656  case umap_ceil:
657  case umap_conj:
658  case umap_fix:
659  case umap_floor:
660  case umap_real:
661  case umap_round:
662  return scalar;
663  case umap_imag:
664  return OCTAVE_INT_T ();
665  case umap_isnan:
666  case umap_isna:
667  case umap_isinf:
668  return false;
669  case umap_isfinite:
670  return true;
671 
672  // Special cases for Matlab compatibility.
673  case umap_xtolower:
674  case umap_xtoupper:
675  return scalar;
676 
677  default:
678  {
679  octave_scalar m (scalar_value ());
680  return m.map (umap);
681  }
682  }
683  }
684 
685  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
686  {
687  return save_hdf5_internal (loc_id, s_hdf5_save_type, name, flag);
688  }
689 
690  bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
691  {
692  return load_hdf5_internal (loc_id, s_hdf5_save_type, name);
693  }
694 
695 private:
696 
697  static octave_hdf5_id s_hdf5_save_type;
698 
700 };
N Dimensional Array with copy-on-write semantics.
Definition: Array.h:130
T * fortran_vec()
Size of the specified dimension.
Definition: Array-base.cc:1764
Definition: dMatrix.h:42
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:94
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:335
octave_idx_type ndims() const
Number of dimensions.
Definition: dim-vector.h:257
void * get_data() const
Definition: mxarray.h:473
octave::idx_vector index_vector(bool=false) const
Definition: ov-intx.h:304
octave_base_value * empty_clone() const
Definition: ov-intx.h:74
mxArray * as_mxArray(bool interleaved) const
Definition: ov-intx.h:315
bool isinteger() const
Definition: ov-intx.h:79
double double_value(bool=false) const
Definition: ov-intx.h:110
uint64NDArray uint64_array_value() const
Definition: ov-intx.h:107
float float_value(bool=false) const
Definition: ov-intx.h:126
uint32NDArray uint32_array_value() const
Definition: ov-intx.h:104
FloatMatrix float_matrix_value(bool=false) const
Definition: ov-intx.h:163
octave_base_value * clone() const
Definition: ov-intx.h:71
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:333
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
int16NDArray int16_array_value() const
Definition: ov-intx.h:89
builtin_type_t builtin_type() const
Definition: ov-intx.h:81
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
Definition: ov-intx.h:372
float float_scalar_value(bool=false) const
Definition: ov-intx.h:143
uint16NDArray uint16_array_value() const
Definition: ov-intx.h:101
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:225
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:310
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition: ov-intx.h:247
int32NDArray int32_array_value() const
Definition: ov-intx.h:92
ComplexNDArray complex_array_value(bool=false) const
Definition: ov-intx.h:236
int8NDArray int8_array_value() const
Definition: ov-intx.h:86
NDArray array_value(bool=false) const
Definition: ov-intx.h:214
int64NDArray int64_array_value() const
Definition: ov-intx.h:95
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov-intx.h:377
charNDArray char_array_value(bool=false) const
Definition: ov-intx.h:275
ComplexMatrix complex_matrix_value(bool=false) const
Definition: ov-intx.h:180
uint8NDArray uint8_array_value() const
Definition: ov-intx.h:98
double scalar_value(bool=false) const
Definition: ov-intx.h:141
octave_uint8 uint8_scalar_value() const
Definition: ov-intx.h:451
Matrix matrix_value(bool=false) const
Definition: ov-intx.h:522
uint16NDArray uint16_array_value() const
Definition: ov-intx.h:483
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov-intx.h:410
uint32NDArray uint32_array_value() const
Definition: ov-intx.h:487
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:562
bool bool_value(bool warn=false) const
Definition: ov-intx.h:585
FloatMatrix float_matrix_value(bool=false) const
Definition: ov-intx.h:530
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
Definition: ov-intx.h:685
octave_int32 int32_scalar_value() const
Definition: ov-intx.h:445
octave_uint32 uint32_scalar_value() const
Definition: ov-intx.h:457
builtin_type_t builtin_type() const
Definition: ov-intx.h:434
octave_int16 int16_scalar_value() const
Definition: ov-intx.h:442
int64NDArray int64_array_value() const
Definition: ov-intx.h:475
NDArray array_value(bool=false) const
Definition: ov-intx.h:554
ComplexNDArray complex_array_value(bool=false) const
Definition: ov-intx.h:570
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:627
octave_uint16 uint16_scalar_value() const
Definition: ov-intx.h:454
octave_base_value * empty_clone() const
Definition: ov-intx.h:407
float float_value(bool=false) const
Definition: ov-intx.h:514
double double_value(bool=false) const
Definition: ov-intx.h:512
mxArray * as_mxArray(bool interleaved) const
Definition: ov-intx.h:635
uint8NDArray uint8_array_value() const
Definition: ov-intx.h:479
ComplexMatrix complex_matrix_value(bool=false) const
Definition: ov-intx.h:538
octave::idx_vector index_vector(bool=false) const
Definition: ov-intx.h:624
int16NDArray int16_array_value() const
Definition: ov-intx.h:467
octave_int8 int8_scalar_value() const
Definition: ov-intx.h:439
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition: ov-intx.h:578
double scalar_value(bool=false) const
Definition: ov-intx.h:516
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Definition: ov-intx.h:546
octave_int64 int64_scalar_value() const
Definition: ov-intx.h:448
int8NDArray int8_array_value() const
Definition: ov-intx.h:463
float float_scalar_value(bool=false) const
Definition: ov-intx.h:518
octave_uint64 uint64_scalar_value() const
Definition: ov-intx.h:460
int32NDArray int32_array_value() const
Definition: ov-intx.h:471
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:648
uint64NDArray uint64_array_value() const
Definition: ov-intx.h:491
bool isinteger() const
Definition: ov-intx.h:432
octave_base_value * clone() const
Definition: ov-intx.h:404
octave_value resize(const dim_vector &dv, bool fill=false) const
Definition: ov-intx.h:494
charNDArray char_array_value(bool=false) const
Definition: ov-intx.h:607
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov-intx.h:690
boolNDArray bool_array_value(bool warn=false) const
Definition: ov-intx.h:594
octave_value index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov.h:504
octave_value signum() const
Definition: ov.h:1486
octave_value abs() const
Definition: ov.h:1447
void() error(const char *fmt,...)
Definition: error.cc:988
void err_invalid_conversion(const std::string &from, const std::string &to)
Definition: errwarn.cc:71
void warn_logical_conversion()
Definition: errwarn.cc:365
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Definition: errwarn.cc:344
octave::idx_vector idx_vector
Definition: idx-vector.h:1022
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
float_format
Definition: mach-info.h:38
void mxArray
Definition: mex.h:58
T octave_idx_type m
Definition: mx-inlines.cc:781
int64_t mwIndex
Definition: mxtypes.h:125
@ mxREAL
Definition: mxtypes.h:80
int64_t mwSize
Definition: mxtypes.h:124
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:74
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:181
builtin_type_t
Definition: ov-base.h:83
#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
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