GNU Octave  4.4.1
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-2018 John W. Eaton
4 Copyright (C) 2009-2010 VZLU Prague
5 
6 This file is part of Octave.
7 
8 Octave is free software: you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <https://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if defined (HAVE_CONFIG_H)
25 # include "config.h"
26 #endif
27 
28 #include <iostream>
29 #include <vector>
30 
31 #include "dNDArray.h"
32 #include "fNDArray.h"
33 
34 #include "data-conv.h"
35 #include "lo-ieee.h"
36 #include "lo-specfun.h"
37 #include "lo-mappers.h"
38 #include "mx-base.h"
39 #include "mach-info.h"
40 #include "oct-locbuf.h"
41 
42 #include "errwarn.h"
43 #include "mxarray.h"
44 #include "ovl.h"
45 #include "oct-hdf5.h"
46 #include "oct-stream.h"
47 #include "ops.h"
48 #include "ov-base.h"
49 #include "ov-base-mat.h"
50 #include "ov-base-mat.cc"
51 #include "ov-complex.h"
52 #include "ov-flt-complex.h"
53 #include "ov-cx-mat.h"
54 #include "ov-flt-cx-mat.h"
55 #include "ov-re-mat.h"
56 #include "ov-flt-re-mat.h"
57 #include "ov-scalar.h"
58 #include "ov-float.h"
59 #include "pr-output.h"
60 #include "ops.h"
61 
62 #include "byte-swap.h"
63 #include "ls-oct-text.h"
64 #include "ls-hdf5.h"
65 #include "ls-utils.h"
66 
67 
69 
71  "float complex matrix", "single");
72 
75 {
76  octave_base_value *retval = nullptr;
77 
78  if (matrix.numel () == 1)
79  {
80  FloatComplex c = matrix (0);
81 
82  if (c.imag () == 0.0)
83  retval = new octave_float_scalar (c.real ());
84  else
86  }
87  else if (matrix.all_elements_are_real ())
89 
90  return retval;
91 }
92 
93 double
94 octave_float_complex_matrix::double_value (bool force_conversion) const
95 {
96  if (! force_conversion)
97  warn_implicit_conversion ("Octave:imag-to-real",
98  "complex matrix", "real scalar");
99 
100  if (rows () == 0 || columns () == 0)
101  err_invalid_conversion ("complex matrix", "real scalar");
102 
103  warn_implicit_conversion ("Octave:array-to-scalar",
104  "complex matrix", "real scalar");
105 
106  return std::real (matrix(0, 0));
107 }
108 
109 float
110 octave_float_complex_matrix::float_value (bool force_conversion) const
111 {
112  if (! force_conversion)
113  warn_implicit_conversion ("Octave:imag-to-real",
114  "complex matrix", "real scalar");
115 
116  if (rows () == 0 || columns () == 0)
117  err_invalid_conversion ("complex matrix", "real scalar");
118 
119  warn_implicit_conversion ("Octave:array-to-scalar",
120  "complex matrix", "real scalar");
121 
122  return std::real (matrix(0, 0));
123 }
124 
125 Matrix
126 octave_float_complex_matrix::matrix_value (bool force_conversion) const
127 {
128  Matrix retval;
129 
130  if (! force_conversion)
131  warn_implicit_conversion ("Octave:imag-to-real",
132  "complex matrix", "real matrix");
133 
135 
136  return retval;
137 }
138 
141 {
143 
144  if (! force_conversion)
145  warn_implicit_conversion ("Octave:imag-to-real",
146  "complex matrix", "real matrix");
147 
149 
150  return retval;
151 }
152 
153 Complex
155 {
156  if (rows () == 0 || columns () == 0)
157  err_invalid_conversion ("complex matrix", "complex scalar");
158 
159  warn_implicit_conversion ("Octave:array-to-scalar",
160  "complex matrix", "complex scalar");
161 
162  return matrix(0, 0);
163 }
164 
167 {
168  float tmp = lo_ieee_float_nan_value ();
169 
171 
172  if (rows () == 0 || columns () == 0)
173  err_invalid_conversion ("complex matrix", "complex scalar");
174 
175  warn_implicit_conversion ("Octave:array-to-scalar",
176  "complex matrix", "complex scalar");
177 
178  retval = matrix(0, 0);
179 
180  return retval;
181 }
182 
185 {
186  return FloatComplexMatrix (matrix);
187 }
188 
191 {
192  return FloatComplexMatrix (matrix);
193 }
194 
197 {
198  if (matrix.any_element_is_nan ())
200  if (warn && (! matrix.all_elements_are_real ()
201  || real (matrix).any_element_not_one_or_zero ()))
203 
204  return mx_el_ne (matrix, FloatComplex (0.0));
205 }
206 
209 {
211 
212  if (! frc_str_conv)
213  warn_implicit_conversion ("Octave:num-to-str",
214  "complex matrix", "string");
215  else
216  {
217  retval = charNDArray (dims ());
218  octave_idx_type nel = numel ();
219 
220  for (octave_idx_type i = 0; i < nel; i++)
221  retval.elem (i) = static_cast<char>(std::real (matrix.elem (i)));
222  }
223 
224  return retval;
225 }
226 
229 {
230  return FloatComplexNDArray (matrix);
231 }
232 
235 {
237 
238  if (! force_conversion)
239  warn_implicit_conversion ("Octave:imag-to-real",
240  "complex matrix", "real matrix");
241 
243 
244  return retval;
245 }
246 
249 {
251 }
252 
255 {
256  return ComplexNDArray (matrix);
257 }
258 
261 {
262  return matrix;
263 }
264 
267 {
269  if (k == 0 && matrix.ndims () == 2
270  && (matrix.rows () == 1 || matrix.columns () == 1))
272  else
274 
275  return retval;
276 }
277 
280 {
281  if (matrix.ndims () != 2
282  || (matrix.rows () != 1 && matrix.columns () != 1))
283  error ("diag: expecting vector argument");
284 
286 
287  return mat.diag (m, n);
288 }
289 
290 bool
292 {
293  dim_vector dv = dims ();
294  if (dv.ndims () > 2)
295  {
297 
298  os << "# ndims: " << dv.ndims () << "\n";
299 
300  for (int i = 0; i < dv.ndims (); i++)
301  os << ' ' << dv(i);
302 
303  os << "\n" << tmp;
304  }
305  else
306  {
307  // Keep this case, rather than use generic code above for backward
308  // compatibility. Makes load_ascii much more complex!!
309  os << "# rows: " << rows () << "\n"
310  << "# columns: " << columns () << "\n";
311 
312  os << complex_matrix_value ();
313  }
314 
315  return true;
316 }
317 
318 bool
320 {
321  string_vector keywords(2);
322 
323  keywords[0] = "ndims";
324  keywords[1] = "rows";
325 
326  std::string kw;
327  octave_idx_type val = 0;
328 
329  if (! extract_keyword (is, keywords, kw, val, true))
330  error ("load: failed to extract number of rows and columns");
331 
332  if (kw == "ndims")
333  {
334  int mdims = static_cast<int> (val);
335 
336  if (mdims < 0)
337  error ("load: failed to extract number of dimensions");
338 
339  dim_vector dv;
340  dv.resize (mdims);
341 
342  for (int i = 0; i < mdims; i++)
343  is >> dv(i);
344 
345  if (! is)
346  error ("load: failed to read dimensions");
347 
349 
350  is >> tmp;
351 
352  if (! is)
353  error ("load: failed to load matrix constant");
354 
355  matrix = tmp;
356  }
357  else if (kw == "rows")
358  {
359  octave_idx_type nr = val;
360  octave_idx_type nc = 0;
361 
362  if (nr < 0 || ! extract_keyword (is, "columns", nc) || nc < 0)
363  error ("load: failed to extract number of rows and columns");
364 
365  if (nr > 0 && nc > 0)
366  {
367  FloatComplexMatrix tmp (nr, nc);
368  is >> tmp;
369  if (! is)
370  error ("load: failed to load matrix constant");
371 
372  matrix = tmp;
373  }
374  else if (nr == 0 || nc == 0)
375  matrix = FloatComplexMatrix (nr, nc);
376  else
377  panic_impossible ();
378  }
379  else
380  panic_impossible ();
381 
382  return true;
383 }
384 
385 bool
387 {
388  dim_vector dv = dims ();
389  if (dv.ndims () < 1)
390  return false;
391 
392  // Use negative value for ndims to differentiate with old format!!
393  int32_t tmp = - dv.ndims ();
394  os.write (reinterpret_cast<char *> (&tmp), 4);
395  for (int i = 0; i < dv.ndims (); i++)
396  {
397  tmp = dv(i);
398  os.write (reinterpret_cast<char *> (&tmp), 4);
399  }
400 
402  save_type st = LS_FLOAT;
403  if (dv.numel () > 4096) // FIXME: make this configurable.
404  {
405  float max_val, min_val;
406  if (m.all_integers (max_val, min_val))
407  st = get_save_type (max_val, min_val);
408  }
409 
410  const FloatComplex *mtmp = m.data ();
411  write_floats (os, reinterpret_cast<const float *> (mtmp), st,
412  2 * dv.numel ());
413 
414  return true;
415 }
416 
417 bool
420 {
421  char tmp;
422  int32_t mdims;
423  if (! is.read (reinterpret_cast<char *> (&mdims), 4))
424  return false;
425  if (swap)
426  swap_bytes<4> (&mdims);
427  if (mdims < 0)
428  {
429  mdims = - mdims;
430  int32_t di;
431  dim_vector dv;
432  dv.resize (mdims);
433 
434  for (int i = 0; i < mdims; i++)
435  {
436  if (! is.read (reinterpret_cast<char *> (&di), 4))
437  return false;
438  if (swap)
439  swap_bytes<4> (&di);
440  dv(i) = di;
441  }
442 
443  // Convert an array with a single dimension to be a row vector.
444  // Octave should never write files like this, other software
445  // might.
446 
447  if (mdims == 1)
448  {
449  mdims = 2;
450  dv.resize (mdims);
451  dv(1) = dv(0);
452  dv(0) = 1;
453  }
454 
455  if (! is.read (reinterpret_cast<char *> (&tmp), 1))
456  return false;
457 
459  FloatComplex *im = m.fortran_vec ();
460  read_floats (is, reinterpret_cast<float *> (im),
461  static_cast<save_type> (tmp), 2 * dv.numel (), swap, fmt);
462 
463  if (! is)
464  return false;
465 
466  matrix = m;
467  }
468  else
469  {
470  int32_t nr, nc;
471  nr = mdims;
472  if (! is.read (reinterpret_cast<char *> (&nc), 4))
473  return false;
474  if (swap)
475  swap_bytes<4> (&nc);
476  if (! is.read (reinterpret_cast<char *> (&tmp), 1))
477  return false;
478  FloatComplexMatrix m (nr, nc);
479  FloatComplex *im = m.fortran_vec ();
480  octave_idx_type len = nr * nc;
481  read_floats (is, reinterpret_cast<float *> (im),
482  static_cast<save_type> (tmp), 2*len, swap, fmt);
483 
484  if (! is)
485  return false;
486 
487  matrix = m;
488  }
489  return true;
490 }
491 
492 bool
494  bool)
495 {
496  bool retval = false;
497 
498 #if defined (HAVE_HDF5)
499 
500  dim_vector dv = dims ();
501  int empty = save_hdf5_empty (loc_id, name, dv);
502  if (empty)
503  return (empty > 0);
504 
505  int rank = dv.ndims ();
506  hid_t space_hid, data_hid, type_hid;
507  space_hid = data_hid = type_hid = -1;
509 
510  OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
511 
512  // Octave uses column-major, while HDF5 uses row-major ordering
513  for (int i = 0; i < rank; i++)
514  hdims[i] = dv(rank-i-1);
515 
516  space_hid = H5Screate_simple (rank, hdims, nullptr);
517  if (space_hid < 0) return false;
518 
519  hid_t save_type_hid = H5T_NATIVE_FLOAT;
520 
521 #if defined (HAVE_HDF5_INT2FLOAT_CONVERSIONS)
522  // hdf5 currently doesn't support float/integer conversions
523  else
524  {
525  float max_val, min_val;
526 
527  if (m.all_integers (max_val, min_val))
528  save_type_hid
529  = save_type_to_hdf5 (get_save_type (max_val, min_val));
530  }
531 #endif
532 
533  type_hid = hdf5_make_complex_type (save_type_hid);
534  if (type_hid < 0)
535  {
536  H5Sclose (space_hid);
537  return false;
538  }
539 #if defined (HAVE_HDF5_18)
540  data_hid = H5Dcreate (loc_id, name, type_hid, space_hid,
542 #else
543  data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT);
544 #endif
545  if (data_hid < 0)
546  {
547  H5Sclose (space_hid);
548  H5Tclose (type_hid);
549  return false;
550  }
551 
552  hid_t complex_type_hid = hdf5_make_complex_type (H5T_NATIVE_FLOAT);
553  if (complex_type_hid < 0) retval = false;
554 
555  if (retval)
556  {
557  FloatComplex *mtmp = m.fortran_vec ();
558  if (H5Dwrite (data_hid, complex_type_hid, octave_H5S_ALL, octave_H5S_ALL,
559  octave_H5P_DEFAULT, mtmp)
560  < 0)
561  {
562  H5Tclose (complex_type_hid);
563  retval = false;
564  }
565  }
566 
567  H5Tclose (complex_type_hid);
568  H5Dclose (data_hid);
569  H5Tclose (type_hid);
570  H5Sclose (space_hid);
571 
572 #else
573  octave_unused_parameter (loc_id);
574  octave_unused_parameter (name);
575 
576  warn_save ("hdf5");
577 #endif
578 
579  return retval;
580 }
581 
582 bool
584 {
585  bool retval = false;
586 
587 #if defined (HAVE_HDF5)
588 
589  dim_vector dv;
590  int empty = load_hdf5_empty (loc_id, name, dv);
591  if (empty > 0)
592  matrix.resize (dv);
593  if (empty)
594  return (empty > 0);
595 
596 #if defined (HAVE_HDF5_18)
597  hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT);
598 #else
599  hid_t data_hid = H5Dopen (loc_id, name);
600 #endif
601  hid_t type_hid = H5Dget_type (data_hid);
602 
603  hid_t complex_type = hdf5_make_complex_type (H5T_NATIVE_FLOAT);
604 
605  if (! hdf5_types_compatible (type_hid, complex_type))
606  {
607  H5Tclose (complex_type);
608  H5Dclose (data_hid);
609  return false;
610  }
611 
612  hid_t space_id = H5Dget_space (data_hid);
613 
614  hsize_t rank = H5Sget_simple_extent_ndims (space_id);
615 
616  if (rank < 1)
617  {
618  H5Tclose (complex_type);
619  H5Sclose (space_id);
620  H5Dclose (data_hid);
621  return false;
622  }
623 
624  OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
625  OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank);
626 
627  H5Sget_simple_extent_dims (space_id, hdims, maxdims);
628 
629  // Octave uses column-major, while HDF5 uses row-major ordering
630  if (rank == 1)
631  {
632  dv.resize (2);
633  dv(0) = 1;
634  dv(1) = hdims[0];
635  }
636  else
637  {
638  dv.resize (rank);
639  for (hsize_t i = 0, j = rank - 1; i < rank; i++, j--)
640  dv(j) = hdims[i];
641  }
642 
644  FloatComplex *reim = m.fortran_vec ();
645  if (H5Dread (data_hid, complex_type, octave_H5S_ALL, octave_H5S_ALL,
646  octave_H5P_DEFAULT, reim)
647  >= 0)
648  {
649  retval = true;
650  matrix = m;
651  }
652 
653  H5Tclose (complex_type);
654  H5Sclose (space_id);
655  H5Dclose (data_hid);
656 
657 #else
658  octave_unused_parameter (loc_id);
659  octave_unused_parameter (name);
660 
661  warn_load ("hdf5");
662 #endif
663 
664  return retval;
665 }
666 
667 void
669  bool pr_as_read_syntax) const
670 {
671  octave_print_internal (os, matrix, pr_as_read_syntax,
673 }
674 
675 mxArray *
677 {
679 
680  float *pr = static_cast<float *> (retval->get_data ());
681  float *pi = static_cast<float *> (retval->get_imag_data ());
682 
683  mwSize nel = numel ();
684 
685  const FloatComplex *p = matrix.data ();
686 
687  for (mwIndex i = 0; i < nel; i++)
688  {
689  pr[i] = std::real (p[i]);
690  pi[i] = std::imag (p[i]);
691  }
692 
693  return retval;
694 }
695 
698 {
699  switch (umap)
700  {
701  // Mappers handled specially.
702  case umap_real:
704  case umap_imag:
706  case umap_conj:
708 
709  // Special cases for Matlab compatibility.
710  case umap_xtolower:
711  case umap_xtoupper:
712  return matrix;
713 
714 #define ARRAY_METHOD_MAPPER(UMAP, FCN) \
715  case umap_ ## UMAP: \
716  return octave_value (matrix.FCN ())
717 
722 
723 #define ARRAY_MAPPER(UMAP, TYPE, FCN) \
724  case umap_ ## UMAP: \
725  return octave_value (matrix.map<TYPE> (FCN))
726 
729  ARRAY_MAPPER (angle, float, std::arg);
730  ARRAY_MAPPER (arg, float, std::arg);
741  ARRAY_MAPPER (cos, FloatComplex, std::cos);
742  ARRAY_MAPPER (cosh, FloatComplex, std::cosh);
743  ARRAY_MAPPER (exp, FloatComplex, std::exp);
749  ARRAY_MAPPER (log10, FloatComplex, std::log10);
754  ARRAY_MAPPER (sin, FloatComplex, std::sin);
755  ARRAY_MAPPER (sinh, FloatComplex, std::sinh);
756  ARRAY_MAPPER (sqrt, FloatComplex, std::sqrt);
757  ARRAY_MAPPER (tan, FloatComplex, std::tan);
758  ARRAY_MAPPER (tanh, FloatComplex, std::tanh);
760 
761  default:
762  return octave_base_value::map (umap);
763  }
764 }
save_type
Definition: data-conv.h:85
octave_idx_type write(const octave_value &data, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, mach_info::float_format flt_fmt)
Definition: oct-stream.cc:6704
double erfcx(double x)
Definition: lo-specfun.cc:1756
octave_idx_type rows(void) const
Definition: Array.h:404
FloatComplexNDArray float_complex_array_value(bool=false) const
bool all_integers(float &max_val, float &min_val) const
Definition: fCNDArray.cc:518
void write_floats(std::ostream &os, const float *data, save_type type, octave_idx_type len)
Definition: data-conv.cc:937
FloatMatrix float_matrix_value(bool=false) const
FloatComplexMatrix diag(octave_idx_type k=0) const
Definition: fCMatrix.cc:3025
OCTAVE_IDX_TYPE mwSize
Definition: mxarray.in.h:93
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
const T * data(void) const
Definition: Array.h:582
std::complex< double > erfi(std::complex< double > z, double relerr=0)
void warn_logical_conversion(void)
Definition: errwarn.cc:359
int current_print_indent_level(void) const
Definition: ov-base.h:849
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:4986
const octave_hdf5_id octave_H5S_ALL
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
double erfi(double x)
Definition: lo-specfun.cc:1775
save_type get_save_type(double, double)
Definition: ls-utils.cc:35
double asinh(double x)
Definition: lo-specfun.h:67
#define ARRAY_METHOD_MAPPER(UMAP, FCN)
for large enough k
Definition: lu.cc:617
bool isna(double x)
Definition: lo-mappers.cc:45
void resize(int n, int fill_value=0)
Definition: dim-vector.h:310
const T * fortran_vec(void) const
Definition: Array.h:584
bool any_element_is_nan(void) const
Definition: fCNDArray.cc:494
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the base of natural logarithms The constant ex $e satisfies the equation log(e)
bool isnan(bool)
Definition: lo-mappers.h:187
std::complex< T > ceil(const std::complex< T > &x)
Definition: lo-mappers.h:112
bool all_elements_are_real(void) const
Definition: fCNDArray.cc:508
void error(const char *fmt,...)
Definition: error.cc:578
bool isinf(double x)
Definition: lo-mappers.h:225
std::complex< T > floor(const std::complex< T > &x)
Definition: lo-mappers.h:139
static T abs(T x)
Definition: pr-output.cc:1696
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
Definition: ov-base.h:180
octave_idx_type columns(void) const
Definition: Array.h:413
octave_value diag(octave_idx_type k=0) const
int load_hdf5_empty(octave_hdf5_id loc_id, const char *name, dim_vector &d)
Definition: ls-hdf5.cc:953
T & elem(octave_idx_type n)
Definition: Array.h:488
Complex acos(const Complex &x)
Definition: lo-mappers.cc:83
Complex atan(const Complex &x)
Definition: lo-mappers.h:80
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
Definition: file-io.cc:587
double fix(double x)
Definition: lo-mappers.h:127
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:831
Complex asin(const Complex &x)
Definition: lo-mappers.cc:105
void err_nan_to_logical_conversion(void)
Complex log2(const Complex &x)
Definition: lo-mappers.cc:137
Complex erfc(const Complex &x)
Definition: lo-specfun.cc:1653
mxArray * as_mxArray(void) const
std::complex< double > erf(std::complex< double > z, double relerr=0)
virtual octave_value map(unary_mapper_t) const
Definition: ov-base.cc:1121
octave_value arg
Definition: pr-output.cc:3244
void warn_load(const char *type) const
Definition: ov-base.cc:1097
bool swap
Definition: load-save.cc:738
charNDArray char_array_value(bool frc_str_conv=false) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Complex expm1(const Complex &x)
Definition: lo-specfun.cc:1875
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:215
create a structure array and initialize its values The dimensions of each cell array of values must match Singleton cells and non cell values are repeated so that they fill the entire array If the cells are empty
Definition: ov-struct.cc:1736
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)
Definition: pr-output.cc:1780
nd deftypefn *std::string name
Definition: sysdep.cc:647
double acosh(double x)
Definition: lo-specfun.h:49
void swap_bytes< 4 >(void *ptr)
Definition: byte-swap.h:60
ComplexMatrix complex_matrix_value(bool=false) const
octave_value diag(octave_idx_type k=0) const
Definition: ov-base-mat.h:127
float float_value(bool=false) const
boolNDArray bool_array_value(bool warn=false) const
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
Definition: ls-oct-text.cc:82
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
bool load_ascii(std::istream &is)
Complex log1p(const Complex &x)
Definition: lo-specfun.cc:1959
SparseMatrix sparse_matrix_value(bool=false) const
bool hdf5_types_compatible(octave_hdf5_id t1, octave_hdf5_id t2)
Definition: ls-hdf5.cc:190
octave_idx_type rows(void) const
Definition: ov-base.h:316
double signum(double x)
Definition: lo-mappers.h:244
double dawson(double x)
Definition: lo-specfun.cc:1518
void resize(const dim_vector &dv, const T &rfv)
Resizing (with fill).
Definition: Array.cc:1010
octave_hdf5_id save_type_to_hdf5(save_type st)
Definition: ls-hdf5.cc:997
double tmp
Definition: data.cc:6252
ComplexNDArray complex_array_value(bool=false) const
octave_value retval
Definition: data.cc:6246
#define panic_impossible()
Definition: error.h:40
bool save_ascii(std::ostream &os)
std::complex< double > erfcx(std::complex< double > z, double relerr=0)
int64_t octave_hdf5_id
#define ARRAY_MAPPER(UMAP, TYPE, FCN)
double atanh(double x)
Definition: lo-specfun.h:72
boolMatrix mx_el_ne(const boolMatrix &m1, const boolMatrix &m2)
Definition: boolMatrix.cc:89
void warn_save(const char *type) const
Definition: ov-base.cc:1106
octave_value as_double(void) const
Definition: dMatrix.h:36
FloatComplex float_complex_value(bool=false) const
Complex erf(const Complex &x)
Definition: lo-specfun.cc:1638
float lo_ieee_float_nan_value(void)
Definition: lo-ieee.cc:123
void mxArray
Definition: mex.h:55
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Complex complex_value(bool=false) const
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector &d)
Definition: ls-hdf5.cc:897
void err_invalid_conversion(const std::string &from, const std::string &to)
Definition: errwarn.cc:68
octave_value as_single(void) const
octave_base_value * try_narrowing_conversion(void)
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:362
octave_value map(unary_mapper_t umap) const
p
Definition: lu.cc:138
Matrix matrix_value(bool=false) const
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Definition: errwarn.cc:338
bool isfinite(double x)
Definition: lo-mappers.h:201
bool save_binary(std::ostream &os, bool &save_as_floats)
double roundb(double x)
Definition: lo-mappers.h:156
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
Definition: oct-locbuf.h:41
octave_idx_type numel(void) const
Definition: ov-base-mat.h:107
double round(double x)
Definition: lo-mappers.h:145
ColumnVector imag(const ComplexColumnVector &a)
Definition: dColVector.cc:141
for i
Definition: data.cc:5264
const octave_hdf5_id octave_H5P_DEFAULT
octave_idx_type columns(void) const
Definition: ov-base.h:323
std::complex< float > FloatComplex
Definition: oct-cmplx.h:32
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
octave_idx_type ndims(void) const
Number of dimensions.
Definition: dim-vector.h:295
double double_value(bool=false) const
std::complex< double > Complex
Definition: oct-cmplx.h:31
octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:366
ColumnVector real(const ComplexColumnVector &a)
Definition: dColVector.cc:135
OCTAVE_IDX_TYPE mwIndex
Definition: mxarray.in.h:94
write the output to stdout if nargout is
Definition: load-save.cc:1612
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:87
octave_hdf5_id hdf5_make_complex_type(octave_hdf5_id num_type)
Definition: ls-hdf5.cc:326
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
dim_vector dv
Definition: sub2ind.cc:263
octave::stream os
Definition: file-io.cc:627
static const double pi
Definition: lo-specfun.cc:1996
int ndims(void) const
Definition: Array.h:590
std::complex< double > erfc(std::complex< double > z, double relerr=0)