GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
ov-bool-sparse.cc
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1998-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 <istream>
31#include <ostream>
32#include <vector>
33
34#include "dim-vector.h"
35
36#include "mxarray.h"
37#include "errwarn.h"
38#include "ops.h"
39#include "oct-locbuf.h"
40
41#include "oct-hdf5.h"
42
43#include "ov-re-sparse.h"
44#include "ov-cx-sparse.h"
45#include "ov-bool-sparse.h"
46
47#include "ov-base-sparse.h"
48#include "ov-base-sparse.cc"
49
51 "sparse bool matrix", "logical");
52
53static octave_base_value *
54default_numeric_conversion_function (const octave_base_value& a)
55{
57 = dynamic_cast<const octave_sparse_bool_matrix&> (a);
58
59 return
61}
62
69
70double
72{
73 if (isempty ())
74 err_invalid_conversion ("bool sparse matrix", "real scalar");
75
76 if (numel () > 1)
77 warn_implicit_conversion ("Octave:array-to-scalar",
78 "bool sparse matrix", "real scalar");
79
80 return matrix(0, 0);
81}
82
85{
86 if (rows () == 0 || columns () == 0)
87 err_invalid_conversion ("bool sparse matrix", "complex scalar");
88
89 if (numel () > 1)
90 warn_implicit_conversion ("Octave:array-to-scalar",
91 "bool sparse matrix", "complex scalar");
92
93 return Complex (matrix(0, 0), 0);
94}
95
98 char type) const
99{
101 return tmp.convert_to_str (pad, force, type);
102}
103
104// FIXME: These are inefficient ways of creating full matrices
105
106Matrix
111
117
123
129
132{
133 charNDArray retval (dims (), 0);
136
137 for (octave_idx_type j = 0; j < nc; j++)
138 for (octave_idx_type i = matrix.cidx (j); i < matrix.cidx (j+1); i++)
139 retval(matrix.ridx (i) + nr * j) = static_cast<char> (matrix.data (i));
140
141 return retval;
142}
143
149
155
158{
159 return SparseMatrix (this->matrix);
160}
161
167
170{
171 return SparseMatrix (this->matrix);
172}
173
174bool
176{
177 const dim_vector& dv = this->dims ();
178 if (dv.ndims () < 1)
179 return false;
180
181 // Ensure that additional memory is deallocated
183
184 octave_idx_type nr = dv(0);
185 octave_idx_type nc = dv(1);
186 octave_idx_type nz = nnz ();
187
188 // For compatiblity, indices are always saved with 4 bytes
189#if OCTAVE_SIZEOF_IDX_TYPE == OCTAVE_SIZEOF_INT
190 if (nr < 0 || nc < 0 || nz < 0)
191 return false;
192#else
193 octave_idx_type max_val = std::numeric_limits<uint32_t>::max ();
194 if (nr < 0 || nr > max_val || nc < 0 || nc > max_val
195 || nz < 0 || nz > max_val)
196 return false;
197#endif
198
199 int32_t itmp;
200 // Use negative value for ndims to be consistent with other formats
201 itmp = -2;
202 os.write (reinterpret_cast<char *> (&itmp), 4);
203
204 itmp = nr;
205 os.write (reinterpret_cast<char *> (&itmp), 4);
206
207 itmp = nc;
208 os.write (reinterpret_cast<char *> (&itmp), 4);
209
210 itmp = nz;
211 os.write (reinterpret_cast<char *> (&itmp), 4);
212
213 // add one to the printed indices to go from
214 // zero-based to one-based arrays
215 for (int i = 0; i < nc+1; i++)
216 {
217 octave_quit ();
218 itmp = matrix.cidx (i);
219 os.write (reinterpret_cast<char *> (&itmp), 4);
220 }
221
222 for (int i = 0; i < nz; i++)
223 {
224 octave_quit ();
225 itmp = matrix.ridx (i);
226 os.write (reinterpret_cast<char *> (&itmp), 4);
227 }
228
229 OCTAVE_LOCAL_BUFFER (char, htmp, nz);
230
231 for (int i = 0; i < nz; i++)
232 htmp[i] = (matrix.data (i) ? 1 : 0);
233
234 os.write (htmp, nz);
235
236 return true;
237}
238
239bool
240octave_sparse_bool_matrix::load_binary (std::istream& is, bool swap,
241 octave::mach_info::float_format /* fmt */)
242{
243 int32_t nz, nc, nr, tmp;
244 if (! is.read (reinterpret_cast<char *> (&tmp), 4))
245 return false;
246
247 if (swap)
248 swap_bytes<4> (&tmp);
249
250 if (tmp != -2)
251 error ("load: only 2-D sparse matrices are supported");
252
253 if (! is.read (reinterpret_cast<char *> (&nr), 4))
254 return false;
255 if (! is.read (reinterpret_cast<char *> (&nc), 4))
256 return false;
257 if (! is.read (reinterpret_cast<char *> (&nz), 4))
258 return false;
259
260 if (swap)
261 {
262 swap_bytes<4> (&nr);
263 swap_bytes<4> (&nc);
264 swap_bytes<4> (&nz);
265 }
266
267 SparseBoolMatrix m (static_cast<octave_idx_type> (nr),
268 static_cast<octave_idx_type> (nc),
269 static_cast<octave_idx_type> (nz));
270
271 for (int i = 0; i < nc+1; i++)
272 {
273 octave_quit ();
274 if (! is.read (reinterpret_cast<char *> (&tmp), 4))
275 return false;
276 if (swap)
277 swap_bytes<4> (&tmp);
278 m.cidx (i) = tmp;
279 }
280
281 for (int i = 0; i < nz; i++)
282 {
283 octave_quit ();
284 if (! is.read (reinterpret_cast<char *> (&tmp), 4))
285 return false;
286 if (swap)
287 swap_bytes<4> (&tmp);
288 m.ridx (i) = tmp;
289 }
290
291 if (! is)
292 return false;
293
294 OCTAVE_LOCAL_BUFFER (char, htmp, nz);
295
296 if (! is.read (htmp, nz))
297 return false;
298
299 for (int i = 0; i < nz; i++)
300 m.data(i) = (htmp[i] ? 1 : 0);
301
302 if (! m.indices_ok ())
303 return false;
304
305 matrix = m;
306
307 return true;
308}
309
310bool
312 bool)
313{
314 bool retval = false;
315
316#if defined (HAVE_HDF5)
317
318 const dim_vector& dv = dims ();
319 int empty = save_hdf5_empty (loc_id, name, dv);
320 if (empty)
321 return (empty > 0);
322
323 // Ensure that additional memory is deallocated
325#if defined (HAVE_HDF5_18)
326 hid_t group_hid = H5Gcreate (loc_id, name, octave_H5P_DEFAULT,
328#else
329 hid_t group_hid = H5Gcreate (loc_id, name, 0);
330#endif
331 if (group_hid < 0)
332 return false;
333
334 hid_t space_hid, data_hid;
335 space_hid = data_hid = -1;
337 octave_idx_type tmp;
338 hsize_t hdims[2];
339
340 space_hid = H5Screate_simple (0, hdims, nullptr);
341 if (space_hid < 0)
342 {
343 H5Gclose (group_hid);
344 return false;
345 }
346#if defined (HAVE_HDF5_18)
347 data_hid = H5Dcreate (group_hid, "nr", H5T_NATIVE_IDX, space_hid,
350#else
351 data_hid = H5Dcreate (group_hid, "nr", H5T_NATIVE_IDX, space_hid,
353#endif
354 if (data_hid < 0)
355 {
356 H5Sclose (space_hid);
357 H5Gclose (group_hid);
358 return false;
359 }
360
361 tmp = m.rows ();
362 retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL,
364 H5Dclose (data_hid);
365 if (! retval)
366 {
367 H5Sclose (space_hid);
368 H5Gclose (group_hid);
369 return false;
370 }
371
372#if defined (HAVE_HDF5_18)
373 data_hid = H5Dcreate (group_hid, "nc", H5T_NATIVE_IDX, space_hid,
376#else
377 data_hid = H5Dcreate (group_hid, "nc", H5T_NATIVE_IDX, space_hid,
379#endif
380 if (data_hid < 0)
381 {
382 H5Sclose (space_hid);
383 H5Gclose (group_hid);
384 return false;
385 }
386
387 tmp = m.cols ();
388 retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL,
389 octave_H5P_DEFAULT, &tmp) >= 0;
390 H5Dclose (data_hid);
391 if (! retval)
392 {
393 H5Sclose (space_hid);
394 H5Gclose (group_hid);
395 return false;
396 }
397
398#if defined (HAVE_HDF5_18)
399 data_hid = H5Dcreate (group_hid, "nz", H5T_NATIVE_IDX, space_hid,
402#else
403 data_hid = H5Dcreate (group_hid, "nz", H5T_NATIVE_IDX, space_hid,
405#endif
406 if (data_hid < 0)
407 {
408 H5Sclose (space_hid);
409 H5Gclose (group_hid);
410 return false;
411 }
412
413 tmp = m.nnz ();
414 retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL,
415 octave_H5P_DEFAULT, &tmp) >= 0;
416 H5Dclose (data_hid);
417 if (! retval)
418 {
419 H5Sclose (space_hid);
420 H5Gclose (group_hid);
421 return false;
422 }
423
424 H5Sclose (space_hid);
425
426 hdims[0] = m.cols () + 1;
427 hdims[1] = 1;
428
429 space_hid = H5Screate_simple (2, hdims, nullptr);
430
431 if (space_hid < 0)
432 {
433 H5Gclose (group_hid);
434 return false;
435 }
436
437#if defined (HAVE_HDF5_18)
438 data_hid = H5Dcreate (group_hid, "cidx", H5T_NATIVE_IDX, space_hid,
441#else
442 data_hid = H5Dcreate (group_hid, "cidx", H5T_NATIVE_IDX, space_hid,
444#endif
445 if (data_hid < 0)
446 {
447 H5Sclose (space_hid);
448 H5Gclose (group_hid);
449 return false;
450 }
451
452 octave_idx_type *itmp = m.xcidx ();
453 retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL,
454 octave_H5P_DEFAULT, itmp) >= 0;
455 H5Dclose (data_hid);
456 if (! retval)
457 {
458 H5Sclose (space_hid);
459 H5Gclose (group_hid);
460 return false;
461 }
462
463 H5Sclose (space_hid);
464
465 hdims[0] = m.nnz ();
466 hdims[1] = 1;
467
468 space_hid = H5Screate_simple (2, hdims, nullptr);
469
470 if (space_hid < 0)
471 {
472 H5Gclose (group_hid);
473 return false;
474 }
475
476#if defined (HAVE_HDF5_18)
477 data_hid = H5Dcreate (group_hid, "ridx", H5T_NATIVE_IDX, space_hid,
480#else
481 data_hid = H5Dcreate (group_hid, "ridx", H5T_NATIVE_IDX, space_hid,
483#endif
484 if (data_hid < 0)
485 {
486 H5Sclose (space_hid);
487 H5Gclose (group_hid);
488 return false;
489 }
490
491 itmp = m.xridx ();
492 retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL,
493 octave_H5P_DEFAULT, itmp) >= 0;
494 H5Dclose (data_hid);
495 if (! retval)
496 {
497 H5Sclose (space_hid);
498 H5Gclose (group_hid);
499 return false;
500 }
501
502#if defined (HAVE_HDF5_18)
503 data_hid = H5Dcreate (group_hid, "data", H5T_NATIVE_HBOOL, space_hid,
506#else
507 data_hid = H5Dcreate (group_hid, "data", H5T_NATIVE_HBOOL, space_hid,
509#endif
510 if (data_hid < 0)
511 {
512 H5Sclose (space_hid);
513 H5Gclose (group_hid);
514 return false;
515 }
516
517 OCTAVE_LOCAL_BUFFER (hbool_t, htmp, m.nnz ());
518 for (int i = 0; i < m.nnz (); i++)
519 htmp[i] = m.xdata(i);
520
521 retval = H5Dwrite (data_hid, H5T_NATIVE_HBOOL, octave_H5S_ALL, octave_H5S_ALL,
522 octave_H5P_DEFAULT, htmp) >= 0;
523 H5Dclose (data_hid);
524 H5Sclose (space_hid);
525 H5Gclose (group_hid);
526
527#else
528 octave_unused_parameter (loc_id);
529 octave_unused_parameter (name);
530
531 warn_save ("hdf5");
532#endif
533
534 return retval;
535}
536
537bool
539{
540 bool retval = false;
541
542#if defined (HAVE_HDF5)
543
544 octave_idx_type nr, nc, nz;
545 hid_t group_hid, data_hid, space_hid;
546 hsize_t rank;
547
548 dim_vector dv;
549 int empty = load_hdf5_empty (loc_id, name, dv);
550 if (empty > 0)
551 matrix.resize (dv);
552 if (empty)
553 return (empty > 0);
554
555#if defined (HAVE_HDF5_18)
556 group_hid = H5Gopen (loc_id, name, octave_H5P_DEFAULT);
557#else
558 group_hid = H5Gopen (loc_id, name);
559#endif
560 if (group_hid < 0) return false;
561
562#if defined (HAVE_HDF5_18)
563 data_hid = H5Dopen (group_hid, "nr", octave_H5P_DEFAULT);
564#else
565 data_hid = H5Dopen (group_hid, "nr");
566#endif
567 space_hid = H5Dget_space (data_hid);
568 rank = H5Sget_simple_extent_ndims (space_hid);
569
570 if (rank != 0)
571 {
572 H5Dclose (data_hid);
573 H5Gclose (group_hid);
574 return false;
575 }
576
577 if (H5Dread (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL,
579 < 0)
580 {
581 H5Dclose (data_hid);
582 H5Gclose (group_hid);
583 return false;
584 }
585
586 H5Dclose (data_hid);
587
588#if defined (HAVE_HDF5_18)
589 data_hid = H5Dopen (group_hid, "nc", octave_H5P_DEFAULT);
590#else
591 data_hid = H5Dopen (group_hid, "nc");
592#endif
593 space_hid = H5Dget_space (data_hid);
594 rank = H5Sget_simple_extent_ndims (space_hid);
595
596 if (rank != 0)
597 {
598 H5Dclose (data_hid);
599 H5Gclose (group_hid);
600 return false;
601 }
602
603 if (H5Dread (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL,
605 < 0)
606 {
607 H5Dclose (data_hid);
608 H5Gclose (group_hid);
609 return false;
610 }
611
612 H5Dclose (data_hid);
613
614#if defined (HAVE_HDF5_18)
615 data_hid = H5Dopen (group_hid, "nz", octave_H5P_DEFAULT);
616#else
617 data_hid = H5Dopen (group_hid, "nz");
618#endif
619 space_hid = H5Dget_space (data_hid);
620 rank = H5Sget_simple_extent_ndims (space_hid);
621
622 if (rank != 0)
623 {
624 H5Dclose (data_hid);
625 H5Gclose (group_hid);
626 return false;
627 }
628
629 if (H5Dread (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL,
631 < 0)
632 {
633 H5Dclose (data_hid);
634 H5Gclose (group_hid);
635 return false;
636 }
637
638 H5Dclose (data_hid);
639
640 SparseBoolMatrix m (static_cast<octave_idx_type> (nr),
641 static_cast<octave_idx_type> (nc),
642 static_cast<octave_idx_type> (nz));
643
644#if defined (HAVE_HDF5_18)
645 data_hid = H5Dopen (group_hid, "cidx", octave_H5P_DEFAULT);
646#else
647 data_hid = H5Dopen (group_hid, "cidx");
648#endif
649 space_hid = H5Dget_space (data_hid);
650 rank = H5Sget_simple_extent_ndims (space_hid);
651
652 if (rank != 2)
653 {
654 H5Sclose (space_hid);
655 H5Dclose (data_hid);
656 H5Gclose (group_hid);
657 return false;
658 }
659
660 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
661 OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank);
662
663 H5Sget_simple_extent_dims (space_hid, hdims, maxdims);
664
665 if (static_cast<int> (hdims[0]) != nc + 1
666 || static_cast<int> (hdims[1]) != 1)
667 {
668 H5Sclose (space_hid);
669 H5Dclose (data_hid);
670 H5Gclose (group_hid);
671 return false;
672 }
673
674 octave_idx_type *itmp = m.xcidx ();
675 if (H5Dread (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL,
676 octave_H5P_DEFAULT, itmp)
677 < 0)
678 {
679 H5Sclose (space_hid);
680 H5Dclose (data_hid);
681 H5Gclose (group_hid);
682 return false;
683 }
684
685 H5Sclose (space_hid);
686 H5Dclose (data_hid);
687
688#if defined (HAVE_HDF5_18)
689 data_hid = H5Dopen (group_hid, "ridx", octave_H5P_DEFAULT);
690#else
691 data_hid = H5Dopen (group_hid, "ridx");
692#endif
693 space_hid = H5Dget_space (data_hid);
694 rank = H5Sget_simple_extent_ndims (space_hid);
695
696 if (rank != 2)
697 {
698 H5Sclose (space_hid);
699 H5Dclose (data_hid);
700 H5Gclose (group_hid);
701 return false;
702 }
703
704 H5Sget_simple_extent_dims (space_hid, hdims, maxdims);
705
706 if (static_cast<int> (hdims[0]) != nz
707 || static_cast<int> (hdims[1]) != 1)
708 {
709 H5Sclose (space_hid);
710 H5Dclose (data_hid);
711 H5Gclose (group_hid);
712 return false;
713 }
714
715 itmp = m.xridx ();
716 if (H5Dread (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL,
717 octave_H5P_DEFAULT, itmp) < 0)
718 {
719 H5Sclose (space_hid);
720 H5Dclose (data_hid);
721 H5Gclose (group_hid);
722 return false;
723 }
724
725 H5Sclose (space_hid);
726 H5Dclose (data_hid);
727
728#if defined (HAVE_HDF5_18)
729 data_hid = H5Dopen (group_hid, "data", octave_H5P_DEFAULT);
730#else
731 data_hid = H5Dopen (group_hid, "data");
732#endif
733 space_hid = H5Dget_space (data_hid);
734 rank = H5Sget_simple_extent_ndims (space_hid);
735
736 if (rank != 2)
737 {
738 H5Sclose (space_hid);
739 H5Dclose (data_hid);
740 H5Gclose (group_hid);
741 return false;
742 }
743
744 H5Sget_simple_extent_dims (space_hid, hdims, maxdims);
745
746 if (static_cast<int> (hdims[0]) != nz
747 || static_cast<int> (hdims[1]) != 1)
748 {
749 H5Sclose (space_hid);
750 H5Dclose (data_hid);
751 H5Gclose (group_hid);
752 return false;
753 }
754
755 OCTAVE_LOCAL_BUFFER (hbool_t, htmp, nz);
756
757 if (H5Dread (data_hid, H5T_NATIVE_HBOOL, octave_H5S_ALL, octave_H5S_ALL,
758 octave_H5P_DEFAULT, htmp) >= 0
759 && m.indices_ok ())
760 {
761 retval = true;
762
763 for (int i = 0; i < nz; i++)
764 m.xdata(i) = htmp[i];
765
766 matrix = m;
767 }
768
769 H5Sclose (space_hid);
770 H5Dclose (data_hid);
771 H5Gclose (group_hid);
772
773#else
774 octave_unused_parameter (loc_id);
775 octave_unused_parameter (name);
776
777 warn_load ("hdf5");
778#endif
779
780 return retval;
781}
782
783mxArray *
785{
786 mwSize nz = nzmax ();
787 mwSize nr = rows ();
788 mwSize nc = columns ();
789
790 mxArray *retval = new mxArray (interleaved, mxLOGICAL_CLASS, nr, nc, nz,
791 mxREAL);
792
793 mxLogical *pd = static_cast<mxLogical *> (retval->get_data ());
794 mwIndex *ir = retval->get_ir ();
795
796 const bool *pdata = matrix.data ();
797 const octave_idx_type *pridx = matrix.ridx ();
798
799 for (mwIndex i = 0; i < nz; i++)
800 {
801 pd[i] = pdata[i];
802
803 ir[i] = pridx[i];
804 }
805
806 mwIndex *jc = retval->get_jc ();
807
808 const octave_idx_type *pcidx = matrix.cidx ();
809
810 for (mwIndex i = 0; i < nc + 1; i++)
811 jc[i] = pcidx[i];
812
813 return retval;
814}
void swap_bytes< 4 >(void *ptr)
Definition byte-swap.h:63
boolMatrix matrix_value() const
octave_idx_type cols() const
Definition Sparse.h:349
octave_idx_type * cidx()
Definition Sparse.h:593
T * data()
Definition Sparse.h:571
void resize(octave_idx_type r, octave_idx_type c)
Definition Sparse.cc:992
bool indices_ok() const
Definition Sparse.h:746
T * xdata()
Definition Sparse.h:573
octave_idx_type * ridx()
Definition Sparse.h:580
Sparse< T, Alloc > maybe_compress(bool remove_zeros=false)
Definition Sparse.h:528
octave_idx_type nnz() const
Actual number of nonzero terms.
Definition Sparse.h:336
octave_idx_type rows() const
Definition Sparse.h:348
octave_idx_type * xcidx()
Definition Sparse.h:599
octave_idx_type * xridx()
Definition Sparse.h:586
Vector representing the dimensions (size) of an Array.
Definition dim-vector.h:90
octave_idx_type ndims() const
Number of dimensions.
Definition dim-vector.h:253
mwIndex * get_jc() const
Definition mxarray.h:565
mwIndex * get_ir() const
Definition mxarray.h:563
void * get_data() const
Definition mxarray.h:482
octave_idx_type rows() const
Definition ov-base.h:384
octave_idx_type columns() const
Definition ov-base.h:391
void warn_load(const char *type) const
Definition ov-base.cc:1152
bool isempty() const
Definition ov-base.h:429
friend class octave_value
Definition ov-base.h:278
void warn_save(const char *type) const
Definition ov-base.cc:1161
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
octave_value as_double() const
double double_value(bool=false) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
type_conv_info numeric_conversion_function() const
NDArray array_value(bool=false) const
Complex complex_value(bool=false) const
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
charNDArray char_array_value(bool=false) const
ComplexMatrix complex_matrix_value(bool=false) const
boolMatrix bool_matrix_value(bool=false) const
ComplexNDArray complex_array_value(bool=false) const
octave_value convert_to_str_internal(bool pad, bool force, char type) const
SparseMatrix sparse_matrix_value(bool=false) const
SparseBoolMatrix sparse_bool_matrix_value(bool=false) const
bool save_binary(std::ostream &os, bool save_as_floats)
Matrix matrix_value(bool=false) const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
mxArray * as_mxArray(bool interleaved) const
boolNDArray bool_array_value(bool=false) const
static int static_type_id()
octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
Definition ov.h:1322
const octave_hdf5_id octave_H5P_DEFAULT
const octave_hdf5_id octave_H5S_ALL
void error(const char *fmt,...)
Definition error.cc:1003
void err_invalid_conversion(const std::string &from, const std::string &to)
Definition errwarn.cc:71
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Definition errwarn.cc:344
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::complex< double > Complex
Definition oct-cmplx.h:33
int64_t octave_hdf5_id
#define H5T_NATIVE_IDX
Definition oct-hdf5.h:42
#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