GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-flt-cx-mat.cc
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-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#if defined (HAVE_CONFIG_H)
27# include "config.h"
28#endif
29
30#include <clocale>
31#include <istream>
32#include <ostream>
33#include <vector>
34
35#include "dNDArray.h"
36#include "fNDArray.h"
37
38#include "data-conv.h"
39#include "lo-ieee.h"
40#include "lo-specfun.h"
41#include "lo-mappers.h"
42#include "mx-base.h"
43#include "mach-info.h"
44#include "oct-locbuf.h"
45
46#include "errwarn.h"
47#include "mxarray.h"
48#include "ovl.h"
49#include "oct-hdf5.h"
50#include "oct-stream.h"
51#include "ops.h"
52#include "ov-base.h"
53#include "ov-base-mat.h"
54#include "ov-base-mat.cc"
55#include "ov-complex.h"
56#include "ov-flt-complex.h"
57#include "ov-cx-mat.h"
58#include "ov-flt-cx-mat.h"
59#include "ov-re-mat.h"
60#include "ov-flt-re-mat.h"
61#include "ov-scalar.h"
62#include "ov-float.h"
63#include "pr-output.h"
64#include "ops.h"
65
66#include "byte-swap.h"
67#include "ls-oct-text.h"
68#include "ls-hdf5.h"
69#include "ls-utils.h"
70
71
73
75 "float complex matrix", "single");
76
79{
80 octave_base_value *retval = nullptr;
81
82 if (matrix.numel () == 1)
83 {
84 FloatComplex c = matrix (0);
85
86 if (c.imag () == 0.0)
87 retval = new octave_float_scalar (c.real ());
88 else
89 retval = new octave_float_complex (c);
90 }
91 else if (matrix.all_elements_are_real ())
92 retval = new octave_float_matrix (::real (matrix));
93
94 return retval;
95}
96
97double
98octave_float_complex_matrix::double_value (bool force_conversion) const
99{
100 if (! force_conversion)
101 warn_implicit_conversion ("Octave:imag-to-real",
102 "complex matrix", "real scalar");
103
104 if (rows () == 0 || columns () == 0)
105 err_invalid_conversion ("complex matrix", "real scalar");
106
107 warn_implicit_conversion ("Octave:array-to-scalar",
108 "complex matrix", "real scalar");
109
110 return std::real (matrix(0, 0));
111}
112
113float
114octave_float_complex_matrix::float_value (bool force_conversion) const
115{
116 if (! force_conversion)
117 warn_implicit_conversion ("Octave:imag-to-real",
118 "complex matrix", "real scalar");
119
120 if (rows () == 0 || columns () == 0)
121 err_invalid_conversion ("complex matrix", "real scalar");
122
123 warn_implicit_conversion ("Octave:array-to-scalar",
124 "complex matrix", "real scalar");
125
126 return std::real (matrix(0, 0));
127}
128
129Matrix
130octave_float_complex_matrix::matrix_value (bool force_conversion) const
131{
132 Matrix retval;
133
134 if (! force_conversion)
135 warn_implicit_conversion ("Octave:imag-to-real",
136 "complex matrix", "real matrix");
137
138 retval = ::real (FloatComplexMatrix (matrix));
139
140 return retval;
141}
142
145{
146 FloatMatrix retval;
147
148 if (! force_conversion)
149 warn_implicit_conversion ("Octave:imag-to-real",
150 "complex matrix", "real matrix");
151
152 retval = ::real (FloatComplexMatrix (matrix));
153
154 return retval;
155}
156
159{
160 if (rows () == 0 || columns () == 0)
161 err_invalid_conversion ("complex matrix", "complex scalar");
162
163 warn_implicit_conversion ("Octave:array-to-scalar",
164 "complex matrix", "complex scalar");
165
166 return matrix(0, 0);
167}
168
171{
172 float tmp = lo_ieee_float_nan_value ();
173
174 FloatComplex retval (tmp, tmp);
175
176 if (rows () == 0 || columns () == 0)
177 err_invalid_conversion ("complex matrix", "complex scalar");
178
179 warn_implicit_conversion ("Octave:array-to-scalar",
180 "complex matrix", "complex scalar");
181
182 retval = matrix(0, 0);
183
184 return retval;
185}
186
189{
190 return FloatComplexMatrix (matrix);
191}
192
195{
196 return FloatComplexMatrix (matrix);
197}
198
201{
204 if (warn && (! matrix.all_elements_are_real ()
205 || real (matrix).any_element_not_one_or_zero ()))
207
208 return mx_el_ne (matrix, FloatComplex (0.0));
209}
210
213{
214 charNDArray retval;
215
216 if (! frc_str_conv)
217 warn_implicit_conversion ("Octave:num-to-str",
218 "complex matrix", "string");
219 else
220 {
221 retval = charNDArray (dims ());
222 octave_idx_type nel = numel ();
223
224 for (octave_idx_type i = 0; i < nel; i++)
225 retval.elem (i) = static_cast<char> (std::real (matrix.elem (i)));
226 }
227
228 return retval;
229}
230
233{
235}
236
239{
240 SparseMatrix retval;
241
242 if (! force_conversion)
243 warn_implicit_conversion ("Octave:imag-to-real",
244 "complex matrix", "real matrix");
245
247
248 return retval;
249}
250
253{
255}
256
259{
260 return ComplexNDArray (matrix);
261}
262
265{
266 return matrix;
267}
268
271{
272 octave_value retval;
273 if (k == 0 && matrix.ndims () == 2
274 && (matrix.rows () == 1 || matrix.columns () == 1))
276 else
278
279 return retval;
280}
281
284{
285 if (matrix.ndims () != 2
286 || (matrix.rows () != 1 && matrix.columns () != 1))
287 error ("diag: expecting vector argument");
288
290
291 return mat.diag (m, n);
292}
293
294bool
296{
297 dim_vector dv = dims ();
298
299 if (dv.ndims () > 2)
300 {
302
303 os << "# ndims: " << dv.ndims () << "\n";
304
305 for (int i = 0; i < dv.ndims (); i++)
306 os << ' ' << dv(i);
307
308 os << "\n" << tmp;
309 }
310 else
311 {
312 // Keep this case, rather than use generic code above for backward
313 // compatibility. Makes load_ascii much more complex!!
314 os << "# rows: " << rows () << "\n"
315 << "# columns: " << columns () << "\n";
316
317 os << complex_matrix_value ();
318 }
319
320 return true;
321}
322
323bool
325{
326 string_vector keywords(2);
327
328 keywords[0] = "ndims";
329 keywords[1] = "rows";
330
331 std::string kw;
332 octave_idx_type val = 0;
333
334 if (! extract_keyword (is, keywords, kw, val, true))
335 error ("load: failed to extract number of rows and columns");
336
337 // Set "C" locale for the duration of this function to avoid the performance
338 // panelty of frequently switching the locale when reading floating point
339 // values from the stream.
340 char *prev_locale = std::setlocale (LC_ALL, nullptr);
341 std::string old_locale (prev_locale ? prev_locale : "");
342 std::setlocale (LC_ALL, "C");
344 ([&old_locale] () { std::setlocale (LC_ALL, old_locale.c_str ()); });
345
346 if (kw == "ndims")
347 {
348 int mdims = static_cast<int> (val);
349
350 if (mdims < 0)
351 error ("load: failed to extract number of dimensions");
352
353 dim_vector dv;
354 dv.resize (mdims);
355
356 for (int i = 0; i < mdims; i++)
357 is >> dv(i);
358
359 if (! is)
360 error ("load: failed to read dimensions");
361
362 FloatComplexNDArray tmp(dv);
363
364 is >> tmp;
365
366 if (! is)
367 error ("load: failed to load matrix constant");
368
369 matrix = tmp;
370 }
371 else if (kw == "rows")
372 {
373 octave_idx_type nr = val;
374 octave_idx_type nc = 0;
375
376 if (nr < 0 || ! extract_keyword (is, "columns", nc) || nc < 0)
377 error ("load: failed to extract number of rows and columns");
378
379 if (nr > 0 && nc > 0)
380 {
381 FloatComplexMatrix tmp (nr, nc);
382 is >> tmp;
383 if (! is)
384 error ("load: failed to load matrix constant");
385
386 matrix = tmp;
387 }
388 else if (nr == 0 || nc == 0)
389 matrix = FloatComplexMatrix (nr, nc);
390 else
392 }
393 else
395
396 return true;
397}
398
399bool
401{
402 dim_vector dv = dims ();
403 if (dv.ndims () < 1)
404 return false;
405
406 // Use negative value for ndims to differentiate with old format!!
407 int32_t tmp = - dv.ndims ();
408 os.write (reinterpret_cast<char *> (&tmp), 4);
409 for (int i = 0; i < dv.ndims (); i++)
410 {
411 tmp = dv(i);
412 os.write (reinterpret_cast<char *> (&tmp), 4);
413 }
414
416 save_type st = LS_FLOAT;
417 if (dv.numel () > 4096) // FIXME: make this configurable.
418 {
419 float max_val, min_val;
420 if (m.all_integers (max_val, min_val))
421 st = octave::get_save_type (max_val, min_val);
422 }
423
424 const FloatComplex *mtmp = m.data ();
425 write_floats (os, reinterpret_cast<const float *> (mtmp), st,
426 2 * dv.numel ());
427
428 return true;
429}
430
431bool
432octave_float_complex_matrix::load_binary (std::istream& is, bool swap,
434{
435 char tmp;
436 int32_t mdims;
437 if (! is.read (reinterpret_cast<char *> (&mdims), 4))
438 return false;
439 if (swap)
440 swap_bytes<4> (&mdims);
441 if (mdims < 0)
442 {
443 mdims = - mdims;
444 int32_t di;
445 dim_vector dv;
446 dv.resize (mdims);
447
448 for (int i = 0; i < mdims; i++)
449 {
450 if (! is.read (reinterpret_cast<char *> (&di), 4))
451 return false;
452 if (swap)
453 swap_bytes<4> (&di);
454 dv(i) = di;
455 }
456
457 // Convert an array with a single dimension to be a row vector.
458 // Octave should never write files like this, other software
459 // might.
460
461 if (mdims == 1)
462 {
463 mdims = 2;
464 dv.resize (mdims);
465 dv(1) = dv(0);
466 dv(0) = 1;
467 }
468
469 if (! is.read (reinterpret_cast<char *> (&tmp), 1))
470 return false;
471
473 FloatComplex *im = m.fortran_vec ();
474 read_floats (is, reinterpret_cast<float *> (im),
475 static_cast<save_type> (tmp), 2 * dv.numel (), swap, fmt);
476
477 if (! is)
478 return false;
479
480 matrix = m;
481 }
482 else
483 {
484 int32_t nr, nc;
485 nr = mdims;
486 if (! is.read (reinterpret_cast<char *> (&nc), 4))
487 return false;
488 if (swap)
489 swap_bytes<4> (&nc);
490 if (! is.read (reinterpret_cast<char *> (&tmp), 1))
491 return false;
492 FloatComplexMatrix m (nr, nc);
493 FloatComplex *im = m.fortran_vec ();
494 octave_idx_type len = static_cast<octave_idx_type> (nr) * nc;
495 read_floats (is, reinterpret_cast<float *> (im),
496 static_cast<save_type> (tmp), 2*len, swap, fmt);
497
498 if (! is)
499 return false;
500
501 matrix = m;
502 }
503 return true;
504}
505
506bool
508 bool)
509{
510 bool retval = false;
511
512#if defined (HAVE_HDF5)
513
514 dim_vector dv = dims ();
515 int empty = save_hdf5_empty (loc_id, name, dv);
516 if (empty)
517 return (empty > 0);
518
519 int rank = dv.ndims ();
520 hid_t space_hid, data_hid, type_hid;
521 space_hid = data_hid = type_hid = -1;
523
524 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
525
526 // Octave uses column-major, while HDF5 uses row-major ordering
527 for (int i = 0; i < rank; i++)
528 hdims[i] = dv(rank-i-1);
529
530 space_hid = H5Screate_simple (rank, hdims, nullptr);
531 if (space_hid < 0) return false;
532
533 hid_t save_type_hid = H5T_NATIVE_FLOAT;
534
535#if defined (HAVE_HDF5_INT2FLOAT_CONVERSIONS)
536 // hdf5 currently doesn't support float/integer conversions
537 else
538 {
539 float max_val, min_val;
540
541 if (m.all_integers (max_val, min_val))
542 save_type_hid
543 = save_type_to_hdf5 (octave::get_save_type (max_val, min_val));
544 }
545#endif
546
547 type_hid = hdf5_make_complex_type (save_type_hid);
548 if (type_hid < 0)
549 {
550 H5Sclose (space_hid);
551 return false;
552 }
553#if defined (HAVE_HDF5_18)
554 data_hid = H5Dcreate (loc_id, name, type_hid, space_hid,
556#else
557 data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT);
558#endif
559 if (data_hid < 0)
560 {
561 H5Sclose (space_hid);
562 H5Tclose (type_hid);
563 return false;
564 }
565
566 hid_t complex_type_hid = hdf5_make_complex_type (H5T_NATIVE_FLOAT);
567 if (complex_type_hid < 0) retval = false;
568
569 if (retval)
570 {
571 FloatComplex *mtmp = m.fortran_vec ();
572 if (H5Dwrite (data_hid, complex_type_hid, octave_H5S_ALL, octave_H5S_ALL,
573 octave_H5P_DEFAULT, mtmp)
574 < 0)
575 {
576 H5Tclose (complex_type_hid);
577 retval = false;
578 }
579 }
580
581 H5Tclose (complex_type_hid);
582 H5Dclose (data_hid);
583 H5Tclose (type_hid);
584 H5Sclose (space_hid);
585
586#else
587 octave_unused_parameter (loc_id);
588 octave_unused_parameter (name);
589
590 warn_save ("hdf5");
591#endif
592
593 return retval;
594}
595
596bool
598{
599 bool retval = false;
600
601#if defined (HAVE_HDF5)
602
603 dim_vector dv;
604 int empty = load_hdf5_empty (loc_id, name, dv);
605 if (empty > 0)
606 matrix.resize (dv);
607 if (empty)
608 return (empty > 0);
609
610#if defined (HAVE_HDF5_18)
611 hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT);
612#else
613 hid_t data_hid = H5Dopen (loc_id, name);
614#endif
615 hid_t type_hid = H5Dget_type (data_hid);
616
617 hid_t complex_type = hdf5_make_complex_type (H5T_NATIVE_FLOAT);
618
619 if (! hdf5_types_compatible (type_hid, complex_type))
620 {
621 H5Tclose (complex_type);
622 H5Dclose (data_hid);
623 return false;
624 }
625
626 hid_t space_id = H5Dget_space (data_hid);
627
628 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
629
630 if (rank < 1)
631 {
632 H5Tclose (complex_type);
633 H5Sclose (space_id);
634 H5Dclose (data_hid);
635 return false;
636 }
637
638 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
639 OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank);
640
641 H5Sget_simple_extent_dims (space_id, hdims, maxdims);
642
643 // Octave uses column-major, while HDF5 uses row-major ordering
644 if (rank == 1)
645 {
646 dv.resize (2);
647 dv(0) = 1;
648 dv(1) = hdims[0];
649 }
650 else
651 {
652 dv.resize (rank);
653 for (hsize_t i = 0, j = rank - 1; i < rank; i++, j--)
654 dv(j) = hdims[i];
655 }
656
657 FloatComplexNDArray m (dv);
658 FloatComplex *reim = m.fortran_vec ();
659 if (H5Dread (data_hid, complex_type, octave_H5S_ALL, octave_H5S_ALL,
660 octave_H5P_DEFAULT, reim)
661 >= 0)
662 {
663 retval = true;
664 matrix = m;
665 }
666
667 H5Tclose (complex_type);
668 H5Sclose (space_id);
669 H5Dclose (data_hid);
670
671#else
672 octave_unused_parameter (loc_id);
673 octave_unused_parameter (name);
674
675 warn_load ("hdf5");
676#endif
677
678 return retval;
679}
680
681void
683 bool pr_as_read_syntax) const
684{
685 octave_print_internal (os, matrix, pr_as_read_syntax,
687}
688
689mxArray *
691{
692 mxArray *retval = new mxArray (interleaved, mxSINGLE_CLASS, dims (),
693 mxCOMPLEX);
694
695 mwSize nel = numel ();
696
697 const FloatComplex *pdata = matrix.data ();
698
699 if (interleaved)
700 {
701 mxComplexSingle *pd
702 = static_cast<mxComplexSingle *> (retval->get_data ());
703
704 for (mwIndex i = 0; i < nel; i++)
705 {
706 pd[i].real = pdata[i].real ();
707 pd[i].imag = pdata[i].imag ();
708 }
709 }
710 else
711 {
712 mxSingle *pr = static_cast<mxSingle *> (retval->get_data ());
713 mxSingle *pi = static_cast<mxSingle *> (retval->get_imag_data ());
714
715 for (mwIndex i = 0; i < nel; i++)
716 {
717 pr[i] = pdata[i].real ();
718 pi[i] = pdata[i].imag ();
719 }
720 }
721
722 return retval;
723}
724
727{
728 switch (umap)
729 {
730 // Mappers handled specially.
731 case umap_real:
733 case umap_imag:
735 case umap_conj:
737
738 // Special cases for Matlab compatibility.
739 case umap_xtolower:
740 case umap_xtoupper:
741 return matrix;
742
743#define ARRAY_METHOD_MAPPER(UMAP, FCN) \
744 case umap_ ## UMAP: \
745 return octave_value (matrix.FCN ())
746
751
752#define ARRAY_MAPPER(UMAP, TYPE, FCN) \
753 case umap_ ## UMAP: \
754 return octave_value (matrix.map<TYPE> (FCN))
755
758 ARRAY_MAPPER (angle, float, std::arg);
759 ARRAY_MAPPER (arg, float, std::arg);
770 ARRAY_MAPPER (cos, FloatComplex, std::cos);
771 ARRAY_MAPPER (cosh, FloatComplex, std::cosh);
772 ARRAY_MAPPER (exp, FloatComplex, std::exp);
776 ARRAY_MAPPER (log, FloatComplex, std::log);
778 ARRAY_MAPPER (log10, FloatComplex, std::log10);
783 ARRAY_MAPPER (sin, FloatComplex, std::sin);
784 ARRAY_MAPPER (sinh, FloatComplex, std::sinh);
785 ARRAY_MAPPER (sqrt, FloatComplex, std::sqrt);
786 ARRAY_MAPPER (tan, FloatComplex, std::tan);
787 ARRAY_MAPPER (tanh, FloatComplex, std::tanh);
789
790 default:
791 return octave_base_value::map (umap);
792 }
793}
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:217
boolMatrix mx_el_ne(const boolMatrix &m1, const boolMatrix &m2)
Definition: boolMatrix.cc:91
void swap_bytes< 4 >(void *ptr)
Definition: byte-swap.h:63
octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:411
T & elem(octave_idx_type n)
Size of the specified dimension.
Definition: Array.h:534
octave_idx_type rows(void) const
Definition: Array.h:449
OCTARRAY_API void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
Definition: Array.cc:1010
octave_idx_type columns(void) const
Definition: Array.h:458
const T * data(void) const
Size of the specified dimension.
Definition: Array.h:616
OCTARRAY_API T * fortran_vec(void)
Size of the specified dimension.
Definition: Array.cc:1744
int ndims(void) const
Size of the specified dimension.
Definition: Array.h:627
OCTAVE_API FloatComplexMatrix diag(octave_idx_type k=0) const
Definition: fCMatrix.cc:2853
OCTAVE_API bool all_integers(float &max_val, float &min_val) const
Definition: fCNDArray.cc:289
OCTAVE_API bool any_element_is_nan(void) const
Definition: fCNDArray.cc:265
OCTAVE_API bool all_elements_are_real(void) const
Definition: fCNDArray.cc:279
Definition: dMatrix.h:42
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
void * get_data(void) const
Definition: mxarray.h:497
void * get_imag_data(void) const
Definition: mxarray.h:562
octave_idx_type numel(void) const
Definition: ov-base-mat.h:118
octave_value diag(octave_idx_type k=0) const
Definition: ov-base-mat.h:138
octave_idx_type columns(void) const
Definition: ov-base.h:355
int current_print_indent_level(void) const
Definition: ov-base.h:893
virtual octave_value map(unary_mapper_t) const
Definition: ov-base.cc:1176
OCTINTERP_API void warn_load(const char *type) const
Definition: ov-base.cc:1152
octave_idx_type rows(void) const
Definition: ov-base.h:348
OCTINTERP_API void warn_save(const char *type) const
Definition: ov-base.cc:1161
mxArray * as_mxArray(bool interleaved) const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
ComplexMatrix complex_matrix_value(bool=false) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
SparseMatrix sparse_matrix_value(bool=false) const
FloatComplex float_complex_value(bool=false) const
FloatComplexNDArray float_complex_array_value(bool=false) const
bool save_binary(std::ostream &os, bool save_as_floats)
FloatComplexMatrix float_complex_matrix_value(bool=false) const
bool save_ascii(std::ostream &os)
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
octave_value diag(octave_idx_type k=0) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
octave_base_value * try_narrowing_conversion(void)
double double_value(bool=false) const
bool load_ascii(std::istream &is)
ComplexNDArray complex_array_value(bool=false) const
Matrix matrix_value(bool=false) const
boolNDArray bool_array_value(bool warn=false) const
charNDArray char_array_value(bool frc_str_conv=false) const
FloatMatrix float_matrix_value(bool=false) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
octave_value as_single(void) const
octave_value as_double(void) const
float float_value(bool=false) const
Complex complex_value(bool=false) const
octave_value map(unary_mapper_t umap) const
const octave_hdf5_id octave_H5P_DEFAULT
const octave_hdf5_id octave_H5S_ALL
ColumnVector real(const ComplexColumnVector &a)
Definition: dColVector.cc:137
ColumnVector imag(const ComplexColumnVector &a)
Definition: dColVector.cc:143
void write_floats(std::ostream &os, const float *data, save_type type, octave_idx_type len)
Definition: data-conv.cc:942
void read_floats(std::istream &is, float *data, save_type type, octave_idx_type len, bool swap, octave::mach_info::float_format fmt)
Definition: data-conv.cc:836
save_type
Definition: data-conv.h:87
@ LS_FLOAT
Definition: data-conv.h:94
void error(const char *fmt,...)
Definition: error.cc:980
#define panic_impossible()
Definition: error.h:411
void err_invalid_conversion(const std::string &from, const std::string &to)
Definition: errwarn.cc:71
void warn_logical_conversion(void)
Definition: errwarn.cc:365
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Definition: errwarn.cc:344
QString name
float lo_ieee_float_nan_value(void)
Definition: lo-ieee.cc:116
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
octave_hdf5_id save_type_to_hdf5(save_type st)
Definition: ls-hdf5.cc:1351
octave_hdf5_id hdf5_make_complex_type(octave_hdf5_id num_type)
Definition: ls-hdf5.cc:405
bool hdf5_types_compatible(octave_hdf5_id t1, octave_hdf5_id t2)
Definition: ls-hdf5.cc:269
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
Definition: ls-oct-text.cc:84
OCTAVE_NAMESPACE_BEGIN save_type get_save_type(double, double)
Definition: ls-utils.cc:40
void mxArray
Definition: mex.h:58
class OCTAVE_API charNDArray
Definition: mx-fwd.h:43
class OCTAVE_API SparseMatrix
Definition: mx-fwd.h:55
class OCTAVE_API FloatComplexMatrix
Definition: mx-fwd.h:34
class OCTAVE_API ComplexNDArray
Definition: mx-fwd.h:39
class OCTAVE_API SparseComplexMatrix
Definition: mx-fwd.h:56
class OCTAVE_API FloatComplexNDArray
Definition: mx-fwd.h:41
class OCTAVE_API FloatComplexDiagMatrix
Definition: mx-fwd.h:62
std::complex< double > erfi(std::complex< double > z, double relerr=0)
std::complex< double > erfc(std::complex< double > z, double relerr=0)
std::complex< double > erfcx(std::complex< double > z, double relerr=0)
std::complex< double > erf(std::complex< double > z, double relerr=0)
double fix(double x)
Definition: lo-mappers.h:118
Complex atan(const Complex &x)
Definition: lo-mappers.h:71
double signum(double x)
Definition: lo-mappers.h:229
double asinh(double x)
Definition: lo-specfun.h:58
bool isna(double x)
Definition: lo-mappers.cc:47
double atanh(double x)
Definition: lo-specfun.h:63
bool isfinite(double x)
Definition: lo-mappers.h:192
double roundb(double x)
Definition: lo-mappers.h:147
static const double pi
Definition: lo-specfun.cc:1995
bool isnan(bool)
Definition: lo-mappers.h:178
Complex log1p(const Complex &x)
Definition: lo-specfun.cc:1958
bool isinf(double x)
Definition: lo-mappers.h:203
Complex acos(const Complex &x)
Definition: lo-mappers.cc:85
double round(double x)
Definition: lo-mappers.h:136
Complex asin(const Complex &x)
Definition: lo-mappers.cc:107
double erfcx(double x)
Definition: lo-specfun.cc:1755
Complex erfc(const Complex &x)
Definition: lo-specfun.cc:1652
double acosh(double x)
Definition: lo-specfun.h:40
double erfi(double x)
Definition: lo-specfun.cc:1774
std::complex< T > ceil(const std::complex< T > &x)
Definition: lo-mappers.h:103
std::complex< T > floor(const std::complex< T > &x)
Definition: lo-mappers.h:130
double dawson(double x)
Definition: lo-specfun.cc:1517
Complex log2(const Complex &x)
Definition: lo-mappers.cc:139
Complex erf(const Complex &x)
Definition: lo-specfun.cc:1637
Complex expm1(const Complex &x)
Definition: lo-specfun.cc:1874
void err_nan_to_logical_conversion(void)
std::complex< double > Complex
Definition: oct-cmplx.h:33
std::complex< float > FloatComplex
Definition: oct-cmplx.h:34
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:222
#define ARRAY_MAPPER(UMAP, TYPE, FCN)
#define ARRAY_METHOD_MAPPER(UMAP, FCN)
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 T abs(T x)
Definition: pr-output.cc:1678
F77_RET_T len
Definition: xerbla.cc:61