GNU Octave  8.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-2023 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 (m_matrix); }
87 
89  int16_array_value (void) const { return int16NDArray (m_matrix); }
90 
92  int32_array_value (void) const { return int32NDArray (m_matrix); }
93 
95  int64_array_value (void) const { return int64NDArray (m_matrix); }
96 
98  uint8_array_value (void) const { return uint8NDArray (m_matrix); }
99 
101  uint16_array_value (void) const { return uint16NDArray (m_matrix); }
102 
104  uint32_array_value (void) const { return uint32NDArray (m_matrix); }
105 
107  uint64_array_value (void) 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 (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  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 
385 
387 };
388 
389 class
390 OCTINTERP_API
393 {
394 public:
395 
398 
401 
402  ~OCTAVE_VALUE_INT_SCALAR_T (void) = default;
403 
404  octave_base_value * clone (void) const
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 (void) const { return true; }
431 
432  bool isinteger (void) const { return true; }
433 
434  builtin_type_t builtin_type (void) const { return OCTAVE_INT_BTYP; }
435 
436 public:
437 
439  int8_scalar_value (void) const { return octave_int8 (scalar); }
440 
442  int16_scalar_value (void) const { return octave_int16 (scalar); }
443 
445  int32_scalar_value (void) const { return octave_int32 (scalar); }
446 
448  int64_scalar_value (void) const { return octave_int64 (scalar); }
449 
451  uint8_scalar_value (void) const { return octave_uint8 (scalar); }
452 
454  uint16_scalar_value (void) const { return octave_uint16 (scalar); }
455 
457  uint32_scalar_value (void) const { return octave_uint32 (scalar); }
458 
460  uint64_scalar_value (void) const { return octave_uint64 (scalar); }
461 
463  int8_array_value (void) const
464  { return int8NDArray (dim_vector (1, 1), int8_scalar_value ()); }
465 
467  int16_array_value (void) const
468  { return int16NDArray (dim_vector (1, 1), int16_scalar_value ()); }
469 
471  int32_array_value (void) const
472  { return int32NDArray (dim_vector (1, 1), int32_scalar_value ()); }
473 
475  int64_array_value (void) const
476  { return int64NDArray (dim_vector (1, 1), int64_scalar_value ()); }
477 
479  uint8_array_value (void) const
480  { return uint8NDArray (dim_vector (1, 1), uint8_scalar_value ()); }
481 
483  uint16_array_value (void) const
484  { return uint16NDArray (dim_vector (1, 1), uint16_scalar_value ()); }
485 
487  uint32_array_value (void) const
488  { return uint32NDArray (dim_vector (1, 1), uint32_scalar_value ()); }
489 
491  uint64_array_value (void) const
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 (void)
615  {
616  scalar += OCTAVE_INT_T (1);
617  }
618 
619  void decrement (void)
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 
698 
700 };
N Dimensional Array with copy-on-write semantics.
Definition: Array.h:130
OCTARRAY_API T * fortran_vec(void)
Size of the specified dimension.
Definition: Array-base.cc:1766
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(void) const
Number of dimensions.
Definition: dim-vector.h:257
void * get_data(void) const
Definition: mxarray.h:497
octave::idx_vector index_vector(bool=false) const
Definition: ov-intx.h:304
builtin_type_t builtin_type(void) const
Definition: ov-intx.h:81
mxArray * as_mxArray(bool interleaved) const
Definition: ov-intx.h:315
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
static octave_hdf5_id s_hdf5_save_type
Definition: ov-intx.h:384
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: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
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:372
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
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
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:377
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
Matrix matrix_value(bool=false) const
Definition: ov-intx.h:522
static octave_hdf5_id s_hdf5_save_type
Definition: ov-intx.h:697
octave_uint32 uint32_scalar_value(void) const
Definition: ov-intx.h:457
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov-intx.h:410
int8NDArray int8_array_value(void) const
Definition: ov-intx.h:463
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:562
int32NDArray int32_array_value(void) const
Definition: ov-intx.h:471
uint64NDArray uint64_array_value(void) const
Definition: ov-intx.h:491
void increment(void)
Definition: ov-intx.h:614
octave_base_value * empty_clone(void) const
Definition: ov-intx.h:407
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
void decrement(void)
Definition: ov-intx.h:619
int64NDArray int64_array_value(void) const
Definition: ov-intx.h:475
uint8NDArray uint8_array_value(void) const
Definition: ov-intx.h:479
octave_int8 int8_scalar_value(void) const
Definition: ov-intx.h:439
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(void) const
Definition: ov-intx.h:454
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
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
octave_base_value * clone(void) const
Definition: ov-intx.h:404
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_uint8 uint8_scalar_value(void) const
Definition: ov-intx.h:451
octave_int64 int64_scalar_value(void) const
Definition: ov-intx.h:448
builtin_type_t builtin_type(void) const
Definition: ov-intx.h:434
int16NDArray int16_array_value(void) const
Definition: ov-intx.h:467
uint32NDArray uint32_array_value(void) const
Definition: ov-intx.h:487
float float_scalar_value(bool=false) const
Definition: ov-intx.h:518
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:648
octave_uint64 uint64_scalar_value(void) const
Definition: ov-intx.h:460
bool isinteger(void) const
Definition: ov-intx.h:432
uint16NDArray uint16_array_value(void) const
Definition: ov-intx.h:483
octave_value resize(const dim_vector &dv, bool fill=false) const
Definition: ov-intx.h:494
octave_int32 int32_scalar_value(void) const
Definition: ov-intx.h:445
octave_int16 int16_scalar_value(void) const
Definition: ov-intx.h:442
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 signum(void) const
Definition: ov.h:1610
octave_value index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov.h:550
octave_value abs(void) const
Definition: ov.h:1571
void error(const char *fmt,...)
Definition: error.cc:979
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
octave::idx_vector idx_vector
Definition: idx-vector.h:1039
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
class OCTAVE_API boolNDArray
Definition: mx-fwd.h:42
class OCTAVE_API Matrix
Definition: mx-fwd.h:31
class OCTAVE_API ComplexMatrix
Definition: mx-fwd.h:32
class OCTAVE_API FloatComplexMatrix
Definition: mx-fwd.h:34
class OCTAVE_API FloatMatrix
Definition: mx-fwd.h:33
T octave_idx_type m
Definition: mx-inlines.cc:773
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: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
static bool scalar(const dim_vector &dims)
Definition: ov-struct.cc:679
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