GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-base-int.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2018 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
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License 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 <https://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 {
140  octave_base_value *retval = nullptr;
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>
271  octave_idx_type j) const
272 {
273  std::ostringstream buf;
274  octave_print_internal (buf, fmt, this->matrix(i,j));
275  return buf.str ();
276 }
277 
278 template <typename T>
279 bool
281 {
282  dim_vector dv = this->dims ();
283 
284  os << "# ndims: " << dv.ndims () << "\n";
285 
286  for (int i = 0; i < dv.ndims (); i++)
287  os << ' ' << dv(i);
288 
289  os << "\n" << this->matrix;
290 
291  return true;
292 }
293 
294 template <typename T>
295 bool
297 {
298  int mdims = 0;
299 
300  if (! extract_keyword (is, "ndims", mdims, true))
301  error ("load: failed to extract number of dimensions");
302 
303  if (mdims < 0)
304  error ("load: failed to extract number of rows and columns");
305 
306  dim_vector dv;
307  dv.resize (mdims);
308 
309  for (int i = 0; i < mdims; i++)
310  is >> dv(i);
311 
312  T tmp(dv);
313 
314  is >> tmp;
315 
316  if (! is)
317  error ("load: failed to load matrix constant");
318 
319  this->matrix = tmp;
320 
321  return true;
322 }
323 
324 template <typename T>
325 bool
327 {
328  dim_vector dv = this->dims ();
329  if (dv.ndims () < 1)
330  return false;
331 
332  // Use negative value for ndims to differentiate with old format!!
333  int32_t tmp = - dv.ndims ();
334  os.write (reinterpret_cast<char *> (&tmp), 4);
335  for (int i=0; i < dv.ndims (); i++)
336  {
337  tmp = dv(i);
338  os.write (reinterpret_cast<char *> (&tmp), 4);
339  }
340 
341  os.write (reinterpret_cast<const char *> (this->matrix.data ()),
342  this->byte_size ());
343 
344  return true;
345 }
346 
347 template <typename T>
348 bool
351 {
352  int32_t mdims;
353  if (! is.read (reinterpret_cast<char *> (&mdims), 4))
354  return false;
355  if (swap)
356  swap_bytes<4> (&mdims);
357  if (mdims >= 0)
358  return false;
359 
360  mdims = - mdims;
361  int32_t di;
362  dim_vector dv;
363  dv.resize (mdims);
364 
365  for (int i = 0; i < mdims; i++)
366  {
367  if (! is.read (reinterpret_cast<char *> (&di), 4))
368  return false;
369  if (swap)
370  swap_bytes<4> (&di);
371  dv(i) = di;
372  }
373 
374  // Convert an array with a single dimension to be a row vector.
375  // Octave should never write files like this, other software
376  // might.
377 
378  if (mdims == 1)
379  {
380  mdims = 2;
381  dv.resize (mdims);
382  dv(1) = dv(0);
383  dv(0) = 1;
384  }
385 
386  T m (dv);
387 
388  if (! is.read (reinterpret_cast<char *> (m.fortran_vec ()), m.byte_size ()))
389  return false;
390 
391  if (swap)
392  {
393  int nel = dv.numel ();
394  int bytes = nel / m.byte_size ();
395  for (int i = 0; i < nel; i++)
396  switch (bytes)
397  {
398  case 8:
399  swap_bytes<8> (&m(i));
400  break;
401  case 4:
402  swap_bytes<4> (&m(i));
403  break;
404  case 2:
405  swap_bytes<2> (&m(i));
406  break;
407  case 1:
408  default:
409  break;
410  }
411  }
412 
413  this->matrix = m;
414  return true;
415 }
416 
417 template <typename T>
418 bool
421  const char *name, bool)
422 {
423  bool retval = false;
424 
425 #if defined (HAVE_HDF5)
426 
427  hid_t save_type_hid = save_type;
428  dim_vector dv = this->dims ();
429  int empty = save_hdf5_empty (loc_id, name, dv);
430  if (empty)
431  return (empty > 0);
432 
433  int rank = dv.ndims ();
434  hid_t space_hid, data_hid;
435  space_hid = data_hid = -1;
436  OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
437 
438  // Octave uses column-major, while HDF5 uses row-major ordering
439  for (int i = 0; i < rank; i++)
440  hdims[i] = dv(rank-i-1);
441 
442  space_hid = H5Screate_simple (rank, hdims, nullptr);
443 
444  if (space_hid < 0) return false;
445 #if defined (HAVE_HDF5_18)
446  data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
448 #else
449  data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
451 #endif
452  if (data_hid < 0)
453  {
454  H5Sclose (space_hid);
455  return false;
456  }
457 
458  retval = H5Dwrite (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
459  octave_H5P_DEFAULT, this->matrix.data ()) >= 0;
460 
461  H5Dclose (data_hid);
462  H5Sclose (space_hid);
463 
464 #else
465  octave_unused_parameter (loc_id);
466  octave_unused_parameter (save_type);
467  octave_unused_parameter (name);
468 
469  this->warn_save ("hdf5");
470 #endif
471 
472  return retval;
473 }
474 
475 template <typename T>
476 bool
479  const char *name)
480 {
481  bool retval = false;
482 
483 #if defined (HAVE_HDF5)
484 
485  hid_t save_type_hid = save_type;
486  dim_vector dv;
487  int empty = load_hdf5_empty (loc_id, name, dv);
488  if (empty > 0)
489  this->matrix.resize (dv);
490  if (empty)
491  return (empty > 0);
492 
493 #if defined (HAVE_HDF5_18)
494  hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT);
495 #else
496  hid_t data_hid = H5Dopen (loc_id, name);
497 #endif
498  hid_t space_id = H5Dget_space (data_hid);
499 
500  hsize_t rank = H5Sget_simple_extent_ndims (space_id);
501 
502  if (rank < 1)
503  {
504  H5Sclose (space_id);
505  H5Dclose (data_hid);
506  return false;
507  }
508 
509  OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
510  OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank);
511 
512  H5Sget_simple_extent_dims (space_id, hdims, maxdims);
513 
514  // Octave uses column-major, while HDF5 uses row-major ordering
515  if (rank == 1)
516  {
517  dv.resize (2);
518  dv(0) = 1;
519  dv(1) = hdims[0];
520  }
521  else
522  {
523  dv.resize (rank);
524  for (hsize_t i = 0, j = rank - 1; i < rank; i++, j--)
525  dv(j) = hdims[i];
526  }
527 
528  T m (dv);
529  if (H5Dread (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
530  octave_H5P_DEFAULT, m.fortran_vec ()) >= 0)
531  {
532  retval = true;
533  this->matrix = m;
534  }
535 
536  H5Sclose (space_id);
537  H5Dclose (data_hid);
538 
539 #else
540  octave_unused_parameter (loc_id);
541  octave_unused_parameter (save_type);
542  octave_unused_parameter (name);
543 
544  this->warn_load ("hdf5");
545 #endif
546 
547  return retval;
548 }
549 
550 template <typename T>
551 void
553  bool pr_as_read_syntax) const
554 {
555  octave_print_internal (os, this->matrix, pr_as_read_syntax,
556  this->current_print_indent_level ());
557 }
558 
559 template <typename T>
562 {
564 
565  T tmp = this->scalar;
566 
567  typedef typename T::val_type val_type;
568 
569  val_type ival = tmp.value ();
570 
571  static const bool is_signed = std::numeric_limits<val_type>::is_signed;
572  static const bool can_be_larger_than_uchar_max
574 
575  if (octave_base_int_helper<val_type, is_signed,
576  can_be_larger_than_uchar_max>::char_value_out_of_range (ival))
577  {
578  // FIXME: is there something better we could do?
579 
580  ival = 0;
581 
582  ::warning ("range error for conversion to character value");
583  }
584  else
585  retval = octave_value (std::string (1, static_cast<char> (ival)), type);
586 
587  return retval;
588 }
589 
590 template <typename T>
593 {
594  return static_cast<double> (this->scalar);
595 }
596 
597 template <typename T>
600 {
601  return static_cast<float> (this->scalar);
602 }
603 
604 template <typename T>
607 {
608  return octave_int8 (this->scalar);
609 }
610 
611 template <typename T>
614 {
615  return octave_int16 (this->scalar);
616 }
617 
618 template <typename T>
621 {
622  return octave_int32 (this->scalar);
623 }
624 
625 template <typename T>
628 {
629  return octave_int64 (this->scalar);
630 }
631 
632 template <typename T>
635 {
636  return octave_uint8 (this->scalar);
637 }
638 
639 template <typename T>
642 {
643  return octave_uint16 (this->scalar);
644 }
645 
646 template <typename T>
649 {
650  return octave_uint32 (this->scalar);
651 }
652 
653 template <typename T>
656 {
657  return octave_uint64 (this->scalar);
658 }
659 
660 template <typename ST>
664  octave_idx_type) const
665 {
666  std::ostringstream buf;
667  octave_print_internal (buf, fmt, this->scalar);
668  return buf.str ();
669 }
670 
671 template <typename T>
672 bool
674 {
675  os << this->scalar << "\n";
676  return true;
677 }
678 
679 template <typename T>
680 bool
682 {
683  is >> this->scalar;
684  if (! is)
685  error ("load: failed to load scalar constant");
686 
687  return true;
688 }
689 
690 template <typename T>
691 bool
693 {
694  os.write (reinterpret_cast<char *> (&(this->scalar)), this->byte_size ());
695  return true;
696 }
697 
698 template <typename T>
699 bool
702 {
703  T tmp;
704  if (! is.read (reinterpret_cast<char *> (&tmp), this->byte_size ()))
705  return false;
706 
707  if (swap)
708  switch (this->byte_size ())
709  {
710  case 8:
711  swap_bytes<8> (&tmp);
712  break;
713  case 4:
714  swap_bytes<4> (&tmp);
715  break;
716  case 2:
717  swap_bytes<2> (&tmp);
718  break;
719  case 1:
720  default:
721  break;
722  }
723  this->scalar = tmp;
724  return true;
725 }
726 
727 template <typename T>
728 bool
731  const char *name, bool)
732 {
733  bool retval = false;
734 
735 #if defined (HAVE_HDF5)
736 
737  hid_t save_type_hid = save_type;
738  hsize_t dimens[3];
739  hid_t space_hid, data_hid;
740  space_hid = data_hid = -1;
741 
742  space_hid = H5Screate_simple (0, dimens, nullptr);
743  if (space_hid < 0) return false;
744 
745 #if defined (HAVE_HDF5_18)
746  data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
748 #else
749  data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
751 #endif
752  if (data_hid < 0)
753  {
754  H5Sclose (space_hid);
755  return false;
756  }
757 
758  retval = H5Dwrite (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
759  octave_H5P_DEFAULT, &(this->scalar)) >= 0;
760 
761  H5Dclose (data_hid);
762  H5Sclose (space_hid);
763 
764 #else
765  octave_unused_parameter (loc_id);
766  octave_unused_parameter (save_type);
767  octave_unused_parameter (name);
768 
769  this->warn_save ("hdf5");
770 #endif
771 
772  return retval;
773 }
774 
775 template <typename T>
776 bool
779  const char *name)
780 {
781 #if defined (HAVE_HDF5)
782 
783  hid_t save_type_hid = save_type;
784 #if defined (HAVE_HDF5_18)
785  hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT);
786 #else
787  hid_t data_hid = H5Dopen (loc_id, name);
788 #endif
789  hid_t space_id = H5Dget_space (data_hid);
790 
791  hsize_t rank = H5Sget_simple_extent_ndims (space_id);
792 
793  if (rank != 0)
794  {
795  H5Dclose (data_hid);
796  return false;
797  }
798 
799  T tmp;
800  if (H5Dread (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
801  octave_H5P_DEFAULT, &tmp) < 0)
802  {
803  H5Dclose (data_hid);
804  return false;
805  }
806 
807  this->scalar = tmp;
808 
809  H5Dclose (data_hid);
810 
811  return true;
812 
813 #else
814  octave_unused_parameter (loc_id);
815  octave_unused_parameter (save_type);
816  octave_unused_parameter (name);
817 
818  this->warn_load ("hdf5");
819 
820  return false;
821 #endif
822 }
save_type
Definition: data-conv.h:85
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
octave_value as_uint8(void) const
Definition: ov-base-int.cc:241
octave_int< uint64_t > octave_uint64
intNDArray< octave_int64 > int64NDArray
Definition: int64NDArray.h:33
characters Given a string matrix
Definition: hex2num.cc:155
bool save_hdf5_internal(octave_hdf5_id loc_id, octave_hdf5_id save_type, const char *name, bool)
Definition: ov-base-int.cc:419
nd group nd example oindent but is performed more efficiently If only and it is a scalar
Definition: data.cc:5264
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:4986
const octave_hdf5_id octave_H5S_ALL
intNDArray< octave_uint32 > uint32NDArray
Definition: uint32NDArray.h:33
intNDArray< octave_uint8 > uint8NDArray
Definition: uint8NDArray.h:33
octave_value as_double(void) const
Definition: ov-base-int.cc:199
intNDArray< octave_uint16 > uint16NDArray
Definition: uint16NDArray.h:33
octave_value convert_to_str_internal(bool, bool, char type) const
Definition: ov-base-int.cc:561
bool save_binary(std::ostream &os, bool &)
Definition: ov-base-int.cc:326
void resize(int n, int fill_value=0)
Definition: dim-vector.h:310
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:700
bool load_ascii(std::istream &is)
Definition: ov-base-int.cc:681
void error(const char *fmt,...)
Definition: error.cc:578
void swap_bytes< 2 >(void *ptr)
Definition: byte-swap.h:53
octave_value as_int8(void) const
Definition: ov-base-int.cc:606
octave_value as_int64(void) const
Definition: ov-base-int.cc:627
octave_value as_uint16(void) const
Definition: ov-base-int.cc:641
int load_hdf5_empty(octave_hdf5_id loc_id, const char *name, dim_vector &d)
Definition: ls-hdf5.cc:953
std::string edit_display(const float_display_format &fmt, octave_idx_type i, octave_idx_type j) const
Definition: ov-base-int.cc:269
intNDArray< octave_int16 > int16NDArray
Definition: int16NDArray.h:33
octave_value as_single(void) const
Definition: ov-base-int.cc:599
bool save_binary(std::ostream &os, bool &)
Definition: ov-base-int.cc:692
bool swap
Definition: load-save.cc:738
octave_value as_double(void) const
Definition: ov-base-int.cc:592
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:1736
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)
Definition: pr-output.cc:1780
nd deftypefn *std::string name
Definition: sysdep.cc:647
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
octave_value as_uint16(void) const
Definition: ov-base-int.cc:248
octave_value as_int16(void) const
Definition: ov-base-int.cc:220
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
Definition: ls-oct-text.cc:82
octave_value as_uint32(void) const
Definition: ov-base-int.cc:648
std::string edit_display(const float_display_format &fmt, octave_idx_type i, octave_idx_type j) const
Definition: ov-base-int.cc:662
bool load_hdf5_internal(octave_hdf5_id loc_id, octave_hdf5_id save_type, const char *name)
Definition: ov-base-int.cc:477
double tmp
Definition: data.cc:6252
is false
Definition: cellfun.cc:400
octave_value retval
Definition: data.cc:6246
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Definition: ov-base-int.cc:552
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
bool load_ascii(std::istream &is)
Definition: ov-base-int.cc:296
idx type
Definition: ov.cc:3114
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_int< uint32_t > octave_uint32
octave_value as_single(void) const
Definition: ov-base-int.cc:206
octave_value as_int64(void) const
Definition: ov-base-int.cc:234
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format)
Definition: ov-base-int.cc:349
static const bool can_be_larger_than_uchar_max
Definition: ov-base-int.cc:115
void warning(const char *fmt,...)
Definition: error.cc:801
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:227
octave_value convert_to_str_internal(bool, bool, char type) const
Definition: ov-base-int.cc:151
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector &d)
Definition: ls-hdf5.cc:897
intNDArray< octave_int32 > int32NDArray
Definition: int32NDArray.h:33
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:362
bool load_hdf5_internal(octave_hdf5_id loc_id, octave_hdf5_id save_type, const char *name)
Definition: ov-base-int.cc:777
octave_value as_uint8(void) const
Definition: ov-base-int.cc:634
octave_value as_int8(void) const
Definition: ov-base-int.cc:213
octave_int< int64_t > octave_int64
octave_value as_uint32(void) const
Definition: ov-base-int.cc:255
bool save_ascii(std::ostream &os)
Definition: ov-base-int.cc:280
bool save_hdf5_internal(octave_hdf5_id loc_id, octave_hdf5_id save_type, const char *name, bool)
Definition: ov-base-int.cc:729
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
Definition: oct-locbuf.h:41
octave_value as_uint64(void) const
Definition: ov-base-int.cc:655
octave_value as_int32(void) const
Definition: ov-base-int.cc:620
for i
Definition: data.cc:5264
const octave_hdf5_id octave_H5P_DEFAULT
octave_value as_uint64(void) const
Definition: ov-base-int.cc:262
octave_int< int16_t > octave_int16
octave_idx_type ndims(void) const
Number of dimensions.
Definition: dim-vector.h:295
bool save_ascii(std::ostream &os)
Definition: ov-base-int.cc:673
octave_value as_int16(void) const
Definition: ov-base-int.cc:613
write the output to stdout if nargout is
Definition: load-save.cc:1612
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
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:888
octave_value as_int32(void) const
Definition: ov-base-int.cc:227
dim_vector dv
Definition: sub2ind.cc:263
static bool char_value_out_of_range(T val)
Definition: ov-base-int.cc:79
octave::stream os
Definition: file-io.cc:627
octave_int< int8_t > octave_int8
intNDArray< octave_uint64 > uint64NDArray
Definition: uint64NDArray.h:33