GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ov-intx.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2015 John W. Eaton
4 Copyright (C) 2010 VZLU Prague
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #include <cstdlib>
25 
26 #include <iosfwd>
27 #include <string>
28 
29 #include "mx-base.h"
30 #include "str-vec.h"
31 
32 #include "error.h"
33 #include "mxarray.h"
34 #include "oct-stream.h"
35 #include "ov-base.h"
36 #include "ov-base-int.h"
37 #include "ov-typeinfo.h"
38 #include "gripes.h"
39 
40 #include "ov-re-mat.h"
41 #include "ov-scalar.h"
42 
43 class
47 {
48 public:
49 
52 
55 
58  (intNDArray<OCTAVE_INT_T> (nda)) { }
59 
61 
62  octave_base_value *clone (void) const
63  { return new OCTAVE_VALUE_INT_MATRIX_T (*this); }
64 
66  { return new OCTAVE_VALUE_INT_MATRIX_T (); }
67 
68  bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; }
69 
70  bool is_integer_type (void) const { return true; }
71 
72  builtin_type_t builtin_type (void) const { return OCTAVE_INT_BTYP; }
73 
74 public:
75 
77  int8_array_value (void) const { return int8NDArray (matrix); }
78 
80  int16_array_value (void) const { return int16NDArray (matrix); }
81 
83  int32_array_value (void) const { return int32NDArray (matrix); }
84 
86  int64_array_value (void) const { return int64NDArray (matrix); }
87 
89  uint8_array_value (void) const { return uint8NDArray (matrix); }
90 
92  uint16_array_value (void) const { return uint16NDArray (matrix); }
93 
95  uint32_array_value (void) const { return uint32NDArray (matrix); }
96 
98  uint64_array_value (void) const { return uint64NDArray (matrix); }
99 
100  double
101  double_value (bool = false) const
102  {
103  double retval = lo_ieee_nan_value ();
104 
105  if (numel () > 0)
106  {
107  gripe_implicit_conversion ("Octave:array-to-scalar",
108  type_name (), "real scalar");
109 
110  retval = matrix(0).double_value ();
111  }
112  else
113  gripe_invalid_conversion (type_name (), "real scalar");
114 
115  return retval;
116 
117  }
118 
119  float
120  float_value (bool = false) const
121  {
122  float retval = lo_ieee_float_nan_value ();
123 
124  if (numel () > 0)
125  {
126  gripe_implicit_conversion ("Octave:array-to-scalar",
127  type_name (), "real scalar");
128 
129  retval = matrix(0).float_value ();
130  }
131  else
132  gripe_invalid_conversion (type_name (), "real scalar");
133 
134  return retval;
135 
136  }
137 
138  double scalar_value (bool = false) const { return double_value (); }
139 
140  float float_scalar_value (bool = false) const { return float_value (); }
141 
142  Matrix
143  matrix_value (bool = false) const
144  {
145  Matrix retval;
146  dim_vector dv = dims ();
147  if (dv.length () > 2)
148  error ("invalid conversion of %s to Matrix", type_name ().c_str ());
149  else
150  {
151  retval = Matrix (dv(0), dv(1));
152  double *vec = retval.fortran_vec ();
153  octave_idx_type nel = matrix.numel ();
154  for (octave_idx_type i = 0; i < nel; i++)
155  vec[i] = matrix(i).double_value ();
156  }
157  return retval;
158  }
159 
161  float_matrix_value (bool = false) const
162  {
163  FloatMatrix retval;
164  dim_vector dv = dims ();
165  if (dv.length () > 2)
166  error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ());
167  else
168  {
169  retval = FloatMatrix (dv(0), dv(1));
170  float *vec = retval.fortran_vec ();
171  octave_idx_type nel = matrix.numel ();
172  for (octave_idx_type i = 0; i < nel; i++)
173  vec[i] = matrix(i).float_value ();
174  }
175  return retval;
176  }
177 
179  complex_matrix_value (bool = false) const
180  {
181  ComplexMatrix retval;
182  dim_vector dv = dims ();
183  if (dv.length () > 2)
184  error ("invalid conversion of %s to Matrix", type_name ().c_str ());
185  else
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  {
199  FloatComplexMatrix retval;
200  dim_vector dv = dims ();
201  if (dv.length () > 2)
202  error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ());
203  else
204  {
205  retval = FloatComplexMatrix (dv(0), dv(1));
206  FloatComplex *vec = retval.fortran_vec ();
207  octave_idx_type nel = matrix.numel ();
208  for (octave_idx_type i = 0; i < nel; i++)
209  vec[i] = FloatComplex (matrix(i).float_value ());
210  }
211  return retval;
212  }
213 
214  NDArray
215  array_value (bool = false) const
216  {
217  NDArray retval (matrix.dims ());
218  double *vec = retval.fortran_vec ();
219  octave_idx_type nel = matrix.numel ();
220  for (octave_idx_type i = 0; i < nel; i++)
221  vec[i] = matrix(i).double_value ();
222  return retval;
223  }
224 
226  float_array_value (bool = false) const
227  {
228  FloatNDArray retval (matrix.dims ());
229  float *vec = retval.fortran_vec ();
230  octave_idx_type nel = matrix.numel ();
231  for (octave_idx_type i = 0; i < nel; i++)
232  vec[i] = matrix(i).float_value ();
233  return retval;
234  }
235 
237  complex_array_value (bool = false) const
238  {
239  ComplexNDArray retval (matrix.dims ());
240  Complex *vec = retval.fortran_vec ();
241  octave_idx_type nel = matrix.numel ();
242  for (octave_idx_type i = 0; i < nel; i++)
243  vec[i] = Complex (matrix(i).double_value ());
244  return retval;
245  }
246 
248  float_complex_array_value (bool = false) const
249  {
250  FloatComplexNDArray retval (matrix.dims ());
251  FloatComplex *vec = retval.fortran_vec ();
252  octave_idx_type nel = matrix.numel ();
253  for (octave_idx_type i = 0; i < nel; i++)
254  vec[i] = FloatComplex (matrix(i).float_value ());
255  return retval;
256  }
257 
259  bool_array_value (bool warn = false) const
260  {
261  boolNDArray retval (dims ());
262 
263  octave_idx_type nel = numel ();
264 
265  if (warn && matrix.any_element_not_one_or_zero ())
267 
268  bool *vec = retval.fortran_vec ();
269  for (octave_idx_type i = 0; i < nel; i++)
270  vec[i] = matrix(i).bool_value ();
271 
272  return retval;
273  }
274 
276  char_array_value (bool = false) const
277  {
278  charNDArray retval (dims ());
279 
280  octave_idx_type nel = numel ();
281 
282  char *vec = retval.fortran_vec ();
283  for (octave_idx_type i = 0; i < nel; i++)
284  vec[i] = matrix(i).char_value ();
285 
286  return retval;
287  }
288 
289  // Use matrix_ref here to clear index cache.
290  void increment (void)
291  {
292  matrix_ref () += OCTAVE_INT_T (1);
293  }
294 
295  void decrement (void)
296  {
297  matrix_ref () -= OCTAVE_INT_T (1);
298  }
299 
300  void changesign (void)
301  {
302  matrix_ref ().changesign ();
303  }
304 
305  idx_vector index_vector (bool /* require_integers */ = false) const
306  {
307  return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix));
308  }
309 
310  int write (octave_stream& os, int block_size,
311  oct_data_conv::data_type output_type, int skip,
312  oct_mach_info::float_format flt_fmt) const
313  { return os.write (matrix, block_size, output_type, skip, flt_fmt); }
314 
315  // Unsafe. This function exists to support the MEX interface.
316  // You should not use it anywhere else.
317  void *mex_get_data (void) const { return matrix.mex_get_data (); }
318 
319  mxArray *as_mxArray (void) const
320  {
321  mxArray *retval = new mxArray (OCTAVE_INT_MX_CLASS, dims (), mxREAL);
322 
323  OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *>
324  (retval->get_data ());
325 
326  mwSize nel = numel ();
327 
328  const OCTAVE_INT_T *p = matrix.data ();
329 
330  for (mwIndex i = 0; i < nel; i++)
331  pr[i] = p[i].value ();
332 
333  return retval;
334  }
335 
337  {
338  switch (umap)
339  {
340  case umap_abs:
341  return matrix.abs ();
342  case umap_signum:
343  return matrix.signum ();
344  case umap_ceil:
345  case umap_conj:
346  case umap_fix:
347  case umap_floor:
348  case umap_real:
349  case umap_round:
350  return matrix;
351  case umap_imag:
352  return intNDArray<OCTAVE_INT_T> (matrix.dims (), OCTAVE_INT_T ());
353  case umap_isnan:
354  case umap_isna:
355  case umap_isinf:
356  return boolNDArray (matrix.dims (), false);
357  case umap_finite:
358  return boolNDArray (matrix.dims (), true);
359 
360  // Special cases for Matlab compatibility.
361  case umap_xtolower:
362  case umap_xtoupper:
363  return matrix;
364 
365  default:
366  {
367  // FIXME: we should be able to do better than converting to
368  // double here.
369  octave_matrix m (array_value ());
370  return m.map (umap);
371  }
372  }
373  }
374 
375 private:
376 
377 
379 };
380 
381 class
385 {
386 public:
387 
390 
393 
395 
396  octave_base_value *clone (void) const
397  { return new OCTAVE_VALUE_INT_SCALAR_T (*this); }
398 
400  { return new OCTAVE_VALUE_INT_MATRIX_T (); }
401 
403  bool resize_ok = false)
404  {
405  // FIXME: this doesn't solve the problem of
406  //
407  // a = 1; a([1,1], [1,1], [1,1])
408  //
409  // and similar constructions. Hmm...
410 
411  // FIXME: using this constructor avoids narrowing the
412  // 1x1 matrix back to a scalar value. Need a better solution
413  // to this problem.
414 
415  octave_value tmp
418 
419  return tmp.do_index_op (idx, resize_ok);
420  }
421 
422  bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; }
423 
424  bool is_integer_type (void) const { return true; }
425 
426  builtin_type_t builtin_type (void) const { return OCTAVE_INT_BTYP; }
427 
428 public:
429 
431  int8_scalar_value (void) const { return octave_int8 (scalar); }
432 
434  int16_scalar_value (void) const { return octave_int16 (scalar); }
435 
437  int32_scalar_value (void) const { return octave_int32 (scalar); }
438 
440  int64_scalar_value (void) const { return octave_int64 (scalar); }
441 
443  uint8_scalar_value (void) const { return octave_uint8 (scalar); }
444 
446  uint16_scalar_value (void) const { return octave_uint16 (scalar); }
447 
449  uint32_scalar_value (void) const { return octave_uint32 (scalar); }
450 
452  uint64_scalar_value (void) const { return octave_uint64 (scalar); }
453 
455  int8_array_value (void) const
456  { return int8NDArray (dim_vector (1, 1), int8_scalar_value ()); }
457 
459  int16_array_value (void) const
460  { return int16NDArray (dim_vector (1, 1), int16_scalar_value ()); }
461 
463  int32_array_value (void) const
464  { return int32NDArray (dim_vector (1, 1), int32_scalar_value ()); }
465 
467  int64_array_value (void) const
468  { return int64NDArray (dim_vector (1, 1), int64_scalar_value ()); }
469 
471  uint8_array_value (void) const
472  { return uint8NDArray (dim_vector (1, 1), uint8_scalar_value ()); }
473 
475  uint16_array_value (void) const
476  { return uint16NDArray (dim_vector (1, 1), uint16_scalar_value ()); }
477 
479  uint32_array_value (void) const
480  { return uint32NDArray (dim_vector (1, 1), uint32_scalar_value ()); }
481 
483  uint64_array_value (void) const
484  { return uint64NDArray (dim_vector (1, 1), uint64_scalar_value ()); }
485 
486  octave_value resize (const dim_vector& dv, bool fill = false) const
487  {
488  if (fill)
489  {
490  intNDArray<OCTAVE_INT_T> retval (dv, 0);
491  if (dv.numel ())
492  retval(0) = scalar;
493  return retval;
494  }
495  else
496  {
497  intNDArray<OCTAVE_INT_T> retval (dv);
498  if (dv.numel ())
499  retval(0) = scalar;
500  return retval;
501  }
502  }
503 
504  double double_value (bool = false) const { return scalar.double_value (); }
505 
506  float float_value (bool = false) const { return scalar.float_value (); }
507 
508  double scalar_value (bool = false) const { return scalar.double_value (); }
509 
510  float float_scalar_value (bool = false) const
511  { return scalar.float_value (); }
512 
513  Matrix
514  matrix_value (bool = false) const
515  {
516  Matrix retval (1, 1);
517  retval(0,0) = scalar.double_value ();
518  return retval;
519  }
520 
522  float_matrix_value (bool = false) const
523  {
524  FloatMatrix retval (1, 1);
525  retval(0,0) = scalar.float_value ();
526  return retval;
527  }
528 
530  complex_matrix_value (bool = false) const
531  {
532  ComplexMatrix retval (1, 1);
533  retval(0,0) = Complex (scalar.double_value ());
534  return retval;
535  }
536 
538  float_complex_matrix_value (bool = false) const
539  {
540  FloatComplexMatrix retval (1, 1);
541  retval(0,0) = FloatComplex (scalar.float_value ());
542  return retval;
543  }
544 
545  NDArray
546  array_value (bool = false) const
547  {
548  NDArray retval (dim_vector (1, 1));
549  retval(0) = scalar.double_value ();
550  return retval;
551  }
552 
554  float_array_value (bool = false) const
555  {
556  FloatNDArray retval (dim_vector (1, 1));
557  retval(0) = scalar.float_value ();
558  return retval;
559  }
560 
562  complex_array_value (bool = false) const
563  {
564  ComplexNDArray retval (dim_vector (1, 1));
565  retval(0) = FloatComplex (scalar.double_value ());
566  return retval;
567  }
568 
570  float_complex_array_value (bool = false) const
571  {
572  FloatComplexNDArray retval (dim_vector (1, 1));
573  retval(0) = FloatComplex (scalar.float_value ());
574  return retval;
575  }
576 
577  bool bool_value (bool warn = false) const
578  {
579  if (warn && scalar != 0.0 && scalar != 1.0)
581 
582  return scalar.bool_value ();
583  }
584 
586  bool_array_value (bool warn = false) const
587  {
588  boolNDArray retval (dim_vector (1, 1));
589 
590  if (warn && scalar != 0.0 && scalar != 1.0)
592 
593  retval(0) = scalar.bool_value ();
594 
595  return retval;
596  }
597 
599  char_array_value (bool = false) const
600  {
601  charNDArray retval (dim_vector (1, 1));
602  retval(0) = scalar.char_value ();
603  return retval;
604  }
605 
606  void increment (void)
607  {
608  scalar += OCTAVE_INT_T (1);
609  }
610 
611  void decrement (void)
612  {
613  scalar -= OCTAVE_INT_T (1);
614  }
615 
616  idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (scalar); }
617 
618  int write (octave_stream& os, int block_size,
619  oct_data_conv::data_type output_type, octave_idx_type skip,
620  oct_mach_info::float_format flt_fmt) const
621  {
623  block_size, output_type, skip, flt_fmt);
624  }
625 
626  // Unsafe. This function exists to support the MEX interface.
627  // You should not use it anywhere else.
628  void *mex_get_data (void) const { return scalar.mex_get_data (); }
629 
630  mxArray *as_mxArray (void) const
631  {
632  mxArray *retval = new mxArray (OCTAVE_INT_MX_CLASS, 1, 1, mxREAL);
633 
634  OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *>
635  (retval->get_data ());
636 
637  pr[0] = scalar.value ();
638 
639  return retval;
640  }
641 
643  {
644  switch (umap)
645  {
646  case umap_abs:
647  return scalar.abs ();
648  case umap_signum:
649  return scalar.signum ();
650  case umap_ceil:
651  case umap_conj:
652  case umap_fix:
653  case umap_floor:
654  case umap_real:
655  case umap_round:
656  return scalar;
657  case umap_imag:
658  return OCTAVE_INT_T ();
659  case umap_isnan:
660  case umap_isna:
661  case umap_isinf:
662  return false;
663  case umap_finite:
664  return true;
665 
666  // Special cases for Matlab compatibility.
667  case umap_xtolower:
668  case umap_xtoupper:
669  return scalar;
670 
671  default:
672  {
673  octave_scalar m (scalar_value ());
674  return m.map (umap);
675  }
676  }
677  }
678 
679 private:
680 
681 
683 };
void gripe_implicit_conversion(const char *id, const char *from, const char *to)
Definition: gripes.cc:180
octave_int< uint32_t > octave_uint32
double double_value(bool=false) const
Definition: ov-intx.h:101
float float_scalar_value(bool=false) const
Definition: ov-intx.h:140
builtin_type_t builtin_type(void) const
Definition: ov-intx.h:426
void * mex_get_data(void) const
Definition: ov-intx.h:317
bool bool_value(bool warn=false) const
Definition: ov-intx.h:577
double double_value(bool=false) const
Definition: ov-intx.h:504
intNDArray< octave_int64 > int64NDArray
Definition: int64NDArray.h:31
FloatMatrix float_matrix_value(bool=false) const
Definition: ov-intx.h:522
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:554
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition: ov-intx.h:248
uint16NDArray uint16_array_value(void) const
Definition: ov-intx.h:92
int write(octave_stream &os, int block_size, oct_data_conv::data_type output_type, octave_idx_type skip, oct_mach_info::float_format flt_fmt) const
Definition: ov-intx.h:618
intNDArray< octave_uint32 > uint32NDArray
Definition: uint32NDArray.h:31
double scalar_value(bool=false) const
Definition: ov-intx.h:508
intNDArray< octave_uint8 > uint8NDArray
Definition: uint8NDArray.h:31
intNDArray< octave_uint16 > uint16NDArray
Definition: uint16NDArray.h:31
ComplexMatrix complex_matrix_value(bool=false) const
Definition: ov-intx.h:530
~OCTAVE_VALUE_INT_SCALAR_T(void)
Definition: ov-intx.h:394
void error(const char *fmt,...)
Definition: error.cc:476
bool is_integer_type(void) const
Definition: ov-intx.h:424
octave_int< int16_t > octave_int16
void * get_data(void) const
Definition: mxarray.h:433
bool OCTAVE_TYPE_PREDICATE_FUNCTION(void) const
Definition: ov-intx.h:68
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:336
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition: ov-intx.h:570
ComplexNDArray complex_array_value(bool=false) const
Definition: ov-intx.h:237
uint8NDArray uint8_array_value(void) const
Definition: ov-intx.h:89
double lo_ieee_nan_value(void)
Definition: lo-ieee.cc:126
intNDArray< octave_int16 > int16NDArray
Definition: int16NDArray.h:31
uint8NDArray uint8_array_value(void) const
Definition: ov-intx.h:471
uint32NDArray uint32_array_value(void) const
Definition: ov-intx.h:479
builtin_type_t
Definition: ov-base.h:59
octave_value map(unary_mapper_t umap) const
Definition: ov-scalar.cc:297
#define OCTAVE_INT_T
Definition: ov-int16.h:26
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:361
octave_value signum(void) const
Definition: ov.h:1197
ComplexNDArray complex_array_value(bool=false) const
Definition: ov-intx.h:562
int8NDArray int8_array_value(void) const
Definition: ov-intx.h:455
builtin_type_t builtin_type(void) const
Definition: ov-intx.h:72
octave_uint32 uint32_scalar_value(void) const
Definition: ov-intx.h:449
octave_value map(unary_mapper_t umap) const
Definition: ov-re-mat.cc:878
octave_int< int32_t > octave_int32
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Definition: ov-intx.h:197
void * mex_get_data(void) const
Definition: ov-intx.h:628
#define OCTAVE_VALUE_INT_SCALAR_T
Definition: ov-int16.h:31
uint64NDArray uint64_array_value(void) const
Definition: ov-intx.h:483
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:142
octave_int< uint16_t > octave_uint16
int64NDArray int64_array_value(void) const
Definition: ov-intx.h:86
#define OCTINTERP_API
Definition: mexproto.h:66
NDArray array_value(bool=false) const
Definition: ov-intx.h:215
intNDArray< octave_int8 > int8NDArray
Definition: int8NDArray.h:31
octave_base_value * clone(void) const
Definition: ov-intx.h:62
octave_uint16 uint16_scalar_value(void) const
Definition: ov-intx.h:446
octave_uint64 uint64_scalar_value(void) const
Definition: ov-intx.h:452
float float_value(bool=false) const
Definition: ov-intx.h:506
~OCTAVE_VALUE_INT_MATRIX_T(void)
Definition: ov-intx.h:60
int32NDArray int32_array_value(void) const
Definition: ov-intx.h:463
octave_int< int64_t > octave_int64
int write(octave_stream &os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const
Definition: ov-intx.h:310
ComplexMatrix complex_matrix_value(bool=false) const
Definition: ov-intx.h:179
uint16NDArray uint16_array_value(void) const
Definition: ov-intx.h:475
int8NDArray int8_array_value(void) const
Definition: ov-intx.h:77
Matrix matrix_value(bool=false) const
Definition: ov-intx.h:514
Matrix matrix_value(bool=false) const
Definition: ov-intx.h:143
int64NDArray int64_array_value(void) const
Definition: ov-intx.h:467
OCTAVE_VALUE_INT_MATRIX_T(const Array< OCTAVE_INT_T > &nda)
Definition: ov-intx.h:56
octave_value abs(void) const
Definition: ov.h:1158
bool OCTAVE_TYPE_PREDICATE_FUNCTION(void) const
Definition: ov-intx.h:422
#define OCTAVE_VALUE_INT_MATRIX_T
Definition: ov-int16.h:28
octave_int< uint64_t > octave_uint64
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov-intx.h:402
Definition: dMatrix.h:35
octave_base_value * empty_clone(void) const
Definition: ov-intx.h:399
octave_int32 int32_scalar_value(void) const
Definition: ov-intx.h:437
octave_int16 int16_scalar_value(void) const
Definition: ov-intx.h:434
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Definition: ov-intx.h:538
float lo_ieee_float_nan_value(void)
Definition: lo-ieee.cc:202
float float_value(bool=false) const
Definition: ov-intx.h:120
mxArray * as_mxArray(void) const
Definition: ov-intx.h:630
void mxArray
Definition: mex.h:53
#define OCTAVE_INT_MX_CLASS
Definition: ov-int16.h:36
octave_int8 int8_scalar_value(void) const
Definition: ov-intx.h:431
FloatMatrix float_matrix_value(bool=false) const
Definition: ov-intx.h:161
OCTAVE_VALUE_INT_SCALAR_T(const OCTAVE_INT_T &nda)
Definition: ov-intx.h:391
NDArray array_value(bool=false) const
Definition: ov-intx.h:546
boolNDArray bool_array_value(bool warn=false) const
Definition: ov-intx.h:259
intNDArray< octave_int32 > int32NDArray
Definition: int32NDArray.h:31
boolNDArray bool_array_value(bool warn=false) const
Definition: ov-intx.h:586
void gripe_logical_conversion(void)
Definition: gripes.cc:201
float float_scalar_value(bool=false) const
Definition: ov-intx.h:510
#define OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION
Definition: ov-int16.h:29
void gripe_invalid_conversion(const std::string &from, const std::string &to)
Definition: gripes.cc:99
uint32NDArray uint32_array_value(void) const
Definition: ov-intx.h:95
octave_idx_type write(const octave_value &data, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, oct_mach_info::float_format flt_fmt)
Definition: oct-stream.cc:3546
#define OCTAVE_INT_BTYP
Definition: ov-int16.h:38
int16NDArray int16_array_value(void) const
Definition: ov-intx.h:80
octave_base_value * clone(void) const
Definition: ov-intx.h:396
octave_value resize(const dim_vector &dv, bool fill=false) const
Definition: ov-intx.h:486
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:226
charNDArray char_array_value(bool=false) const
Definition: ov-intx.h:276
bool is_integer_type(void) const
Definition: ov-intx.h:70
std::complex< float > FloatComplex
Definition: oct-cmplx.h:30
int16NDArray int16_array_value(void) const
Definition: ov-intx.h:459
charNDArray char_array_value(bool=false) const
Definition: ov-intx.h:599
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:642
Definition: mxarray.h:52
std::complex< double > Complex
Definition: oct-cmplx.h:29
const T * fortran_vec(void) const
Definition: Array.h:481
OCTAVE_VALUE_INT_MATRIX_T(void)
Definition: ov-intx.h:50
octave_int< uint8_t > octave_uint8
octave_int64 int64_scalar_value(void) const
Definition: ov-intx.h:440
octave_int< int8_t > octave_int8
int length(void) const
Definition: dim-vector.h:281
OCTAVE_VALUE_INT_MATRIX_T(const intNDArray< OCTAVE_INT_T > &nda)
Definition: ov-intx.h:53
octave_uint8 uint8_scalar_value(void) const
Definition: ov-intx.h:443
idx_vector index_vector(bool=false) const
Definition: ov-intx.h:616
int32NDArray int32_array_value(void) const
Definition: ov-intx.h:83
mxArray * as_mxArray(void) const
Definition: ov-intx.h:319
uint64NDArray uint64_array_value(void) const
Definition: ov-intx.h:98
double scalar_value(bool=false) const
Definition: ov-intx.h:138
idx_vector index_vector(bool=false) const
Definition: ov-intx.h:305
static bool scalar(const dim_vector &dims)
Definition: ov-struct.cc:736
intNDArray< octave_uint64 > uint64NDArray
Definition: uint64NDArray.h:31
octave_base_value * empty_clone(void) const
Definition: ov-intx.h:65
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov.h:438