GNU Octave 7.1.0
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-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26// This file should not include config.h. It is only included in other
27// C++ source files that should have included config.h before including
28// this file.
29
30#include <istream>
31#include <limits>
32#include <ostream>
33#include <sstream>
34#include <vector>
35
36#include "dNDArray.h"
37#include "fNDArray.h"
38#include "int8NDArray.h"
39#include "int16NDArray.h"
40#include "int32NDArray.h"
41#include "int64NDArray.h"
42#include "uint8NDArray.h"
43#include "uint16NDArray.h"
44#include "uint32NDArray.h"
45#include "uint64NDArray.h"
46
47#include "lo-ieee.h"
48#include "lo-utils.h"
49#include "mx-base.h"
50#include "quit.h"
51#include "oct-locbuf.h"
52
53#include "defun.h"
54#include "errwarn.h"
55#include "ovl.h"
56#include "oct-lvalue.h"
57#include "oct-hdf5.h"
58#include "oct-stream.h"
59#include "ops.h"
60#include "ov-base.h"
61#include "ov-base-mat.h"
62#include "ov-base-mat.cc"
63#include "ov-base-scalar.h"
64#include "ov-base-scalar.cc"
65#include "ov-base-int.h"
67#include "pr-output.h"
68#include "variables.h"
69
70#include "byte-swap.h"
71#include "ls-oct-text.h"
72#include "ls-utils.h"
73#include "ls-hdf5.h"
74
75// We have all the machinery below (octave_base_int_helper and
76// octave_base_int_helper_traits) to avoid a few warnings from GCC
77// about comparisons always false due to limited range of data types.
78// Ugh. The cure may be worse than the disease.
79
80template <typename T, bool is_signed = true, bool can_be_too_big = true>
82{
83public:
84 static bool
86 {
87 return val < 0 || val > std::numeric_limits<unsigned char>::max ();
88 }
89};
91template <typename T>
92struct octave_base_int_helper<T, false, false>
93{
94public:
95 static bool char_value_out_of_range (T) { return false; }
96};
98template <typename T>
99struct octave_base_int_helper<T, false, true>
100{
101public:
102 static bool char_value_out_of_range (T val)
103 {
105 }
106};
107
108template <typename T>
109struct octave_base_int_helper<T, true, false>
110{
111public:
112 static bool char_value_out_of_range (T val) { return val < 0; }
114
115// For all types other than char, signed char, and unsigned char, we
116// assume that the upper limit for the range of allowable values is
117// larger than the range for unsigned char. If that's not true, we
118// are still OK, but will see the warnings again for any other types
119// that do not meet this assumption.
120
121template <typename T>
123{
124 static const bool can_be_larger_than_uchar_max = true;
125};
126
127template <>
129{
130 static const bool can_be_larger_than_uchar_max = false;
131};
132
133template <>
135{
136 static const bool can_be_larger_than_uchar_max = false;
137};
138
139template <>
140struct octave_base_int_helper_traits<unsigned char>
141{
142 static const bool can_be_larger_than_uchar_max = false;
143};
144
145template <typename T>
149 octave_base_value *retval = nullptr;
151 if (this->matrix.numel () == 1)
152 retval = new typename octave_value_int_traits<T>::scalar_type
153 (this->matrix (0));
155 return retval;
157
158template <typename T>
162 octave_value retval;
163 dim_vector dv = this->dims ();
165
166 charNDArray chm (dv);
168 bool warned = false;
170 for (octave_idx_type i = 0; i < nel; i++)
172 octave_quit ();
174 typename T::element_type tmp = this->matrix(i);
175
176 typedef typename T::element_type::val_type val_type;
177
178 val_type ival = tmp.value ();
179
180 static const bool is_signed = std::numeric_limits<val_type>::is_signed;
181 static const bool can_be_larger_than_uchar_max
183
184 if (octave_base_int_helper<val_type, is_signed,
185 can_be_larger_than_uchar_max>::char_value_out_of_range (ival))
186 {
187 // FIXME: is there something better we could do?
188
189 ival = 0;
190
191 if (! warned)
192 {
193 ::warning ("range error for conversion to character value");
194 warned = true;
195 }
196 }
197 else
198 chm (i) = static_cast<char> (ival);
199 }
200
201 retval = octave_value (chm, type);
202
203 return retval;
204}
205
206template <typename MT>
209{
210 return NDArray (this->matrix);
211}
212
213template <typename MT>
216{
217 return FloatNDArray (this->matrix);
218}
219
220template <typename MT>
223{
224 return int8NDArray (this->matrix);
225}
226
227template <typename MT>
230{
231 return int16NDArray (this->matrix);
232}
233
234template <typename MT>
237{
238 return int32NDArray (this->matrix);
239}
240
241template <typename MT>
244{
245 return int64NDArray (this->matrix);
246}
247
248template <typename MT>
251{
252 return uint8NDArray (this->matrix);
253}
254
255template <typename MT>
258{
259 return uint16NDArray (this->matrix);
260}
261
262template <typename MT>
265{
266 return uint32NDArray (this->matrix);
267}
268
269template <typename MT>
272{
273 return uint64NDArray (this->matrix);
274}
275
276template <typename T>
277std::string
280 octave_idx_type j) const
281{
282 std::ostringstream buf;
283 octave_print_internal (buf, fmt, this->matrix(i, j));
284 return buf.str ();
285}
286
287template <typename T>
288bool
290{
291 dim_vector dv = this->dims ();
292
293 os << "# ndims: " << dv.ndims () << "\n";
294
295 for (int i = 0; i < dv.ndims (); i++)
296 os << ' ' << dv(i);
297
298 os << "\n" << this->matrix;
299
300 return true;
301}
302
303template <typename T>
304bool
306{
307 int mdims = 0;
308
309 if (! extract_keyword (is, "ndims", mdims, true))
310 error ("load: failed to extract number of dimensions");
311
312 if (mdims < 0)
313 error ("load: failed to extract number of rows and columns");
314
315 dim_vector dv;
316 dv.resize (mdims);
317
318 for (int i = 0; i < mdims; i++)
319 is >> dv(i);
320
321 T tmp(dv);
322
323 is >> tmp;
324
325 if (! is)
326 error ("load: failed to load matrix constant");
327
328 this->matrix = tmp;
329
330 return true;
331}
332
333template <typename T>
334bool
336{
337 dim_vector dv = this->dims ();
338 if (dv.ndims () < 1)
339 return false;
340
341 // Use negative value for ndims to differentiate with old format!!
342 int32_t tmp = - dv.ndims ();
343 os.write (reinterpret_cast<char *> (&tmp), 4);
344 for (int i=0; i < dv.ndims (); i++)
345 {
346 tmp = dv(i);
347 os.write (reinterpret_cast<char *> (&tmp), 4);
348 }
349
350 os.write (reinterpret_cast<const char *> (this->matrix.data ()),
351 this->byte_size ());
352
353 return true;
354}
355
356template <typename T>
357bool
358octave_base_int_matrix<T>::load_binary (std::istream& is, bool swap,
360{
361 int32_t mdims;
362 if (! is.read (reinterpret_cast<char *> (&mdims), 4))
363 return false;
364 if (swap)
365 swap_bytes<4> (&mdims);
366 if (mdims >= 0)
367 return false;
368
369 mdims = - mdims;
370 int32_t di;
371 dim_vector dv;
372 dv.resize (mdims);
373
374 for (int i = 0; i < mdims; i++)
375 {
376 if (! is.read (reinterpret_cast<char *> (&di), 4))
377 return false;
378 if (swap)
379 swap_bytes<4> (&di);
380 dv(i) = di;
381 }
382
383 // Convert an array with a single dimension to be a row vector.
384 // Octave should never write files like this, other software
385 // might.
386
387 if (mdims == 1)
388 {
389 mdims = 2;
390 dv.resize (mdims);
391 dv(1) = dv(0);
392 dv(0) = 1;
393 }
394
395 T m (dv);
396
397 if (! is.read (reinterpret_cast<char *> (m.fortran_vec ()), m.byte_size ()))
398 return false;
399
400 if (swap)
401 {
402 int nel = dv.numel ();
403 int bytes = nel / m.byte_size ();
404 for (int i = 0; i < nel; i++)
405 switch (bytes)
406 {
407 case 8:
408 swap_bytes<8> (&m(i));
409 break;
410 case 4:
411 swap_bytes<4> (&m(i));
412 break;
413 case 2:
414 swap_bytes<2> (&m(i));
415 break;
416 case 1:
417 default:
418 break;
419 }
420 }
421
422 this->matrix = m;
423 return true;
424}
425
426template <typename T>
427bool
430 const char *name, bool)
431{
432 bool retval = false;
433
434#if defined (HAVE_HDF5)
435
436 hid_t save_type_hid = save_type;
437 dim_vector dv = this->dims ();
438 int empty = save_hdf5_empty (loc_id, name, dv);
439 if (empty)
440 return (empty > 0);
441
442 int rank = dv.ndims ();
443 hid_t space_hid, data_hid;
444 space_hid = data_hid = -1;
445 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
446
447 // Octave uses column-major, while HDF5 uses row-major ordering
448 for (int i = 0; i < rank; i++)
449 hdims[i] = dv(rank-i-1);
450
451 space_hid = H5Screate_simple (rank, hdims, nullptr);
452
453 if (space_hid < 0) return false;
454#if defined (HAVE_HDF5_18)
455 data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
457#else
458 data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
460#endif
461 if (data_hid < 0)
462 {
463 H5Sclose (space_hid);
464 return false;
465 }
466
467 retval = H5Dwrite (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
468 octave_H5P_DEFAULT, this->matrix.data ()) >= 0;
469
470 H5Dclose (data_hid);
471 H5Sclose (space_hid);
472
473#else
474 octave_unused_parameter (loc_id);
475 octave_unused_parameter (save_type);
476 octave_unused_parameter (name);
477
478 this->warn_save ("hdf5");
479#endif
480
481 return retval;
482}
483
484template <typename T>
485bool
488 const char *name)
489{
490 bool retval = false;
491
492#if defined (HAVE_HDF5)
493
494 hid_t save_type_hid = save_type;
495 dim_vector dv;
496 int empty = load_hdf5_empty (loc_id, name, dv);
497 if (empty > 0)
498 this->matrix.resize (dv);
499 if (empty)
500 return (empty > 0);
501
502#if defined (HAVE_HDF5_18)
503 hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT);
504#else
505 hid_t data_hid = H5Dopen (loc_id, name);
506#endif
507 hid_t space_id = H5Dget_space (data_hid);
508
509 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
510
511 if (rank < 1)
512 {
513 H5Sclose (space_id);
514 H5Dclose (data_hid);
515 return false;
516 }
517
518 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
519 OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank);
520
521 H5Sget_simple_extent_dims (space_id, hdims, maxdims);
522
523 // Octave uses column-major, while HDF5 uses row-major ordering
524 if (rank == 1)
525 {
526 dv.resize (2);
527 dv(0) = 1;
528 dv(1) = hdims[0];
529 }
530 else
531 {
532 dv.resize (rank);
533 for (hsize_t i = 0, j = rank - 1; i < rank; i++, j--)
534 dv(j) = hdims[i];
535 }
536
537 T m (dv);
538 if (H5Dread (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
539 octave_H5P_DEFAULT, m.fortran_vec ()) >= 0)
540 {
541 retval = true;
542 this->matrix = m;
543 }
544
545 H5Sclose (space_id);
546 H5Dclose (data_hid);
547
548#else
549 octave_unused_parameter (loc_id);
550 octave_unused_parameter (save_type);
551 octave_unused_parameter (name);
552
553 this->warn_load ("hdf5");
554#endif
555
556 return retval;
557}
558
559template <typename T>
560void
562 bool pr_as_read_syntax) const
563{
564 octave_print_internal (os, this->matrix, pr_as_read_syntax,
565 this->current_print_indent_level ());
566}
567
568template <typename T>
571{
572 octave_value retval;
573
574 T tmp = this->scalar;
575
576 typedef typename T::val_type val_type;
577
578 val_type ival = tmp.value ();
579
580 static const bool is_signed = std::numeric_limits<val_type>::is_signed;
581 static const bool can_be_larger_than_uchar_max
583
584 if (octave_base_int_helper<val_type, is_signed,
585 can_be_larger_than_uchar_max>::char_value_out_of_range (ival))
586 {
587 // FIXME: is there something better we could do?
588
589 ival = 0;
590
591 ::warning ("range error for conversion to character value");
592 }
593 else
594 retval = octave_value (std::string (1, static_cast<char> (ival)), type);
595
596 return retval;
597}
598
599template <typename T>
602{
603 return static_cast<double> (this->scalar);
604}
605
606template <typename T>
609{
610 return static_cast<float> (this->scalar);
611}
612
613template <typename T>
616{
617 return octave_int8 (this->scalar);
618}
619
620template <typename T>
623{
624 return octave_int16 (this->scalar);
625}
626
627template <typename T>
630{
631 return octave_int32 (this->scalar);
632}
633
634template <typename T>
637{
638 return octave_int64 (this->scalar);
639}
640
641template <typename T>
644{
645 return octave_uint8 (this->scalar);
646}
647
648template <typename T>
651{
652 return octave_uint16 (this->scalar);
653}
654
655template <typename T>
658{
659 return octave_uint32 (this->scalar);
660}
661
662template <typename T>
665{
666 return octave_uint64 (this->scalar);
667}
668
669template <typename ST>
670std::string
673 octave_idx_type) const
674{
675 std::ostringstream buf;
676 octave_print_internal (buf, fmt, this->scalar);
677 return buf.str ();
678}
679
680template <typename T>
681bool
683{
684 os << this->scalar << "\n";
685 return true;
686}
687
688template <typename T>
689bool
691{
692 is >> this->scalar;
693 if (! is)
694 error ("load: failed to load scalar constant");
695
696 return true;
697}
698
699template <typename T>
700bool
702{
703 os.write (reinterpret_cast<char *> (&(this->scalar)), this->byte_size ());
704 return true;
705}
706
707template <typename T>
708bool
709octave_base_int_scalar<T>::load_binary (std::istream& is, bool swap,
711{
712 T tmp;
713
714 if (! is.read (reinterpret_cast<char *> (&tmp), this->byte_size ()))
715 return false;
716
717 if (swap)
718 swap_bytes<sizeof (T)> (&tmp);
719
720 this->scalar = tmp;
721
722 return true;
723}
724
725template <typename T>
726bool
729 const char *name, bool)
730{
731 bool retval = false;
732
733#if defined (HAVE_HDF5)
734
735 hid_t save_type_hid = save_type;
736 hsize_t dimens[3] = {0};
737 hid_t space_hid, data_hid;
738 space_hid = data_hid = -1;
739
740 space_hid = H5Screate_simple (0, dimens, nullptr);
741 if (space_hid < 0) return false;
742
743#if defined (HAVE_HDF5_18)
744 data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
746#else
747 data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid,
749#endif
750 if (data_hid < 0)
751 {
752 H5Sclose (space_hid);
753 return false;
754 }
755
756 retval = H5Dwrite (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
757 octave_H5P_DEFAULT, &(this->scalar)) >= 0;
758
759 H5Dclose (data_hid);
760 H5Sclose (space_hid);
761
762#else
763 octave_unused_parameter (loc_id);
764 octave_unused_parameter (save_type);
765 octave_unused_parameter (name);
766
767 this->warn_save ("hdf5");
768#endif
769
770 return retval;
771}
772
773template <typename T>
774bool
777 const char *name)
778{
779#if defined (HAVE_HDF5)
780
781 hid_t save_type_hid = save_type;
782#if defined (HAVE_HDF5_18)
783 hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT);
784#else
785 hid_t data_hid = H5Dopen (loc_id, name);
786#endif
787 hid_t space_id = H5Dget_space (data_hid);
788
789 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
790
791 if (rank != 0)
792 {
793 H5Dclose (data_hid);
794 return false;
795 }
796
797 T tmp;
798 if (H5Dread (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL,
799 octave_H5P_DEFAULT, &tmp) < 0)
800 {
801 H5Dclose (data_hid);
802 return false;
803 }
804
805 this->scalar = tmp;
806
807 H5Dclose (data_hid);
808
809 return true;
810
811#else
812 octave_unused_parameter (loc_id);
813 octave_unused_parameter (save_type);
814 octave_unused_parameter (name);
815
816 this->warn_load ("hdf5");
817
818 return false;
819#endif
820}
void swap_bytes< 2 >(void *ptr)
Definition: byte-swap.h:56
void swap_bytes< 8 >(void *ptr)
Definition: byte-swap.h:71
void swap_bytes< 4 >(void *ptr)
Definition: byte-swap.h:63
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:230
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:94
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:335
void resize(int n, int fill_value=0)
Definition: dim-vector.h:272
octave_idx_type ndims(void) const
Number of dimensions.
Definition: dim-vector.h:257
OCTINTERP_API octave_value as_int8(void) const
Definition: ov-base-int.cc:222
OCTINTERP_API octave_value as_uint16(void) const
Definition: ov-base-int.cc:257
OCTINTERP_API void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Definition: ov-base-int.cc:561
OCTINTERP_API octave_value as_uint32(void) const
Definition: ov-base-int.cc:264
OCTINTERP_API octave_value as_int16(void) const
Definition: ov-base-int.cc:229
OCTINTERP_API octave_value as_int32(void) const
Definition: ov-base-int.cc:236
OCTINTERP_API octave_value as_double(void) const
Definition: ov-base-int.cc:208
OCTINTERP_API octave_value as_uint64(void) const
Definition: ov-base-int.cc:271
OCTINTERP_API bool save_ascii(std::ostream &os)
Definition: ov-base-int.cc:289
OCTINTERP_API bool load_ascii(std::istream &is)
Definition: ov-base-int.cc:305
OCTINTERP_API std::string edit_display(const float_display_format &fmt, octave_idx_type i, octave_idx_type j) const
Definition: ov-base-int.cc:278
OCTINTERP_API octave_value as_uint8(void) const
Definition: ov-base-int.cc:250
OCTINTERP_API octave_value as_int64(void) const
Definition: ov-base-int.cc:243
OCTINTERP_API octave_value as_single(void) const
Definition: ov-base-int.cc:215
OCTINTERP_API bool save_hdf5_internal(octave_hdf5_id loc_id, octave_hdf5_id save_type, const char *name, bool)
Definition: ov-base-int.cc:428
OCTINTERP_API bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format)
Definition: ov-base-int.cc:358
OCTINTERP_API octave_base_value * try_narrowing_conversion(void)
Definition: ov-base-int.cc:147
OCTINTERP_API octave_value convert_to_str_internal(bool, bool, char type) const
Definition: ov-base-int.cc:160
OCTINTERP_API bool save_binary(std::ostream &os, bool)
Definition: ov-base-int.cc:335
OCTINTERP_API bool load_hdf5_internal(octave_hdf5_id loc_id, octave_hdf5_id save_type, const char *name)
Definition: ov-base-int.cc:486
OCTINTERP_API bool load_ascii(std::istream &is)
Definition: ov-base-int.cc:690
OCTINTERP_API octave_value as_double(void) const
Definition: ov-base-int.cc:601
OCTINTERP_API bool save_hdf5_internal(octave_hdf5_id loc_id, octave_hdf5_id save_type, const char *name, bool)
Definition: ov-base-int.cc:727
OCTINTERP_API bool load_hdf5_internal(octave_hdf5_id loc_id, octave_hdf5_id save_type, const char *name)
Definition: ov-base-int.cc:775
OCTINTERP_API octave_value as_uint16(void) const
Definition: ov-base-int.cc:650
OCTINTERP_API octave_value convert_to_str_internal(bool, bool, char type) const
Definition: ov-base-int.cc:570
OCTINTERP_API octave_value as_int16(void) const
Definition: ov-base-int.cc:622
OCTINTERP_API octave_value as_uint64(void) const
Definition: ov-base-int.cc:664
OCTINTERP_API octave_value as_single(void) const
Definition: ov-base-int.cc:608
OCTINTERP_API octave_value as_int8(void) const
Definition: ov-base-int.cc:615
OCTINTERP_API octave_value as_int32(void) const
Definition: ov-base-int.cc:629
OCTINTERP_API std::string edit_display(const float_display_format &fmt, octave_idx_type i, octave_idx_type j) const
Definition: ov-base-int.cc:671
OCTINTERP_API octave_value as_int64(void) const
Definition: ov-base-int.cc:636
OCTINTERP_API octave_value as_uint8(void) const
Definition: ov-base-int.cc:643
OCTINTERP_API bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format)
Definition: ov-base-int.cc:709
OCTINTERP_API octave_value as_uint32(void) const
Definition: ov-base-int.cc:657
OCTINTERP_API bool save_ascii(std::ostream &os)
Definition: ov-base-int.cc:682
OCTINTERP_API bool save_binary(std::ostream &os, bool)
Definition: ov-base-int.cc:701
const octave_hdf5_id octave_H5P_DEFAULT
const octave_hdf5_id octave_H5S_ALL
save_type
Definition: data-conv.h:87
void warning(const char *fmt,...)
Definition: error.cc:1055
void error(const char *fmt,...)
Definition: error.cc:980
QString name
intNDArray< octave_int16 > int16NDArray
Definition: int16NDArray.h:36
intNDArray< octave_int32 > int32NDArray
Definition: int32NDArray.h:36
intNDArray< octave_int64 > int64NDArray
Definition: int64NDArray.h:36
intNDArray< octave_int8 > int8NDArray
Definition: int8NDArray.h:36
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector &d)
Definition: ls-hdf5.cc:1251
int load_hdf5_empty(octave_hdf5_id loc_id, const char *name, dim_vector &d)
Definition: ls-hdf5.cc:1307
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
Definition: ls-oct-text.cc:84
class OCTAVE_API NDArray
Definition: mx-fwd.h:38
class OCTAVE_API FloatNDArray
Definition: mx-fwd.h:40
int64_t octave_hdf5_id
octave_int< uint32_t > octave_uint32
octave_int< int32_t > octave_int32
octave_int< int16_t > octave_int16
octave_int< int8_t > octave_int8
octave_int< int64_t > octave_int64
octave_int< uint64_t > octave_uint64
octave_int< uint16_t > octave_uint16
octave_int< uint8_t > octave_uint8
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
Definition: oct-locbuf.h:44
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
static bool scalar(const dim_vector &dims)
Definition: ov-struct.cc:679
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)
Definition: pr-output.cc:1762
static const bool can_be_larger_than_uchar_max
Definition: ov-base-int.cc:124
static bool char_value_out_of_range(T val)
Definition: ov-base-int.cc:85
intNDArray< octave_uint16 > uint16NDArray
Definition: uint16NDArray.h:36
intNDArray< octave_uint32 > uint32NDArray
Definition: uint32NDArray.h:36
intNDArray< octave_uint64 > uint64NDArray
Definition: uint64NDArray.h:36
intNDArray< octave_uint8 > uint8NDArray
Definition: uint8NDArray.h:36