GNU Octave  4.2.1
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-base-int.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2017 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 // This file should not include config.h. It is only included in other
24 // C++ source files that should have included config.h before including
25 // this file.
26 
27 #include <iostream>
28 #include <limits>
29 #include <vector>
30 
31 #include "dNDArray.h"
32 #include "fNDArray.h"
33 #include "int8NDArray.h"
34 #include "int16NDArray.h"
35 #include "int32NDArray.h"
36 #include "int64NDArray.h"
37 #include "uint8NDArray.h"
38 #include "uint16NDArray.h"
39 #include "uint32NDArray.h"
40 #include "uint64NDArray.h"
41 
42 #include "lo-ieee.h"
43 #include "lo-utils.h"
44 #include "mx-base.h"
45 #include "quit.h"
46 #include "oct-locbuf.h"
47 
48 #include "defun.h"
49 #include "errwarn.h"
50 #include "ovl.h"
51 #include "oct-lvalue.h"
52 #include "oct-hdf5.h"
53 #include "oct-stream.h"
54 #include "ops.h"
55 #include "ov-base.h"
56 #include "ov-base-mat.h"
57 #include "ov-base-mat.cc"
58 #include "ov-base-scalar.h"
59 #include "ov-base-scalar.cc"
60 #include "ov-base-int.h"
61 #include "ov-int-traits.h"
62 #include "pr-output.h"
63 #include "variables.h"
64 
65 #include "byte-swap.h"
66 #include "ls-oct-text.h"
67 #include "ls-utils.h"
68 #include "ls-hdf5.h"
69 
70 // We have all the machinery below (octave_base_int_helper and
71 // octave_base_int_helper_traits) to avoid a few warnings from GCC
72 // about comparisons always false due to limited range of data types.
73 // Ugh. The cure may be worse than the disease.
74 
75 template <typename T, bool is_signed = true, bool can_be_too_big = true>
77 {
78  static bool
80  {
81  return val < 0 || val > std::numeric_limits<unsigned char>::max ();
82  }
83 };
84 
85 template <typename T>
87 {
88  static bool char_value_out_of_range (T) { return false; }
89 };
90 
91 template <typename T>
92 struct octave_base_int_helper<T, false, true>
93 {
94  static bool char_value_out_of_range (T val)
95  {
97  }
98 };
99 
100 template <typename T>
102 {
103  static bool char_value_out_of_range (T val) { return val < 0; }
104 };
105 
106 // For all types other than char, signed char, and unsigned char, we
107 // assume that the upper limit for the range of allowable values is
108 // larger than the range for unsigned char. If that's not true, we
109 // are still OK, but will see the warnings again for any other types
110 // that do not meet this assumption.
111 
112 template <typename T>
114 {
115  static const bool can_be_larger_than_uchar_max = true;
116 };
117 
118 template <>
120 {
121  static const bool can_be_larger_than_uchar_max = false;
122 };
123 
124 template <>
125 struct octave_base_int_helper_traits<signed char>
126 {
127  static const bool can_be_larger_than_uchar_max = false;
128 };
129 
130 template <>
131 struct octave_base_int_helper_traits<unsigned char>
132 {
133  static const bool can_be_larger_than_uchar_max = false;
134 };
135 
136 template <typename T>
139 {
141 
142  if (this->matrix.numel () == 1)
143  retval = new typename octave_value_int_traits<T>::scalar_type
144  (this->matrix (0));
145 
146  return retval;
147 }
148 
149 template <typename T>
152 {
154  dim_vector dv = this->dims ();
155  octave_idx_type nel = dv.numel ();
156 
157  charNDArray chm (dv);
158 
159  bool warned = false;
160 
161  for (octave_idx_type i = 0; i < nel; i++)
162  {
163  octave_quit ();
164 
165  typename T::element_type tmp = this->matrix(i);
166 
167  typedef typename T::element_type::val_type val_type;
168 
169  val_type ival = tmp.value ();
170 
171  static const bool is_signed = std::numeric_limits<val_type>::is_signed;
172  static const bool can_be_larger_than_uchar_max
174 
175  if (octave_base_int_helper<val_type, is_signed,
176  can_be_larger_than_uchar_max>::char_value_out_of_range (ival))
177  {
178  // FIXME: is there something better we could do?
179 
180  ival = 0;
181 
182  if (! warned)
183  {
184  ::warning ("range error for conversion to character value");
185  warned = true;
186  }
187  }
188  else
189  chm (i) = static_cast<char> (ival);
190  }
191 
192  retval = octave_value (chm, type);
193 
194  return retval;
195 }
196 
197 template <typename MT>
200 {
201  return NDArray (this->matrix);
202 }
203 
204 template <typename MT>
207 {
208  return FloatNDArray (this->matrix);
209 }
210 
211 template <typename MT>
214 {
215  return int8NDArray (this->matrix);
216 }
217 
218 template <typename MT>
221 {
222  return int16NDArray (this->matrix);
223 }
224 
225 template <typename MT>
228 {
229  return int32NDArray (this->matrix);
230 }
231 
232 template <typename MT>
235 {
236  return int64NDArray (this->matrix);
237 }
238 
239 template <typename MT>
242 {
243  return uint8NDArray (this->matrix);
244 }
245 
246 template <typename MT>
249 {
250  return uint16NDArray (this->matrix);
251 }
252 
253 template <typename MT>
256 {
257  return uint32NDArray (this->matrix);
258 }
259 
260 template <typename MT>
263 {
264  return uint64NDArray (this->matrix);
265 }
266 
267 template <typename T>
268 bool
270 {
271  dim_vector dv = this->dims ();
272 
273  os << "# ndims: " << dv.ndims () << "\n";
274 
275  for (int i = 0; i < dv.ndims (); i++)
276  os << " " << dv(i);
277 
278  os << "\n" << this->matrix;
279 
280  return true;
281 }
282 
283 template <typename T>
284 bool
286 {
287  int mdims = 0;
288 
289  if (! extract_keyword (is, "ndims", mdims, true))
290  error ("load: failed to extract number of dimensions");
291 
292  if (mdims < 0)
293  error ("load: failed to extract number of rows and columns");
294 
295  dim_vector dv;
296  dv.resize (mdims);
297 
298  for (int i = 0; i < mdims; i++)
299  is >> dv(i);
300 
301  T tmp(dv);
302 
303  is >> tmp;
304 
305  if (! is)
306  error ("load: failed to load matrix constant");
307 
308  this->matrix = tmp;
309 
310  return true;
311 }
312 
313 template <typename T>
314 bool
315 octave_base_int_matrix<T>::save_binary (std::ostream& os, bool&)
316 {
317  dim_vector dv = this->dims ();
318  if (dv.ndims () < 1)
319  return false;
320 
321  // Use negative value for ndims to differentiate with old format!!
322  int32_t tmp = - dv.ndims ();
323  os.write (reinterpret_cast<char *> (&tmp), 4);
324  for (int i=0; i < dv.ndims (); i++)
325  {
326  tmp = dv(i);
327  os.write (reinterpret_cast<char *> (&tmp), 4);
328  }
329 
330  os.write (reinterpret_cast<const char *> (this->matrix.data ()),
331  this->byte_size ());
332 
333  return true;
334 }
335 
336 template <typename T>
337 bool
340 {
341  int32_t mdims;
342  if (! is.read (reinterpret_cast<char *> (&mdims), 4))
343  return false;
344  if (swap)
345  swap_bytes<4> (&mdims);
346  if (mdims >= 0)
347  return false;
348 
349  mdims = - mdims;
350  int32_t di;
351  dim_vector dv;
352  dv.resize (mdims);
353 
354  for (int i = 0; i < mdims; i++)
355  {
356  if (! is.read (reinterpret_cast<char *> (&di), 4))
357  return false;
358  if (swap)
359  swap_bytes<4> (&di);
360  dv(i) = di;
361  }
362 
363  // Convert an array with a single dimension to be a row vector.
364  // Octave should never write files like this, other software
365  // might.
366 
367  if (mdims == 1)
368  {
369  mdims = 2;
370  dv.resize (mdims);
371  dv(1) = dv(0);
372  dv(0) = 1;
373  }
374 
375  T m (dv);
376 
377  if (! is.read (reinterpret_cast<char *> (m.fortran_vec ()), m.byte_size ()))
378  return false;
379 
380  if (swap)
381  {
382  int nel = dv.numel ();
383  int bytes = nel / m.byte_size ();
384  for (int i = 0; i < nel; i++)
385  switch (bytes)
386  {
387  case 8:
388  swap_bytes<8> (&m(i));
389  break;
390  case 4:
391  swap_bytes<4> (&m(i));
392  break;
393  case 2:
394  swap_bytes<2> (&m(i));
395  break;
396  case 1:
397  default:
398  break;
399  }
400  }
401 
402  this->matrix = m;
403  return true;
404 }
405 
406 template <typename T>
407 bool
409  bool)
410 {
411  bool retval = false;
412 
413 #if defined (HAVE_HDF5)
414 
415  hid_t save_type_hid = HDF5_SAVE_TYPE;
416  dim_vector dv = this->dims ();
417  int empty = save_hdf5_empty (loc_id, name, dv);
418  if (empty)
419  return (empty > 0);
420 
421  int rank = dv.ndims ();
422  hid_t space_hid, data_hid;
423  space_hid = data_hid = -1;
424  OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
425 
426  // Octave uses column-major, while HDF5 uses row-major ordering
427  for (int i = 0; i < rank; i++)
428  hdims[i] = dv(rank-i-1);
429 
430  space_hid = H5Screate_simple (rank, hdims, 0);
431 
432  if (space_hid < 0) return false;
433 #if defined (HAVE_HDF5_18)
434  data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
436 #else
437  data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
439 #endif
440  if (data_hid < 0)
441  {
442  H5Sclose (space_hid);
443  return false;
444  }
445 
446  retval = H5Dwrite (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
447  octave_H5P_DEFAULT, this->matrix.data ()) >= 0;
448 
449  H5Dclose (data_hid);
450  H5Sclose (space_hid);
451 
452 #else
453  octave_unused_parameter (loc_id);
454  octave_unused_parameter (name);
455 
456  this->warn_save ("hdf5");
457 #endif
458 
459  return retval;
460 }
461 
462 template <typename T>
463 bool
465 {
466  bool retval = false;
467 
468 #if defined (HAVE_HDF5)
469 
470  hid_t save_type_hid = HDF5_SAVE_TYPE;
471  dim_vector dv;
472  int empty = load_hdf5_empty (loc_id, name, dv);
473  if (empty > 0)
474  this->matrix.resize (dv);
475  if (empty)
476  return (empty > 0);
477 
478 #if defined (HAVE_HDF5_18)
479  hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT);
480 #else
481  hid_t data_hid = H5Dopen (loc_id, name);
482 #endif
483  hid_t space_id = H5Dget_space (data_hid);
484 
485  hsize_t rank = H5Sget_simple_extent_ndims (space_id);
486 
487  if (rank < 1)
488  {
489  H5Sclose (space_id);
490  H5Dclose (data_hid);
491  return false;
492  }
493 
494  OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
495  OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank);
496 
497  H5Sget_simple_extent_dims (space_id, hdims, maxdims);
498 
499  // Octave uses column-major, while HDF5 uses row-major ordering
500  if (rank == 1)
501  {
502  dv.resize (2);
503  dv(0) = 1;
504  dv(1) = hdims[0];
505  }
506  else
507  {
508  dv.resize (rank);
509  for (hsize_t i = 0, j = rank - 1; i < rank; i++, j--)
510  dv(j) = hdims[i];
511  }
512 
513  T m (dv);
514  if (H5Dread (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
515  octave_H5P_DEFAULT, m.fortran_vec ()) >= 0)
516  {
517  retval = true;
518  this->matrix = m;
519  }
520 
521  H5Sclose (space_id);
522  H5Dclose (data_hid);
523 
524 #else
525  octave_unused_parameter (loc_id);
526  octave_unused_parameter (name);
527 
528  this->warn_load ("hdf5");
529 #endif
530 
531  return retval;
532 }
533 
534 template <typename T>
535 void
537  bool pr_as_read_syntax) const
538 {
539  octave_print_internal (os, this->matrix, pr_as_read_syntax,
540  this->current_print_indent_level ());
541 }
542 
543 template <typename T>
546 {
548 
549  T tmp = this->scalar;
550 
551  typedef typename T::val_type val_type;
552 
553  val_type ival = tmp.value ();
554 
555  static const bool is_signed = std::numeric_limits<val_type>::is_signed;
556  static const bool can_be_larger_than_uchar_max
558 
559  if (octave_base_int_helper<val_type, is_signed,
560  can_be_larger_than_uchar_max>::char_value_out_of_range (ival))
561  {
562  // FIXME: is there something better we could do?
563 
564  ival = 0;
565 
566  ::warning ("range error for conversion to character value");
567  }
568  else
569  retval = octave_value (std::string (1, static_cast<char> (ival)), type);
570 
571  return retval;
572 }
573 
574 template <typename T>
577 {
578  return static_cast<double> (this->scalar);
579 }
580 
581 template <typename T>
584 {
585  return static_cast<float> (this->scalar);
586 }
587 
588 template <typename T>
591 {
592  return octave_int8 (this->scalar);
593 }
594 
595 template <typename T>
598 {
599  return octave_int16 (this->scalar);
600 }
601 
602 template <typename T>
605 {
606  return octave_int32 (this->scalar);
607 }
608 
609 template <typename T>
612 {
613  return octave_int64 (this->scalar);
614 }
615 
616 template <typename T>
619 {
620  return octave_uint8 (this->scalar);
621 }
622 
623 template <typename T>
626 {
627  return octave_uint16 (this->scalar);
628 }
629 
630 template <typename T>
633 {
634  return octave_uint32 (this->scalar);
635 }
636 
637 template <typename T>
640 {
641  return octave_uint64 (this->scalar);
642 }
643 
644 template <typename T>
645 bool
647 {
648  os << this->scalar << "\n";
649  return true;
650 }
651 
652 template <typename T>
653 bool
655 {
656  is >> this->scalar;
657  if (! is)
658  error ("load: failed to load scalar constant");
659 
660  return true;
661 }
662 
663 template <typename T>
664 bool
665 octave_base_int_scalar<T>::save_binary (std::ostream& os, bool&)
666 {
667  os.write (reinterpret_cast<char *> (&(this->scalar)), this->byte_size ());
668  return true;
669 }
670 
671 template <typename T>
672 bool
675 {
676  T tmp;
677  if (! is.read (reinterpret_cast<char *> (&tmp), this->byte_size ()))
678  return false;
679 
680  if (swap)
681  switch (this->byte_size ())
682  {
683  case 8:
684  swap_bytes<8> (&tmp);
685  break;
686  case 4:
687  swap_bytes<4> (&tmp);
688  break;
689  case 2:
690  swap_bytes<2> (&tmp);
691  break;
692  case 1:
693  default:
694  break;
695  }
696  this->scalar = tmp;
697  return true;
698 }
699 
700 template <typename T>
701 bool
703  bool)
704 {
705  bool retval = false;
706 
707 #if defined (HAVE_HDF5)
708 
709  hid_t save_type_hid = HDF5_SAVE_TYPE;
710  hsize_t dimens[3];
711  hid_t space_hid, data_hid;
712  space_hid = data_hid = -1;
713 
714  space_hid = H5Screate_simple (0, dimens, 0);
715  if (space_hid < 0) return false;
716 
717 #if defined (HAVE_HDF5_18)
718  data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
720 #else
721  data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
723 #endif
724  if (data_hid < 0)
725  {
726  H5Sclose (space_hid);
727  return false;
728  }
729 
730  retval = H5Dwrite (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
731  octave_H5P_DEFAULT, &(this->scalar)) >= 0;
732 
733  H5Dclose (data_hid);
734  H5Sclose (space_hid);
735 
736 #else
737  octave_unused_parameter (loc_id);
738  octave_unused_parameter (name);
739 
740  this->warn_save ("hdf5");
741 #endif
742 
743  return retval;
744 }
745 
746 template <typename T>
747 bool
749 {
750 #if defined (HAVE_HDF5)
751 
752  hid_t save_type_hid = HDF5_SAVE_TYPE;
753 #if defined (HAVE_HDF5_18)
754  hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT);
755 #else
756  hid_t data_hid = H5Dopen (loc_id, name);
757 #endif
758  hid_t space_id = H5Dget_space (data_hid);
759 
760  hsize_t rank = H5Sget_simple_extent_ndims (space_id);
761 
762  if (rank != 0)
763  {
764  H5Dclose (data_hid);
765  return false;
766  }
767 
768  T tmp;
769  if (H5Dread (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
770  octave_H5P_DEFAULT, &tmp) < 0)
771  {
772  H5Dclose (data_hid);
773  return false;
774  }
775 
776  this->scalar = tmp;
777 
778  H5Dclose (data_hid);
779 
780  return true;
781 
782 #else
783  octave_unused_parameter (loc_id);
784  octave_unused_parameter (name);
785 
786  this->warn_load ("hdf5");
787 
788  return false;
789 #endif
790 }
octave_int< uint64_t > octave_uint64
octave_value as_uint16(void) const
Definition: ov-base-int.cc:625
octave_value as_uint32(void) const
Definition: ov-base-int.cc:632
intNDArray< octave_int64 > int64NDArray
Definition: int64NDArray.h:33
octave_value as_int32(void) const
Definition: ov-base-int.cc:604
nd group nd example oindent but is performed more efficiently If only and it is a scalar
Definition: data.cc:5342
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
const octave_hdf5_id octave_H5S_ALL
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector d)
Definition: ls-hdf5.cc:897
intNDArray< octave_uint32 > uint32NDArray
Definition: uint32NDArray.h:33
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Definition: ov-base-int.cc:536
intNDArray< octave_uint8 > uint8NDArray
Definition: uint8NDArray.h:33
intNDArray< octave_uint16 > uint16NDArray
Definition: uint16NDArray.h:33
bool save_binary(std::ostream &os, bool &)
Definition: ov-base-int.cc:315
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the then the first element defines the pivoting tolerance for the unsymmetric the values defined such that for full matrix
Definition: lu.cc:138
void resize(int n, int fill_value=0)
Definition: dim-vector.h:316
octave_int< uint16_t > octave_uint16
void swap_bytes< 8 >(void *ptr)
Definition: byte-swap.h:68
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format)
Definition: ov-base-int.cc:673
bool load_ascii(std::istream &is)
Definition: ov-base-int.cc:654
void error(const char *fmt,...)
Definition: error.cc:570
void swap_bytes< 2 >(void *ptr)
Definition: byte-swap.h:53
int load_hdf5_empty(octave_hdf5_id loc_id, const char *name, dim_vector &d)
Definition: ls-hdf5.cc:953
intNDArray< octave_int16 > int16NDArray
Definition: int16NDArray.h:33
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov-base-int.cc:748
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:389
bool save_binary(std::ostream &os, bool &)
Definition: ov-base-int.cc:665
bool swap
Definition: load-save.cc:725
octave_value as_uint64(void) const
Definition: ov-base-int.cc:262
octave_value as_int64(void) const
Definition: ov-base-int.cc:611
octave_value as_uint8(void) const
Definition: ov-base-int.cc:241
octave_value as_uint8(void) const
Definition: ov-base-int.cc:618
create a structure array and initialize its values The dimensions of each cell array of values must match Singleton cells and non cell values are repeated so that they fill the entire array If the cells are empty
Definition: ov-struct.cc:1688
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool)
Definition: ov-base-int.cc:408
OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number!nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable name
Definition: input.cc:871
void swap_bytes< 4 >(void *ptr)
Definition: byte-swap.h:60
octave_base_value * try_narrowing_conversion(void)
Definition: ov-base-int.cc:138
intNDArray< octave_int8 > int8NDArray
Definition: int8NDArray.h:33
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
Definition: ls-oct-text.cc:80
octave_value as_uint16(void) const
Definition: ov-base-int.cc:248
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool)
Definition: ov-base-int.cc:702
nd deftypefn *octave_map m
Definition: ov-struct.cc:2058
octave_value as_int8(void) const
Definition: ov-base-int.cc:213
double tmp
Definition: data.cc:6300
is false
Definition: cellfun.cc:398
octave_value retval
Definition: data.cc:6294
int64_t octave_hdf5_id
returns the type of the matrix and caches it for future use Called with more than one the function will not attempt to guess the type if it is still unknown This is useful for debugging purposes The possible matrix types depend on whether the matrix is full or and can be one of the following able sis tem and mark type as unknown tem as the structure of the matrix explicitly gives this(Sparse matrices only) tem code
Definition: matrix_type.cc:120
octave_value convert_to_str_internal(bool, bool, char type) const
Definition: ov-base-int.cc:151
bool load_ascii(std::istream &is)
Definition: ov-base-int.cc:285
idx type
Definition: ov.cc:3129
octave_value as_int8(void) const
Definition: ov-base-int.cc:590
octave_value as_int16(void) const
Definition: ov-base-int.cc:220
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
octave_value as_int64(void) const
Definition: ov-base-int.cc:234
octave_int< uint32_t > octave_uint32
#define HDF5_SAVE_TYPE
Definition: ov-int16.cc:42
octave_value as_int32(void) const
Definition: ov-base-int.cc:227
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format)
Definition: ov-base-int.cc:338
static const bool can_be_larger_than_uchar_max
Definition: ov-base-int.cc:115
void warning(const char *fmt,...)
Definition: error.cc:788
octave_value as_single(void) const
Definition: ov-base-int.cc:206
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:228
intNDArray< octave_int32 > int32NDArray
Definition: int32NDArray.h:33
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov-base-int.cc:464
octave_value convert_to_str_internal(bool, bool, char type) const
Definition: ov-base-int.cc:545
=val(i)}if ode{val(i)}occurs in table i
Definition: lookup.cc:239
void octave_print_internal(std::ostream &, char, bool)
Definition: pr-output.cc:1722
octave_int< int64_t > octave_int64
octave_idx_type ndims(void) const
Number of dimensions.
Definition: dim-vector.h:301
bool save_ascii(std::ostream &os)
Definition: ov-base-int.cc:269
octave_value as_double(void) const
Definition: ov-base-int.cc:576
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
Definition: oct-locbuf.h:200
octave_value as_single(void) const
Definition: ov-base-int.cc:583
const octave_hdf5_id octave_H5P_DEFAULT
octave_int< int16_t > octave_int16
octave_value as_uint64(void) const
Definition: ov-base-int.cc:639
octave_value as_int16(void) const
Definition: ov-base-int.cc:597
bool save_ascii(std::ostream &os)
Definition: ov-base-int.cc:646
write the output to stdout if nargout is
Definition: load-save.cc:1576
octave_int< uint8_t > octave_uint8
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:87
octave_int< int32_t > octave_int32
octave_value as_double(void) const
Definition: ov-base-int.cc:199
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854
dim_vector dv
Definition: sub2ind.cc:263
static bool char_value_out_of_range(T val)
Definition: ov-base-int.cc:79
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
octave_value as_uint32(void) const
Definition: ov-base-int.cc:255
octave_int< int8_t > octave_int8
intNDArray< octave_uint64 > uint64NDArray
Definition: uint64NDArray.h:33