GNU Octave  4.4.1
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-2018 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
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License 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 <https://www.gnu.org/licenses/>.
21 
22 */
23 
24 // FIXME: Do not uncomment these lines to have this file included only once.
25 // The build will break (2/6/2016).
26 // #if ! defined (octave_ov_intx_h)
27 // #define octave_ov_intx_h 1
28 
29 #include "octave-config.h"
30 
31 #include <cstdlib>
32 
33 #include <iosfwd>
34 #include <string>
35 
36 #include "mx-base.h"
37 #include "str-vec.h"
38 
39 #include "error.h"
40 #include "mxarray.h"
41 #include "oct-stream.h"
42 #include "ov-base.h"
43 #include "ov-base-int.h"
44 #include "ov-typeinfo.h"
45 #include "errwarn.h"
46 
47 #include "ov-re-mat.h"
48 #include "ov-scalar.h"
49 
50 class
51 OCTINTERP_API
54 {
55 public:
56 
59 
62 
65  (intNDArray<OCTAVE_INT_T> (nda)) { }
66 
67  ~OCTAVE_VALUE_INT_MATRIX_T (void) = default;
68 
69  octave_base_value * clone (void) const
70  { return new OCTAVE_VALUE_INT_MATRIX_T (*this); }
71 
73  { return new OCTAVE_VALUE_INT_MATRIX_T (); }
74 
75  bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; }
76 
77  bool isinteger (void) const { return true; }
78 
79  builtin_type_t builtin_type (void) const { return OCTAVE_INT_BTYP; }
80 
81 public:
82 
84  int8_array_value (void) const { return int8NDArray (matrix); }
85 
87  int16_array_value (void) const { return int16NDArray (matrix); }
88 
90  int32_array_value (void) const { return int32NDArray (matrix); }
91 
93  int64_array_value (void) const { return int64NDArray (matrix); }
94 
96  uint8_array_value (void) const { return uint8NDArray (matrix); }
97 
99  uint16_array_value (void) const { return uint16NDArray (matrix); }
100 
102  uint32_array_value (void) const { return uint32NDArray (matrix); }
103 
105  uint64_array_value (void) const { return uint64NDArray (matrix); }
106 
107  double
108  double_value (bool = false) const
109  {
110  double retval = lo_ieee_nan_value ();
111 
112  if (isempty ())
113  err_invalid_conversion (type_name (), "real scalar");
114 
115  warn_implicit_conversion ("Octave:array-to-scalar",
116  type_name (), "real scalar");
117 
118  retval = matrix(0).double_value ();
119 
120  return retval;
121  }
122 
123  float
124  float_value (bool = false) const
125  {
126  float retval = lo_ieee_float_nan_value ();
127 
128  if (isempty ())
129  err_invalid_conversion (type_name (), "real scalar");
130 
131  warn_implicit_conversion ("Octave:array-to-scalar",
132  type_name (), "real scalar");
133 
134  retval = matrix(0).float_value ();
135 
136  return retval;
137  }
138 
139  double scalar_value (bool = false) const { return double_value (); }
140 
141  float float_scalar_value (bool = false) const { return float_value (); }
142 
143  Matrix
144  matrix_value (bool = false) const
145  {
146  Matrix retval;
147  dim_vector dv = dims ();
148  if (dv.ndims () > 2)
149  error ("invalid conversion of %s to Matrix", type_name ().c_str ());
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  {
164  dim_vector dv = dims ();
165  if (dv.ndims () > 2)
166  error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ());
167 
168  retval = FloatMatrix (dv(0), dv(1));
169  float *vec = retval.fortran_vec ();
170  octave_idx_type nel = matrix.numel ();
171  for (octave_idx_type i = 0; i < nel; i++)
172  vec[i] = matrix(i).float_value ();
173 
174  return retval;
175  }
176 
178  complex_matrix_value (bool = false) const
179  {
181  dim_vector dv = dims ();
182  if (dv.ndims () > 2)
183  error ("invalid conversion of %s to Matrix", type_name ().c_str ());
184 
185  retval = ComplexMatrix (dv(0), dv(1));
186  Complex *vec = retval.fortran_vec ();
187  octave_idx_type nel = matrix.numel ();
188  for (octave_idx_type i = 0; i < nel; i++)
189  vec[i] = Complex (matrix(i).double_value ());
190 
191  return retval;
192  }
193 
195  float_complex_matrix_value (bool = false) const
196  {
198  dim_vector dv = dims ();
199  if (dv.ndims () > 2)
200  error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ());
201 
202  retval = FloatComplexMatrix (dv(0), dv(1));
203  FloatComplex *vec = retval.fortran_vec ();
204  octave_idx_type nel = matrix.numel ();
205  for (octave_idx_type i = 0; i < nel; i++)
206  vec[i] = FloatComplex (matrix(i).float_value ());
207 
208  return retval;
209  }
210 
211  NDArray
212  array_value (bool = false) const
213  {
214  NDArray retval (matrix.dims ());
215  double *vec = retval.fortran_vec ();
216  octave_idx_type nel = matrix.numel ();
217  for (octave_idx_type i = 0; i < nel; i++)
218  vec[i] = matrix(i).double_value ();
219  return retval;
220  }
221 
223  float_array_value (bool = false) const
224  {
225  FloatNDArray retval (matrix.dims ());
226  float *vec = retval.fortran_vec ();
227  octave_idx_type nel = matrix.numel ();
228  for (octave_idx_type i = 0; i < nel; i++)
229  vec[i] = matrix(i).float_value ();
230  return retval;
231  }
232 
234  complex_array_value (bool = false) const
235  {
236  ComplexNDArray retval (matrix.dims ());
237  Complex *vec = retval.fortran_vec ();
238  octave_idx_type nel = matrix.numel ();
239  for (octave_idx_type i = 0; i < nel; i++)
240  vec[i] = Complex (matrix(i).double_value ());
241  return retval;
242  }
243 
245  float_complex_array_value (bool = false) const
246  {
248  FloatComplex *vec = retval.fortran_vec ();
249  octave_idx_type nel = matrix.numel ();
250  for (octave_idx_type i = 0; i < nel; i++)
251  vec[i] = FloatComplex (matrix(i).float_value ());
252  return retval;
253  }
254 
256  bool_array_value (bool warn = false) const
257  {
258  boolNDArray retval (dims ());
259 
260  octave_idx_type nel = numel ();
261 
262  if (warn && matrix.any_element_not_one_or_zero ())
264 
265  bool *vec = retval.fortran_vec ();
266  for (octave_idx_type i = 0; i < nel; i++)
267  vec[i] = matrix(i).bool_value ();
268 
269  return retval;
270  }
271 
273  char_array_value (bool = false) const
274  {
275  charNDArray retval (dims ());
276 
277  octave_idx_type nel = numel ();
278 
279  char *vec = retval.fortran_vec ();
280  for (octave_idx_type i = 0; i < nel; i++)
281  vec[i] = matrix(i).char_value ();
282 
283  return retval;
284  }
285 
286  // Use matrix_ref here to clear index cache.
287  void increment (void)
288  {
289  matrix_ref () += OCTAVE_INT_T (1);
290  }
291 
292  void decrement (void)
293  {
294  matrix_ref () -= OCTAVE_INT_T (1);
295  }
296 
297  void changesign (void)
298  {
299  matrix_ref ().changesign ();
300  }
301 
302  idx_vector index_vector (bool /* require_integers */ = false) const
303  {
304  return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix));
305  }
306 
307  int write (octave::stream& os, int block_size,
308  oct_data_conv::data_type output_type, int skip,
310  { return os.write (matrix, block_size, output_type, skip, flt_fmt); }
311 
312  // Unsafe. This function exists to support the MEX interface.
313  // You should not use it anywhere else.
314  void * mex_get_data (void) const { return matrix.mex_get_data (); }
315 
316  mxArray * as_mxArray (void) const
317  {
319 
320  OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *>
321  (retval->get_data ());
322 
323  mwSize nel = numel ();
324 
325  const OCTAVE_INT_T *p = matrix.data ();
326 
327  for (mwIndex i = 0; i < nel; i++)
328  pr[i] = p[i].value ();
329 
330  return retval;
331  }
332 
334  {
335  switch (umap)
336  {
337  case umap_abs:
338  return matrix.abs ();
339  case umap_signum:
340  return 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 matrix;
348  case umap_imag:
349  return intNDArray<OCTAVE_INT_T> (matrix.dims (), OCTAVE_INT_T ());
350  case umap_isnan:
351  case umap_isna:
352  case umap_isinf:
353  return boolNDArray (matrix.dims (), false);
354  case umap_isfinite:
355  return boolNDArray (matrix.dims (), true);
356 
357  // Special cases for Matlab compatibility.
358  case umap_xtolower:
359  case umap_xtoupper:
360  return 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, 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, 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 
426 
427  return tmp.do_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  {
499  if (dv.numel ())
500  retval(0) = scalar;
501  return retval;
502  }
503  else
504  {
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  {
573  retval(0) = Complex (scalar.double_value ());
574  return retval;
575  }
576 
578  float_complex_array_value (bool = false) const
579  {
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  idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (scalar); }
625 
626  int write (octave::stream& os, int block_size,
627  oct_data_conv::data_type output_type, int skip,
629  {
631  block_size, output_type, skip, flt_fmt);
632  }
633 
634  // Unsafe. This function exists to support the MEX interface.
635  // You should not use it anywhere else.
636  void * mex_get_data (void) const { return scalar.mex_get_data (); }
637 
638  mxArray * as_mxArray (void) const
639  {
641 
642  OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *>
643  (retval->get_data ());
644 
645  pr[0] = scalar.value ();
646 
647  return retval;
648  }
649 
651  {
652  switch (umap)
653  {
654  case umap_abs:
655  return scalar.abs ();
656  case umap_signum:
657  return scalar.signum ();
658  case umap_ceil:
659  case umap_conj:
660  case umap_fix:
661  case umap_floor:
662  case umap_real:
663  case umap_round:
664  return scalar;
665  case umap_imag:
666  return OCTAVE_INT_T ();
667  case umap_isnan:
668  case umap_isna:
669  case umap_isinf:
670  return false;
671  case umap_isfinite:
672  return true;
673 
674  // Special cases for Matlab compatibility.
675  case umap_xtolower:
676  case umap_xtoupper:
677  return scalar;
678 
679  default:
680  {
681  octave_scalar m (scalar_value ());
682  return m.map (umap);
683  }
684  }
685  }
686 
687  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
688  {
689  return save_hdf5_internal (loc_id, hdf5_save_type, name, flag);
690  }
691 
692  bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
693  {
694  return load_hdf5_internal (loc_id, hdf5_save_type, name);
695  }
696 
697 private:
698 
700 
702 };
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:6704
ComplexNDArray complex_array_value(bool=false) const
Definition: ov-intx.h:234
uint16NDArray uint16_array_value(void) const
Definition: ov-intx.h:99
octave_int< uint64_t > octave_uint64
int32NDArray int32_array_value(void) const
Definition: ov-intx.h:90
intNDArray< octave_int64 > int64NDArray
Definition: int64NDArray.h:33
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:650
float float_value(bool=false) const
Definition: ov-intx.h:514
octave_uint16 uint16_scalar_value(void) const
Definition: ov-intx.h:454
NDArray array_value(bool=false) const
Definition: ov-intx.h:212
characters Given a string matrix
Definition: hex2num.cc:155
OCTAVE_IDX_TYPE mwSize
Definition: mxarray.in.h:93
nd group nd example oindent but is performed more efficiently If only and it is a scalar
Definition: data.cc:5264
static octave_hdf5_id hdf5_save_type
Definition: ov-intx.h:699
int64NDArray int64_array_value(void) const
Definition: ov-intx.h:93
int32NDArray int32_array_value(void) const
Definition: ov-intx.h:471
void warn_logical_conversion(void)
Definition: errwarn.cc:359
uint8NDArray uint8_array_value(void) const
Definition: ov-intx.h:479
octave_value map(unary_mapper_t umap) const
Definition: ov-scalar.cc:367
intNDArray< octave_uint32 > uint32NDArray
Definition: uint32NDArray.h:33
octave_int8 int8_scalar_value(void) const
Definition: ov-intx.h:439
intNDArray< octave_uint8 > uint8NDArray
Definition: uint8NDArray.h:33
intNDArray< octave_uint16 > uint16NDArray
Definition: uint16NDArray.h:33
octave_uint8 uint8_scalar_value(void) const
Definition: ov-intx.h:451
octave_int< uint16_t > octave_uint16
octave_base_value * empty_clone(void) const
Definition: ov-intx.h:407
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:562
void error(const char *fmt,...)
Definition: error.cc:578
int8NDArray int8_array_value(void) const
Definition: ov-intx.h:463
ComplexMatrix complex_matrix_value(bool=false) const
Definition: ov-intx.h:538
charNDArray char_array_value(bool=false) const
Definition: ov-intx.h:607
octave::mach_info::float_format flt_fmt
Definition: load-save.cc:736
double double_value(bool=false) const
Definition: ov-intx.h:108
octave_uint32 uint32_scalar_value(void) const
Definition: ov-intx.h:457
int16NDArray int16_array_value(void) const
Definition: ov-intx.h:87
ComplexMatrix complex_matrix_value(bool=false) const
Definition: ov-intx.h:178
double lo_ieee_nan_value(void)
Definition: lo-ieee.cc:91
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition: ov-intx.h:578
uint16NDArray uint16_array_value(void) const
Definition: ov-intx.h:483
intNDArray< octave_int16 > int16NDArray
Definition: int16NDArray.h:33
octave_base_value * clone(void) const
Definition: ov-intx.h:404
builtin_type_t
Definition: ov-base.h:71
float float_value(bool=false) const
Definition: ov-intx.h:124
octave_base_value * empty_clone(void) const
Definition: ov-intx.h:72
#define OCTAVE_INT_T
Definition: ov-int16.h:28
bool OCTAVE_TYPE_PREDICATE_FUNCTION(void) const
Definition: ov-intx.h:75
boolNDArray bool_array_value(bool warn=false) const
Definition: ov-intx.h:594
octave_int64 int64_scalar_value(void) const
Definition: ov-intx.h:448
FloatMatrix float_matrix_value(bool=false) const
Definition: ov-intx.h:530
boolNDArray bool_array_value(bool warn=false) const
Definition: ov-intx.h:256
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Definition: ov-intx.h:195
uint8NDArray uint8_array_value(void) const
Definition: ov-intx.h:96
#define OCTAVE_VALUE_INT_SCALAR_T
Definition: ov-int16.h:33
Matrix matrix_value(bool=false) const
Definition: ov-intx.h:144
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:158
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:626
nd deftypefn *std::string name
Definition: sysdep.cc:647
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov-intx.h:377
bool bool_value(bool warn=false) const
Definition: ov-intx.h:585
intNDArray< octave_int8 > int8NDArray
Definition: int8NDArray.h:33
float float_scalar_value(bool=false) const
Definition: ov-intx.h:141
octave_uint64 uint64_scalar_value(void) const
Definition: ov-intx.h:460
Array< octave_value > array_value(void) const
Definition: ovl.h:86
uint64NDArray uint64_array_value(void) const
Definition: ov-intx.h:491
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:307
void * mex_get_data(void) const
Definition: ov-intx.h:636
double tmp
Definition: data.cc:6252
octave_value retval
Definition: data.cc:6246
OCTAVE_VALUE_INT_MATRIX_T(const Array< OCTAVE_INT_T > &nda)
Definition: ov-intx.h:63
int64_t octave_hdf5_id
builtin_type_t builtin_type(void) const
Definition: ov-intx.h:79
FloatMatrix float_matrix_value(bool=false) const
Definition: ov-intx.h:161
#define OCTAVE_VALUE_INT_MATRIX_T
Definition: ov-int16.h:30
octave_value map(unary_mapper_t umap) const
Definition: ov-re-mat.cc:900
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov-intx.h:410
Definition: dMatrix.h:36
idx_vector index_vector(bool=false) const
Definition: ov-intx.h:302
Matrix matrix_value(bool=false) const
Definition: ov-intx.h:522
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
Definition: sub2ind.cc:255
uint32NDArray uint32_array_value(void) const
Definition: ov-intx.h:487
uint32NDArray uint32_array_value(void) const
Definition: ov-intx.h:102
bool OCTAVE_TYPE_PREDICATE_FUNCTION(void) const
Definition: ov-intx.h:430
float lo_ieee_float_nan_value(void)
Definition: lo-ieee.cc:123
octave_int< uint32_t > octave_uint32
void mxArray
Definition: mex.h:55
#define OCTAVE_INT_MX_CLASS
Definition: ov-int16.h:38
mxArray * as_mxArray(void) const
Definition: ov-intx.h:638
NDArray array_value(bool=false) const
Definition: ov-intx.h:554
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_VALUE_INT_SCALAR_T(const OCTAVE_INT_T &nda)
Definition: ov-intx.h:399
N Dimensional Array with copy-on-write semantics.
Definition: Array.h:125
double scalar_value(bool=false) const
Definition: ov-intx.h:139
void * mex_get_data(void) const
Definition: ov-intx.h:314
intNDArray< octave_int32 > int32NDArray
Definition: int32NDArray.h:33
float float_scalar_value(bool=false) const
Definition: ov-intx.h:518
T::size_type numel(const T &str)
Definition: oct-string.cc:61
void err_invalid_conversion(const std::string &from, const std::string &to)
Definition: errwarn.cc:68
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:333
#define OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION
Definition: ov-int16.h:31
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:362
double scalar_value(bool=false) const
Definition: ov-intx.h:516
idx_vector index_vector(bool=false) const
Definition: ov-intx.h:624
p
Definition: lu.cc:138
charNDArray char_array_value(bool=false) const
Definition: ov-intx.h:273
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Definition: errwarn.cc:338
double double_value(bool=false) const
Definition: ov-intx.h:512
octave_int< int64_t > octave_int64
#define OCTAVE_INT_BTYP
Definition: ov-int16.h:40
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov-intx.h:692
mxArray * as_mxArray(void) const
Definition: ov-intx.h:316
bool isinteger(void) const
Definition: ov-intx.h:77
octave_base_value * clone(void) const
Definition: ov-intx.h:69
bool isinteger(void) const
Definition: ov-intx.h:432
octave_int16 int16_scalar_value(void) const
Definition: ov-intx.h:442
for i
Definition: data.cc:5264
std::complex< float > FloatComplex
Definition: oct-cmplx.h:32
octave_int< int16_t > octave_int16
int16NDArray int16_array_value(void) const
Definition: ov-intx.h:467
octave_idx_type ndims(void) const
Number of dimensions.
Definition: dim-vector.h:295
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
Definition: ov-intx.h:372
ComplexNDArray complex_array_value(bool=false) const
Definition: ov-intx.h:570
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:223
std::complex< double > Complex
Definition: oct-cmplx.h:31
static octave_hdf5_id hdf5_save_type
Definition: ov-intx.h:384
OCTAVE_VALUE_INT_MATRIX_T(void)
Definition: ov-intx.h:57
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition: ov-intx.h:245
OCTAVE_IDX_TYPE mwIndex
Definition: mxarray.in.h:94
octave_int< uint8_t > octave_uint8
uint64NDArray uint64_array_value(void) const
Definition: ov-intx.h:105
int8NDArray int8_array_value(void) const
Definition: ov-intx.h:84
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:87
octave_int< int32_t > octave_int32
int64NDArray int64_array_value(void) const
Definition: ov-intx.h:475
nd group nd example For each display the value
Definition: sysdep.cc:866
OCTAVE_VALUE_INT_MATRIX_T(const intNDArray< OCTAVE_INT_T > &nda)
Definition: ov-intx.h:60
dim_vector dv
Definition: sub2ind.cc:263
octave::stream os
Definition: file-io.cc:627
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
Definition: ov-intx.h:687
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Definition: ov-intx.h:546
octave_int< int8_t > octave_int8
intNDArray< octave_uint64 > uint64NDArray
Definition: uint64NDArray.h:33
builtin_type_t builtin_type(void) const
Definition: ov-intx.h:434