GNU Octave  6.2.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-2021 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 "dNDArray.h"
35 #include "fNDArray.h"
36 
37 #include "data-conv.h"
38 #include "lo-ieee.h"
39 #include "lo-specfun.h"
40 #include "lo-mappers.h"
41 #include "mx-base.h"
42 #include "mach-info.h"
43 #include "oct-locbuf.h"
44 
45 #include "errwarn.h"
46 #include "mxarray.h"
47 #include "ovl.h"
48 #include "oct-hdf5.h"
49 #include "oct-stream.h"
50 #include "ops.h"
51 #include "ov-base.h"
52 #include "ov-base-mat.h"
53 #include "ov-base-mat.cc"
54 #include "ov-complex.h"
55 #include "ov-flt-complex.h"
56 #include "ov-cx-mat.h"
57 #include "ov-flt-cx-mat.h"
58 #include "ov-re-mat.h"
59 #include "ov-flt-re-mat.h"
60 #include "ov-scalar.h"
61 #include "ov-float.h"
62 #include "pr-output.h"
63 #include "ops.h"
64 
65 #include "byte-swap.h"
66 #include "ls-oct-text.h"
67 #include "ls-hdf5.h"
68 #include "ls-utils.h"
69 
70 
72 
74  "float complex matrix", "single");
75 
78 {
79  octave_base_value *retval = nullptr;
80 
81  if (matrix.numel () == 1)
82  {
83  FloatComplex c = matrix (0);
84 
85  if (c.imag () == 0.0)
86  retval = new octave_float_scalar (c.real ());
87  else
88  retval = new octave_float_complex (c);
89  }
90  else if (matrix.all_elements_are_real ())
92 
93  return retval;
94 }
95 
96 double
97 octave_float_complex_matrix::double_value (bool force_conversion) const
98 {
99  if (! force_conversion)
100  warn_implicit_conversion ("Octave:imag-to-real",
101  "complex matrix", "real scalar");
102 
103  if (rows () == 0 || columns () == 0)
104  err_invalid_conversion ("complex matrix", "real scalar");
105 
106  warn_implicit_conversion ("Octave:array-to-scalar",
107  "complex matrix", "real scalar");
108 
109  return std::real (matrix(0, 0));
110 }
111 
112 float
113 octave_float_complex_matrix::float_value (bool force_conversion) const
114 {
115  if (! force_conversion)
116  warn_implicit_conversion ("Octave:imag-to-real",
117  "complex matrix", "real scalar");
118 
119  if (rows () == 0 || columns () == 0)
120  err_invalid_conversion ("complex matrix", "real scalar");
121 
122  warn_implicit_conversion ("Octave:array-to-scalar",
123  "complex matrix", "real scalar");
124 
125  return std::real (matrix(0, 0));
126 }
127 
128 Matrix
129 octave_float_complex_matrix::matrix_value (bool force_conversion) const
130 {
131  Matrix retval;
132 
133  if (! force_conversion)
134  warn_implicit_conversion ("Octave:imag-to-real",
135  "complex matrix", "real matrix");
136 
138 
139  return retval;
140 }
141 
144 {
146 
147  if (! force_conversion)
148  warn_implicit_conversion ("Octave:imag-to-real",
149  "complex matrix", "real matrix");
150 
152 
153  return retval;
154 }
155 
156 Complex
158 {
159  if (rows () == 0 || columns () == 0)
160  err_invalid_conversion ("complex matrix", "complex scalar");
161 
162  warn_implicit_conversion ("Octave:array-to-scalar",
163  "complex matrix", "complex scalar");
164 
165  return matrix(0, 0);
166 }
167 
170 {
171  float tmp = lo_ieee_float_nan_value ();
172 
173  FloatComplex retval (tmp, tmp);
174 
175  if (rows () == 0 || columns () == 0)
176  err_invalid_conversion ("complex matrix", "complex scalar");
177 
178  warn_implicit_conversion ("Octave:array-to-scalar",
179  "complex matrix", "complex scalar");
180 
181  retval = matrix(0, 0);
182 
183  return retval;
184 }
185 
188 {
189  return FloatComplexMatrix (matrix);
190 }
191 
194 {
195  return FloatComplexMatrix (matrix);
196 }
197 
200 {
201  if (matrix.any_element_is_nan ())
203  if (warn && (! matrix.all_elements_are_real ()
204  || real (matrix).any_element_not_one_or_zero ()))
206 
207  return mx_el_ne (matrix, FloatComplex (0.0));
208 }
209 
212 {
214 
215  if (! frc_str_conv)
216  warn_implicit_conversion ("Octave:num-to-str",
217  "complex matrix", "string");
218  else
219  {
220  retval = charNDArray (dims ());
221  octave_idx_type nel = numel ();
222 
223  for (octave_idx_type i = 0; i < nel; i++)
224  retval.elem (i) = static_cast<char> (std::real (matrix.elem (i)));
225  }
226 
227  return retval;
228 }
229 
232 {
233  return FloatComplexNDArray (matrix);
234 }
235 
238 {
240 
241  if (! force_conversion)
242  warn_implicit_conversion ("Octave:imag-to-real",
243  "complex matrix", "real matrix");
244 
246 
247  return retval;
248 }
249 
252 {
254 }
255 
258 {
259  return ComplexNDArray (matrix);
260 }
261 
264 {
265  return matrix;
266 }
267 
270 {
272  if (k == 0 && matrix.ndims () == 2
273  && (matrix.rows () == 1 || matrix.columns () == 1))
275  else
277 
278  return retval;
279 }
280 
283 {
284  if (matrix.ndims () != 2
285  || (matrix.rows () != 1 && matrix.columns () != 1))
286  error ("diag: expecting vector argument");
287 
289 
290  return mat.diag (m, n);
291 }
292 
293 bool
295 {
296  dim_vector dv = dims ();
297  if (dv.ndims () > 2)
298  {
300 
301  os << "# ndims: " << dv.ndims () << "\n";
302 
303  for (int i = 0; i < dv.ndims (); i++)
304  os << ' ' << dv(i);
305 
306  os << "\n" << tmp;
307  }
308  else
309  {
310  // Keep this case, rather than use generic code above for backward
311  // compatibility. Makes load_ascii much more complex!!
312  os << "# rows: " << rows () << "\n"
313  << "# columns: " << columns () << "\n";
314 
315  os << complex_matrix_value ();
316  }
317 
318  return true;
319 }
320 
321 bool
323 {
324  string_vector keywords(2);
325 
326  keywords[0] = "ndims";
327  keywords[1] = "rows";
328 
329  std::string kw;
330  octave_idx_type val = 0;
331 
332  if (! extract_keyword (is, keywords, kw, val, true))
333  error ("load: failed to extract number of rows and columns");
334 
335  if (kw == "ndims")
336  {
337  int mdims = static_cast<int> (val);
338 
339  if (mdims < 0)
340  error ("load: failed to extract number of dimensions");
341 
342  dim_vector dv;
343  dv.resize (mdims);
344 
345  for (int i = 0; i < mdims; i++)
346  is >> dv(i);
347 
348  if (! is)
349  error ("load: failed to read dimensions");
350 
351  FloatComplexNDArray tmp(dv);
352 
353  is >> tmp;
354 
355  if (! is)
356  error ("load: failed to load matrix constant");
357 
358  matrix = tmp;
359  }
360  else if (kw == "rows")
361  {
362  octave_idx_type nr = val;
363  octave_idx_type nc = 0;
364 
365  if (nr < 0 || ! extract_keyword (is, "columns", nc) || nc < 0)
366  error ("load: failed to extract number of rows and columns");
367 
368  if (nr > 0 && nc > 0)
369  {
370  FloatComplexMatrix tmp (nr, nc);
371  is >> tmp;
372  if (! is)
373  error ("load: failed to load matrix constant");
374 
375  matrix = tmp;
376  }
377  else if (nr == 0 || nc == 0)
378  matrix = FloatComplexMatrix (nr, nc);
379  else
380  panic_impossible ();
381  }
382  else
383  panic_impossible ();
384 
385  return true;
386 }
387 
388 bool
390 {
391  dim_vector dv = dims ();
392  if (dv.ndims () < 1)
393  return false;
394 
395  // Use negative value for ndims to differentiate with old format!!
396  int32_t tmp = - dv.ndims ();
397  os.write (reinterpret_cast<char *> (&tmp), 4);
398  for (int i = 0; i < dv.ndims (); i++)
399  {
400  tmp = dv(i);
401  os.write (reinterpret_cast<char *> (&tmp), 4);
402  }
403 
405  save_type st = LS_FLOAT;
406  if (dv.numel () > 4096) // FIXME: make this configurable.
407  {
408  float max_val, min_val;
409  if (m.all_integers (max_val, min_val))
410  st = get_save_type (max_val, min_val);
411  }
412 
413  const FloatComplex *mtmp = m.data ();
414  write_floats (os, reinterpret_cast<const float *> (mtmp), st,
415  2 * dv.numel ());
416 
417  return true;
418 }
419 
420 bool
421 octave_float_complex_matrix::load_binary (std::istream& is, bool swap,
423 {
424  char tmp;
425  int32_t mdims;
426  if (! is.read (reinterpret_cast<char *> (&mdims), 4))
427  return false;
428  if (swap)
429  swap_bytes<4> (&mdims);
430  if (mdims < 0)
431  {
432  mdims = - mdims;
433  int32_t di;
434  dim_vector dv;
435  dv.resize (mdims);
436 
437  for (int i = 0; i < mdims; i++)
438  {
439  if (! is.read (reinterpret_cast<char *> (&di), 4))
440  return false;
441  if (swap)
442  swap_bytes<4> (&di);
443  dv(i) = di;
444  }
445 
446  // Convert an array with a single dimension to be a row vector.
447  // Octave should never write files like this, other software
448  // might.
449 
450  if (mdims == 1)
451  {
452  mdims = 2;
453  dv.resize (mdims);
454  dv(1) = dv(0);
455  dv(0) = 1;
456  }
457 
458  if (! is.read (reinterpret_cast<char *> (&tmp), 1))
459  return false;
460 
462  FloatComplex *im = m.fortran_vec ();
463  read_floats (is, reinterpret_cast<float *> (im),
464  static_cast<save_type> (tmp), 2 * dv.numel (), swap, fmt);
465 
466  if (! is)
467  return false;
468 
469  matrix = m;
470  }
471  else
472  {
473  int32_t nr, nc;
474  nr = mdims;
475  if (! is.read (reinterpret_cast<char *> (&nc), 4))
476  return false;
477  if (swap)
478  swap_bytes<4> (&nc);
479  if (! is.read (reinterpret_cast<char *> (&tmp), 1))
480  return false;
481  FloatComplexMatrix m (nr, nc);
482  FloatComplex *im = m.fortran_vec ();
483  octave_idx_type len = nr * nc;
484  read_floats (is, reinterpret_cast<float *> (im),
485  static_cast<save_type> (tmp), 2*len, swap, fmt);
486 
487  if (! is)
488  return false;
489 
490  matrix = m;
491  }
492  return true;
493 }
494 
495 bool
497  bool)
498 {
499  bool retval = false;
500 
501 #if defined (HAVE_HDF5)
502 
503  dim_vector dv = dims ();
504  int empty = save_hdf5_empty (loc_id, name, dv);
505  if (empty)
506  return (empty > 0);
507 
508  int rank = dv.ndims ();
509  hid_t space_hid, data_hid, type_hid;
510  space_hid = data_hid = type_hid = -1;
512 
513  OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
514 
515  // Octave uses column-major, while HDF5 uses row-major ordering
516  for (int i = 0; i < rank; i++)
517  hdims[i] = dv(rank-i-1);
518 
519  space_hid = H5Screate_simple (rank, hdims, nullptr);
520  if (space_hid < 0) return false;
521 
522  hid_t save_type_hid = H5T_NATIVE_FLOAT;
523 
524 #if defined (HAVE_HDF5_INT2FLOAT_CONVERSIONS)
525  // hdf5 currently doesn't support float/integer conversions
526  else
527  {
528  float max_val, min_val;
529 
530  if (m.all_integers (max_val, min_val))
531  save_type_hid
532  = save_type_to_hdf5 (get_save_type (max_val, min_val));
533  }
534 #endif
535 
536  type_hid = hdf5_make_complex_type (save_type_hid);
537  if (type_hid < 0)
538  {
539  H5Sclose (space_hid);
540  return false;
541  }
542 #if defined (HAVE_HDF5_18)
543  data_hid = H5Dcreate (loc_id, name, type_hid, space_hid,
545 #else
546  data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT);
547 #endif
548  if (data_hid < 0)
549  {
550  H5Sclose (space_hid);
551  H5Tclose (type_hid);
552  return false;
553  }
554 
555  hid_t complex_type_hid = hdf5_make_complex_type (H5T_NATIVE_FLOAT);
556  if (complex_type_hid < 0) retval = false;
557 
558  if (retval)
559  {
560  FloatComplex *mtmp = m.fortran_vec ();
561  if (H5Dwrite (data_hid, complex_type_hid, octave_H5S_ALL, octave_H5S_ALL,
562  octave_H5P_DEFAULT, mtmp)
563  < 0)
564  {
565  H5Tclose (complex_type_hid);
566  retval = false;
567  }
568  }
569 
570  H5Tclose (complex_type_hid);
571  H5Dclose (data_hid);
572  H5Tclose (type_hid);
573  H5Sclose (space_hid);
574 
575 #else
576  octave_unused_parameter (loc_id);
577  octave_unused_parameter (name);
578 
579  warn_save ("hdf5");
580 #endif
581 
582  return retval;
583 }
584 
585 bool
587 {
588  bool retval = false;
589 
590 #if defined (HAVE_HDF5)
591 
592  dim_vector dv;
593  int empty = load_hdf5_empty (loc_id, name, dv);
594  if (empty > 0)
595  matrix.resize (dv);
596  if (empty)
597  return (empty > 0);
598 
599 #if defined (HAVE_HDF5_18)
600  hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT);
601 #else
602  hid_t data_hid = H5Dopen (loc_id, name);
603 #endif
604  hid_t type_hid = H5Dget_type (data_hid);
605 
606  hid_t complex_type = hdf5_make_complex_type (H5T_NATIVE_FLOAT);
607 
608  if (! hdf5_types_compatible (type_hid, complex_type))
609  {
610  H5Tclose (complex_type);
611  H5Dclose (data_hid);
612  return false;
613  }
614 
615  hid_t space_id = H5Dget_space (data_hid);
616 
617  hsize_t rank = H5Sget_simple_extent_ndims (space_id);
618 
619  if (rank < 1)
620  {
621  H5Tclose (complex_type);
622  H5Sclose (space_id);
623  H5Dclose (data_hid);
624  return false;
625  }
626 
627  OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
628  OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank);
629 
630  H5Sget_simple_extent_dims (space_id, hdims, maxdims);
631 
632  // Octave uses column-major, while HDF5 uses row-major ordering
633  if (rank == 1)
634  {
635  dv.resize (2);
636  dv(0) = 1;
637  dv(1) = hdims[0];
638  }
639  else
640  {
641  dv.resize (rank);
642  for (hsize_t i = 0, j = rank - 1; i < rank; i++, j--)
643  dv(j) = hdims[i];
644  }
645 
646  FloatComplexNDArray m (dv);
647  FloatComplex *reim = m.fortran_vec ();
648  if (H5Dread (data_hid, complex_type, octave_H5S_ALL, octave_H5S_ALL,
649  octave_H5P_DEFAULT, reim)
650  >= 0)
651  {
652  retval = true;
653  matrix = m;
654  }
655 
656  H5Tclose (complex_type);
657  H5Sclose (space_id);
658  H5Dclose (data_hid);
659 
660 #else
661  octave_unused_parameter (loc_id);
662  octave_unused_parameter (name);
663 
664  warn_load ("hdf5");
665 #endif
666 
667  return retval;
668 }
669 
670 void
672  bool pr_as_read_syntax) const
673 {
674  octave_print_internal (os, matrix, pr_as_read_syntax,
676 }
677 
678 mxArray *
680 {
682 
683  float *pr = static_cast<float *> (retval->get_data ());
684  float *pi = static_cast<float *> (retval->get_imag_data ());
685 
686  mwSize nel = numel ();
687 
688  const FloatComplex *p = matrix.data ();
689 
690  for (mwIndex i = 0; i < nel; i++)
691  {
692  pr[i] = std::real (p[i]);
693  pi[i] = std::imag (p[i]);
694  }
695 
696  return retval;
697 }
698 
701 {
702  switch (umap)
703  {
704  // Mappers handled specially.
705  case umap_real:
707  case umap_imag:
709  case umap_conj:
711 
712  // Special cases for Matlab compatibility.
713  case umap_xtolower:
714  case umap_xtoupper:
715  return matrix;
716 
717 #define ARRAY_METHOD_MAPPER(UMAP, FCN) \
718  case umap_ ## UMAP: \
719  return octave_value (matrix.FCN ())
720 
725 
726 #define ARRAY_MAPPER(UMAP, TYPE, FCN) \
727  case umap_ ## UMAP: \
728  return octave_value (matrix.map<TYPE> (FCN))
729 
732  ARRAY_MAPPER (angle, float, std::arg);
733  ARRAY_MAPPER (arg, float, std::arg);
744  ARRAY_MAPPER (cos, FloatComplex, std::cos);
745  ARRAY_MAPPER (cosh, FloatComplex, std::cosh);
746  ARRAY_MAPPER (exp, FloatComplex, std::exp);
750  ARRAY_MAPPER (log, FloatComplex, std::log);
752  ARRAY_MAPPER (log10, FloatComplex, std::log10);
757  ARRAY_MAPPER (sin, FloatComplex, std::sin);
758  ARRAY_MAPPER (sinh, FloatComplex, std::sinh);
759  ARRAY_MAPPER (sqrt, FloatComplex, std::sqrt);
760  ARRAY_MAPPER (tan, FloatComplex, std::tan);
761  ARRAY_MAPPER (tanh, FloatComplex, std::tanh);
763 
764  default:
765  return octave_base_value::map (umap);
766  }
767 }
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
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
Definition: Array.cc:1011
octave_idx_type columns(void) const
Definition: Array.h:424
octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:377
T & elem(octave_idx_type n)
Size of the specified dimension.
Definition: Array.h:499
const T * data(void) const
Size of the specified dimension.
Definition: Array.h:581
octave_idx_type rows(void) const
Definition: Array.h:415
int ndims(void) const
Size of the specified dimension.
Definition: Array.h:589
FloatComplexMatrix diag(octave_idx_type k=0) const
Definition: fCMatrix.cc:2834
bool any_element_is_nan(void) const
Definition: fCNDArray.cc:265
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:95
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:401
void resize(int n, int fill_value=0)
Definition: dim-vector.h:349
octave_idx_type ndims(void) const
Number of dimensions.
Definition: dim-vector.h:334
octave_idx_type numel(void) const
Definition: ov-base-mat.h:114
octave_value diag(octave_idx_type k=0) const
Definition: ov-base-mat.h:134
octave_idx_type columns(void) const
Definition: ov-base.h:325
int current_print_indent_level(void) const
Definition: ov-base.h:847
virtual octave_value map(unary_mapper_t) const
Definition: ov-base.cc:1114
void warn_load(const char *type) const
Definition: ov-base.cc:1090
octave_idx_type rows(void) const
Definition: ov-base.h:318
void warn_save(const char *type) const
Definition: ov-base.cc:1099
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)
mxArray * as_mxArray(void) const
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:941
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:835
save_type
Definition: data-conv.h:87
@ LS_FLOAT
Definition: data-conv.h:94
void error(const char *fmt,...)
Definition: error.cc:968
#define panic_impossible()
Definition: error.h:380
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:126
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector &d)
Definition: ls-hdf5.cc:1224
int load_hdf5_empty(octave_hdf5_id loc_id, const char *name, dim_vector &d)
Definition: ls-hdf5.cc:1280
octave_hdf5_id save_type_to_hdf5(save_type st)
Definition: ls-hdf5.cc:1324
octave_hdf5_id hdf5_make_complex_type(octave_hdf5_id num_type)
Definition: ls-hdf5.cc:401
bool hdf5_types_compatible(octave_hdf5_id t1, octave_hdf5_id t2)
Definition: ls-hdf5.cc:265
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
Definition: ls-oct-text.cc:84
save_type get_save_type(double, double)
Definition: ls-utils.cc:38
void mxArray
Definition: mex.h:58
T octave_idx_type m
Definition: mx-inlines.cc:773
octave_idx_type n
Definition: mx-inlines.cc:753
OCTAVE_IDX_TYPE mwSize
Definition: mxarray.in.h:97
@ mxSINGLE_CLASS
Definition: mxarray.in.h:65
OCTAVE_IDX_TYPE mwIndex
Definition: mxarray.in.h:98
@ mxCOMPLEX
Definition: mxarray.in.h:81
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 > erfi(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:222
double asinh(double x)
Definition: lo-specfun.h:69
bool isna(double x)
Definition: lo-mappers.cc:47
double atanh(double x)
Definition: lo-specfun.h:74
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:51
std::complex< T > ceil(const std::complex< T > &x)
Definition: lo-mappers.h:103
double erfi(double x)
Definition: lo-specfun.cc:1774
double dawson(double x)
Definition: lo-specfun.cc:1517
Complex log2(const Complex &x)
Definition: lo-mappers.cc:139
std::complex< T > floor(const std::complex< T > &x)
Definition: lo-mappers.h:130
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:180
#define ARRAY_MAPPER(UMAP, TYPE, FCN)
#define ARRAY_METHOD_MAPPER(UMAP, FCN)
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811
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