GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
ov-str-mat.cc
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-2025 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#if defined (HAVE_CONFIG_H)
27# include "config.h"
28#endif
29
30#include <cctype>
31
32#include <istream>
33#include <ostream>
34#include <vector>
35
36#include "data-conv.h"
37#include "lo-ieee.h"
38#include "mach-info.h"
39#include "mx-base.h"
40#include "oct-locbuf.h"
41
42#include "byte-swap.h"
43#include "defun.h"
44#include "errwarn.h"
45#include "ls-ascii-helper.h"
46#include "ls-hdf5.h"
47#include "ls-oct-text.h"
48#include "ls-utils.h"
49#include "ovl.h"
50#include "oct-hdf5.h"
51#include "oct-stream.h"
52#include "ops.h"
53#include "ov-scalar.h"
54#include "ov-re-mat.h"
55#include "ov-str-mat.h"
56#include "pr-output.h"
57#include "utils.h"
58
59
62 "char");
63
64static octave_base_value *
65default_numeric_conversion_function (const octave_base_value& a)
66{
67 octave_base_value *retval = nullptr;
68
70 = dynamic_cast<const octave_char_matrix_str&> (a);
71
72 NDArray nda = v.array_value (true);
73
74 if (nda.numel () == 1)
75 retval = new octave_scalar (nda(0));
76 else
77 retval = new octave_matrix (nda);
78
79 return retval;
80}
81
88
91 bool resize_ok, char type)
92{
93 octave_value retval;
94
95 octave_idx_type len = idx.length ();
96
97 // If we catch an indexing error in index_vector, we flag an error in
98 // index k. Ensure it is the right value before each idx_vector call.
99 // Same variable as used in the for loop in the default case.
100
101 octave_idx_type k = 0;
102
103 try
104 {
105 switch (len)
106 {
107 case 0:
108 retval = octave_value (m_matrix, type);
109 break;
110
111 case 1:
112 {
113 octave::idx_vector i = idx (0).index_vector ();
114
115 retval = octave_value (charNDArray (m_matrix.index (i, resize_ok)),
116 type);
117 }
118 break;
119
120 case 2:
121 {
122 octave::idx_vector i = idx (0).index_vector ();
123 k = 1;
124 octave::idx_vector j = idx (1).index_vector ();
125
126 retval = octave_value (charNDArray (m_matrix.index (i, j, resize_ok)),
127 type);
128 }
129 break;
130
131 default:
132 {
134
135 for (k = 0; k < len; k++)
136 idx_vec(k) = idx(k).index_vector ();
137
138 retval = octave_value (charNDArray (m_matrix.index (idx_vec, resize_ok)), type);
139 }
140 break;
141 }
142 }
143 catch (octave::index_exception& ie)
144 {
145 // Rethrow to allow more info to be reported later.
146 ie.set_pos_if_unset (len, k+1);
147 throw;
148 }
149
150 return retval;
151}
152
154octave_char_matrix_str::resize (const dim_vector& dv, bool fill) const
155{
156 charNDArray retval (m_matrix);
157 if (fill)
158 retval.resize (dv, 0);
159 else
160 retval.resize (dv);
161 return octave_value (retval, is_sq_string () ? '\'' : '"');
162}
163
164#define CHAR_MATRIX_CONV(TNAME, FCN) \
165 \
166 if (! force_string_conv) \
167 err_invalid_conversion ("string", TNAME); \
168 \
169 warn_implicit_conversion ("Octave:str-to-num", "string", TNAME); \
170 \
171 return octave_char_matrix::FCN ()
172
173double
174octave_char_matrix_str::double_value (bool force_string_conv) const
175{
176 CHAR_MATRIX_CONV ("real scalar", double_value);
177}
178
180octave_char_matrix_str::complex_value (bool force_string_conv) const
181{
182 CHAR_MATRIX_CONV ("complex scalar", complex_value);
183}
184
185Matrix
186octave_char_matrix_str::matrix_value (bool force_string_conv) const
187{
188 CHAR_MATRIX_CONV ("real matrix", matrix_value);
189}
190
193{
194 CHAR_MATRIX_CONV ("complex matrix", complex_matrix_value);
195}
196
198octave_char_matrix_str::array_value (bool force_string_conv) const
199{
200 CHAR_MATRIX_CONV ("real N-D array", array_value);
201}
202
205{
206 CHAR_MATRIX_CONV ("complex N-D array", complex_array_value);
207}
208
211{
212 string_vector retval;
213
214 if (m_matrix.ndims () != 2)
215 error ("invalid conversion of charNDArray to string_vector");
216
217 charMatrix chm (m_matrix);
218
219 octave_idx_type n = chm.rows ();
220
221 retval.resize (n);
222
223 for (octave_idx_type i = 0; i < n; i++)
224 retval[i] = chm.row_as_string (i);
225
226 return retval;
227}
228
229std::string
231{
232 if (m_matrix.ndims () != 2)
233 error ("invalid conversion of charNDArray to string");
234
235 charMatrix chm (m_matrix);
236
237 if (chm.rows () > 1)
238 warning_with_id ("Octave:charmat-truncated",
239 "multi-row character matrix converted to a string, only the first row is used");
240
241 // FIXME: Is this correct?
242 return chm.row_as_string (0);
243}
244
245/*
246%!test <*49536>
247%! warning ("on", "Octave:charmat-truncated", "local");
248%! s = char ("this", "is", "a", "char", "matrix");
249%! fail ("sprintf (s)", ...
250%! "warning", ...
251%! "multi-row character matrix converted to a string");
252*/
253
256{
257 Array<std::string> retval;
258
259 if (m_matrix.ndims () != 2)
260 error ("cellstr: cannot convert multidimensional arrays");
261
262 const charMatrix chm (m_matrix);
263 octave_idx_type nr = chm.rows ();
264 retval.clear (nr, 1);
265 for (octave_idx_type i = 0; i < nr; i++)
266 retval.xelem (i) = chm.row_as_string (i);
267
268 return retval;
269}
270
271void
273 bool pr_as_read_syntax) const
274{
275 octave_print_internal (os, m_matrix, pr_as_read_syntax,
277}
278
279void
281{
282 if (m_matrix.ndims () == 2 && numel () > 0)
283 {
284 charMatrix chm (m_matrix);
285 std::string tmp = chm.row_as_string (0);
286
287 // FIXME: should this be configurable?
288 std::size_t max_len = 50;
289
290 char quote_char = is_sq_string () ? '\'' : '"';
291
292 os << quote_char;
293 if (tmp.length () > max_len)
294 os << tmp.substr (0, 50) << quote_char << " (truncated)";
295 else
296 os << tmp << quote_char;
297 }
298}
299
300std::string
303 octave_idx_type) const
304{
305 if (i == 0)
306 {
307 if (rows () == 1)
308 {
309 std::string retval = string_value ();
310
311 if (! is_sq_string ())
312 retval = octave::undo_string_escapes (retval);
313
314 return retval;
315 }
316 else if (is_zero_by_zero ())
317 return "";
318 }
319
320 std::string tname = type_name ();
321 const dim_vector& dv = m_matrix.dims ();
322 std::string dimstr = dv.str ();
323 return "[" + dimstr + " " + tname + "]";
324}
325
326bool
328{
329 const dim_vector& dv = dims ();
330 if (dv.ndims () > 2)
331 {
333 os << "# ndims: " << dv.ndims () << "\n";
334 for (int i=0; i < dv.ndims (); i++)
335 os << ' ' << dv(i);
336 os << "\n";
337 os.write (tmp.data (), dv.numel ());
338 os << "\n";
339 }
340 else
341 {
342 // Keep this case, rather than use generic code above for
343 // backward compatibility. Makes load_ascii much more complex!!
345 octave_idx_type elements = chm.rows ();
346 os << "# elements: " << elements << "\n";
347 for (octave_idx_type i = 0; i < elements; i++)
348 {
349 unsigned len = chm.cols ();
350 os << "# length: " << len << "\n";
351 std::string tstr = chm.row_as_string (i);
352 const char *tmp = tstr.data ();
353 panic_if (tstr.length () > len);
354 os.write (tmp, len);
355 os << "\n";
356 }
357 }
358
359 return true;
360}
361
362bool
364{
365 string_vector keywords(3);
366
367 keywords[0] = "ndims";
368 keywords[1] = "elements";
369 keywords[2] = "length";
370
371 std::string kw;
372 int val = 0;
373
374 if (! extract_keyword (is, keywords, kw, val, true))
375 error ("load: failed to extract number of rows and columns");
376
377 if (kw == "ndims")
378 {
379 int mdims = val;
380
381 if (mdims < 0)
382 error ("load: failed to extract matrix size");
383
384 dim_vector dv;
385 dv.resize (mdims);
386
387 for (int i = 0; i < mdims; i++)
388 is >> dv(i);
389
390 if (! is)
391 error ("load: failed to read dimensions");
392
393 charNDArray tmp(dv);
394
395 if (tmp.isempty ())
396 m_matrix = tmp;
397 else
398 {
399 char *ftmp = tmp.rwdata ();
400
401 octave::skip_preceeding_newline (is);
402
403 if (! is.read (ftmp, dv.numel ()) || ! is)
404 error ("load: failed to load string constant");
405
406 m_matrix = tmp;
407 }
408 }
409 else if (kw == "elements")
410 {
411 int elements = val;
412
413 if (elements < 0)
414 error ("load: failed to extract number of string elements");
415
416 // FIXME: need to be able to get max length before doing anything.
417
418 charMatrix chm (elements, 0);
419 int max_len = 0;
420 for (int i = 0; i < elements; i++)
421 {
422 int len;
423 if (! extract_keyword (is, "length", len) || len < 0)
424 error ("load: failed to extract string length for element %d",
425 i+1);
426
427 // Use this instead of a C-style character
428 // buffer so that we can properly handle
429 // embedded NUL characters.
430 charMatrix tmp (1, len);
431 char *ptmp = tmp.rwdata ();
432
433 if (len > 0 && ! is.read (ptmp, len))
434 error ("load: failed to load string constant");
435
436 if (len > max_len)
437 {
438 max_len = len;
439 chm.resize (elements, max_len, 0);
440 }
441
442 chm.insert (tmp, i, 0);
443 }
444
445 m_matrix = chm;
446 }
447 else if (kw == "length")
448 {
449 int len = val;
450
451 if (len >= 0)
452 {
453 // This is cruft for backward compatibility,
454 // but relatively harmless.
455
456 // Use this instead of a C-style character buffer so
457 // that we can properly handle embedded NUL characters.
458 charMatrix tmp (1, len);
459 char *ptmp = tmp.rwdata ();
460
461 if (len > 0 && ! is.read (ptmp, len))
462 error ("load: failed to load string constant");
463
464 if (! is)
465 error ("load: failed to load string constant");
466
467 m_matrix = tmp;
468 }
469 }
470 else
471 error ("unexpected dimensions keyword (= '%s') octave_char_matrix::load_ascii - please report this bug", kw.c_str ());
472
473 return true;
474}
475
476bool
478 bool /* save_as_floats */)
479{
480 const dim_vector& dv = dims ();
481 if (dv.ndims () < 1)
482 return false;
483
484 // Use negative value for ndims to differentiate with old format!!
485 int32_t tmp = - dv.ndims ();
486 os.write (reinterpret_cast<char *> (&tmp), 4);
487 for (int i=0; i < dv.ndims (); i++)
488 {
489 tmp = dv(i);
490 os.write (reinterpret_cast<char *> (&tmp), 4);
491 }
492
494 os.write (m.data (), dv.numel ());
495 return true;
496}
497
498bool
499octave_char_matrix_str::load_binary (std::istream& is, bool swap,
500 octave::mach_info::float_format /* fmt */)
501{
502 int32_t elements;
503 if (! is.read (reinterpret_cast<char *> (&elements), 4))
504 return false;
505 if (swap)
506 swap_bytes<4> (&elements);
507
508 if (elements < 0)
509 {
510 int32_t mdims = - elements;
511 int32_t di;
512 dim_vector dv;
513 dv.resize (mdims);
514
515 for (int i = 0; i < mdims; i++)
516 {
517 if (! is.read (reinterpret_cast<char *> (&di), 4))
518 return false;
519 if (swap)
520 swap_bytes<4> (&di);
521 dv(i) = di;
522 }
523
524 // Convert an array with a single dimension to be a row vector.
525 // Octave should never write files like this, other software
526 // might.
527
528 if (mdims == 1)
529 {
530 mdims = 2;
531 dv.resize (mdims);
532 dv(1) = dv(0);
533 dv(0) = 1;
534 }
535
536 charNDArray m(dv);
537 char *tmp = m.rwdata ();
538 is.read (tmp, dv.numel ());
539
540 if (! is)
541 return false;
542
543 m_matrix = m;
544 }
545 else
546 {
547 charMatrix chm (elements, 0);
548 int max_len = 0;
549 for (int i = 0; i < elements; i++)
550 {
551 int32_t len;
552 if (! is.read (reinterpret_cast<char *> (&len), 4))
553 return false;
554 if (swap)
556 charMatrix btmp (1, len);
557 char *pbtmp = btmp.rwdata ();
558 if (! is.read (pbtmp, len))
559 return false;
560 if (len > max_len)
561 {
562 max_len = len;
563 chm.resize (elements, max_len, 0);
564 }
565 chm.insert (btmp, i, 0);
566 }
567 m_matrix = chm;
568 }
569 return true;
570}
571
572bool
574 bool /* save_as_floats */)
575{
576 bool retval = false;
577
578#if defined (HAVE_HDF5)
579
580 const dim_vector& dv = dims ();
581 int empty = save_hdf5_empty (loc_id, name, dv);
582 if (empty)
583 return (empty > 0);
584
585 int rank = dv.ndims ();
586 hid_t space_hid, data_hid;
587 space_hid = data_hid = -1;
589
590 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
591
592 // Octave uses column-major, while HDF5 uses row-major ordering
593 for (int i = 0; i < rank; i++)
594 hdims[i] = dv(rank-i-1);
595
596 space_hid = H5Screate_simple (rank, hdims, nullptr);
597 if (space_hid < 0)
598 return false;
599#if defined (HAVE_HDF5_18)
600 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_CHAR, space_hid,
603#else
604 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_CHAR, space_hid,
606#endif
607 if (data_hid < 0)
608 {
609 H5Sclose (space_hid);
610 return false;
611 }
612
613 OCTAVE_LOCAL_BUFFER (char, s, dv.numel ());
614
615 for (int i = 0; i < dv.numel (); ++i)
616 s[i] = m(i);
617
618 retval = H5Dwrite (data_hid, H5T_NATIVE_CHAR, octave_H5S_ALL, octave_H5S_ALL,
619 octave_H5P_DEFAULT, s) >= 0;
620
621 H5Dclose (data_hid);
622 H5Sclose (space_hid);
623
624#else
625 octave_unused_parameter (loc_id);
626 octave_unused_parameter (name);
627
628 warn_save ("hdf5");
629#endif
630
631 return retval;
632}
633
634bool
636{
637 bool retval = false;
638
639#if defined (HAVE_HDF5)
640
641 dim_vector dv;
642 int empty = load_hdf5_empty (loc_id, name, dv);
643 if (empty > 0)
644 m_matrix.resize (dv);
645 if (empty)
646 return (empty > 0);
647
648#if defined (HAVE_HDF5_18)
649 hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT);
650#else
651 hid_t data_hid = H5Dopen (loc_id, name);
652#endif
653 hid_t space_hid = H5Dget_space (data_hid);
654 hsize_t rank = H5Sget_simple_extent_ndims (space_hid);
655 hid_t type_hid = H5Dget_type (data_hid);
656 hid_t type_class_hid = H5Tget_class (type_hid);
657
658 if (type_class_hid == H5T_INTEGER)
659 {
660 if (rank < 1)
661 {
662 H5Tclose (type_hid);
663 H5Sclose (space_hid);
664 H5Dclose (data_hid);
665 return false;
666 }
667
668 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
669 OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank);
670
671 H5Sget_simple_extent_dims (space_hid, hdims, maxdims);
672
673 // Octave uses column-major, while HDF5 uses row-major ordering
674 if (rank == 1)
675 {
676 dv.resize (2);
677 dv(0) = 1;
678 dv(1) = hdims[0];
679 }
680 else
681 {
682 dv.resize (rank);
683 for (hsize_t i = 0, j = rank - 1; i < rank; i++, j--)
684 dv(j) = hdims[i];
685 }
686
687 charNDArray m (dv);
688 char *str = m.rwdata ();
689 if (H5Dread (data_hid, H5T_NATIVE_CHAR, octave_H5S_ALL, octave_H5S_ALL,
690 octave_H5P_DEFAULT, str) >= 0)
691 {
692 retval = true;
693 m_matrix = m;
694 }
695
696 H5Tclose (type_hid);
697 H5Sclose (space_hid);
698 H5Dclose (data_hid);
699 return true;
700 }
701 else
702 {
703 // This is cruft for backward compatibility and easy data importation
704 if (rank == 0)
705 {
706 // a single string:
707 int slen = H5Tget_size (type_hid);
708 if (slen < 0)
709 {
710 H5Tclose (type_hid);
711 H5Sclose (space_hid);
712 H5Dclose (data_hid);
713 return false;
714 }
715 else
716 {
717 OCTAVE_LOCAL_BUFFER (char, s, slen+1);
718 // create datatype for (null-terminated) string to read into:
719 hid_t st_id = H5Tcopy (H5T_C_S1);
720 H5Tset_size (st_id, slen+1);
721 if (H5Dread (data_hid, st_id, octave_H5S_ALL,
723 {
724 H5Tclose (st_id);
725 H5Tclose (type_hid);
726 H5Sclose (space_hid);
727 H5Dclose (data_hid);
728 return false;
729 }
730
731 m_matrix = charMatrix (s);
732
733 H5Tclose (st_id);
734 H5Tclose (type_hid);
735 H5Sclose (space_hid);
736 H5Dclose (data_hid);
737 return true;
738 }
739 }
740 else if (rank == 1)
741 {
742 // string vector
743 hsize_t elements, maxdim;
744 H5Sget_simple_extent_dims (space_hid, &elements, &maxdim);
745 int slen = H5Tget_size (type_hid);
746 if (slen < 0)
747 {
748 H5Tclose (type_hid);
749 H5Sclose (space_hid);
750 H5Dclose (data_hid);
751 return false;
752 }
753 else
754 {
755 // hdf5 string arrays store strings of all the
756 // same physical length (I think), which is
757 // slightly wasteful, but oh well.
758
759 OCTAVE_LOCAL_BUFFER (char, s, elements * (slen+1));
760
761 // create datatype for (null-terminated) string
762 // to read into:
763 hid_t st_id = H5Tcopy (H5T_C_S1);
764 H5Tset_size (st_id, slen+1);
765
766 if (H5Dread (data_hid, st_id, octave_H5S_ALL,
768 {
769 H5Tclose (st_id);
770 H5Tclose (type_hid);
771 H5Sclose (space_hid);
772 H5Dclose (data_hid);
773 return false;
774 }
775
776 charMatrix chm (elements, slen, ' ');
777 for (hsize_t i = 0; i < elements; ++i)
778 {
779 chm.insert (s + i*(slen+1), i, 0);
780 }
781
782 m_matrix = chm;
783
784 H5Tclose (st_id);
785 H5Tclose (type_hid);
786 H5Sclose (space_hid);
787 H5Dclose (data_hid);
788 return true;
789 }
790 }
791 else
792 {
793 H5Tclose (type_hid);
794 H5Sclose (space_hid);
795 H5Dclose (data_hid);
796 return false;
797 }
798 }
799
800#else
801 octave_unused_parameter (loc_id);
802 octave_unused_parameter (name);
803
804 warn_load ("hdf5");
805#endif
806
807 return retval;
808}
void swap_bytes< 4 >(void *ptr)
Definition byte-swap.h:63
N Dimensional Array with copy-on-write semantics.
Definition Array.h:130
const dim_vector & dims() const
Return a const-reference so that dims ()(i) works efficiently.
Definition Array.h:507
T & xelem(octave_idx_type n)
Size of the specified dimension.
Definition Array.h:525
Array< T, Alloc > index(const octave::idx_vector &i) const
Indexing without resizing.
void clear()
int ndims() const
Size of the specified dimension.
Definition Array.h:679
octave_idx_type rows() const
Definition Array.h:463
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
octave_idx_type cols() const
Definition Array.h:473
bool isempty() const
Size of the specified dimension.
Definition Array.h:652
const T * data() const
Size of the specified dimension.
Definition Array.h:665
T * rwdata()
Size of the specified dimension.
octave_idx_type numel() const
Number of elements in the array.
Definition Array.h:418
void resize(octave_idx_type nr, octave_idx_type nc, char rfv=0)
Definition chMatrix.h:96
charMatrix & insert(const char *s, octave_idx_type r, octave_idx_type c)
Definition chMatrix.cc:59
std::string row_as_string(octave_idx_type, bool strip_ws=false) const
Definition chMatrix.cc:82
Vector representing the dimensions (size) of an Array.
Definition dim-vector.h:90
std::string str(char sep='x') const
Definition dim-vector.cc:68
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition dim-vector.h:331
void resize(int n, int fill_value=0)
Definition dim-vector.h:268
octave_idx_type ndims() const
Number of dimensions.
Definition dim-vector.h:253
octave_idx_type numel() const
octave_idx_type rows() const
Definition ov-base.h:384
int current_print_indent_level() const
Definition ov-base.h:945
bool is_zero_by_zero() const
Definition ov-base.h:431
void warn_load(const char *type) const
Definition ov-base.cc:1152
virtual bool is_sq_string() const
Definition ov-base.h:457
friend class octave_value
Definition ov-base.h:278
void warn_save(const char *type) const
Definition ov-base.cc:1161
void short_disp(std::ostream &os) const
ComplexMatrix complex_matrix_value(bool=false) const
NDArray array_value(bool=false) const
std::string type_name() const
Definition ov-str-mat.h:182
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
bool load_ascii(std::istream &is)
Array< std::string > cellstr_value() const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
octave_value resize(const dim_vector &dv, bool fill=false) const
string_vector string_vector_value(bool pad=false) const
Matrix matrix_value(bool=false) const
Complex complex_value(bool=false) const
bool save_ascii(std::ostream &os)
double double_value(bool=false) const
std::string edit_display(const float_display_format &fmt, octave_idx_type i, octave_idx_type j) const
octave_value do_index_op_internal(const octave_value_list &idx, bool resize_ok, char type='"')
Definition ov-str-mat.cc:90
ComplexNDArray complex_array_value(bool=false) const
std::string string_value(bool force=false) const
type_conv_info numeric_conversion_function() const
Definition ov-str-mat.cc:83
bool save_binary(std::ostream &os, bool save_as_floats)
charMatrix char_matrix_value(bool=false) const
Definition ov-ch-mat.h:143
charNDArray char_array_value(bool=false) const
Definition ov-ch-mat.h:146
static int static_type_id()
Definition ov-re-mat.h:249
octave_idx_type length() const
Definition ovl.h:111
void resize(octave_idx_type n, const std::string &rfv="")
Definition str-vec.h:93
const octave_hdf5_id octave_H5P_DEFAULT
const octave_hdf5_id octave_H5S_ALL
void warning_with_id(const char *id, const char *fmt,...)
Definition error.cc:1093
void error(const char *fmt,...)
Definition error.cc:1003
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector &d)
Definition ls-hdf5.cc:1254
int load_hdf5_empty(octave_hdf5_id loc_id, const char *name, dim_vector &d)
Definition ls-hdf5.cc:1311
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
std::complex< double > Complex
Definition oct-cmplx.h:33
int64_t octave_hdf5_id
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
Definition oct-locbuf.h:44
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
Definition ov-base.h:246
#define CHAR_MATRIX_CONV(TNAME, FCN)
#define panic_if(cond)
Definition panic.h:57
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)
F77_RET_T len
Definition xerbla.cc:61