GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ov-flt-cx-mat.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2017 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 the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 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 <http://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 {
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
85  retval = new octave_float_complex (c);
86  }
87  else if (matrix.all_elements_are_real ())
88  retval = new octave_float_matrix (::real (matrix));
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 octave::math::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 octave::math::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 
134  retval = ::real (FloatComplexMatrix (matrix));
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 
148  retval = ::real (FloatComplexMatrix (matrix));
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 
170  FloatComplex retval (tmp, tmp);
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>(octave::math::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 
242  retval = SparseMatrix (::real (complex_matrix_value ()));
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 {
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, 0);
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 
643  FloatComplexNDArray m (dv);
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] = octave::math::real (p[i]);
690  pi[i] = octave::math::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 #define ARRAY_METHOD_MAPPER(UMAP, FCN) \
710  case umap_ ## UMAP: \
711  return octave_value (matrix.FCN ())
712 
716  ARRAY_METHOD_MAPPER (isfinite, isfinite);
717 
718 #define ARRAY_MAPPER(UMAP, TYPE, FCN) \
719  case umap_ ## UMAP: \
720  return octave_value (matrix.map<TYPE> (FCN))
721 
724  ARRAY_MAPPER (angle, float, std::arg);
725  ARRAY_MAPPER (arg, float, std::arg);
736  ARRAY_MAPPER (cos, FloatComplex, std::cos);
737  ARRAY_MAPPER (cosh, FloatComplex, std::cosh);
738  ARRAY_MAPPER (exp, FloatComplex, std::exp);
744  ARRAY_MAPPER (log10, FloatComplex, std::log10);
749  ARRAY_MAPPER (sin, FloatComplex, std::sin);
750  ARRAY_MAPPER (sinh, FloatComplex, std::sinh);
751  ARRAY_MAPPER (sqrt, FloatComplex, std::sqrt);
752  ARRAY_MAPPER (tan, FloatComplex, std::tan);
753  ARRAY_MAPPER (tanh, FloatComplex, std::tanh);
754  ARRAY_MAPPER (isna, bool, octave::math::is_NA);
755 
756  default:
757  return octave_base_value::map (umap);
758  }
759 }
save_type
Definition: data-conv.h:85
void write_floats(std::ostream &os, const float *data, save_type type, octave_idx_type len)
Definition: data-conv.cc:936
FloatComplex float_complex_value(bool=false) const
boolNDArray bool_array_value(bool warn=false) const
float erfcx(float x)
Definition: lo-specfun.cc:271
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
charNDArray char_array_value(bool frc_str_conv=false) const
octave_idx_type columns(void) const
Definition: ov-base.h:319
function erf(X)
Definition: erf.f:2
int ndims(void) const
Definition: Array.h:590
mxArray * as_mxArray(void) const
std::complex< double > erfi(std::complex< double > z, double relerr=0)
octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:363
void warn_logical_conversion(void)
Definition: errwarn.cc:353
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
const octave_hdf5_id octave_H5S_ALL
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector d)
Definition: ls-hdf5.cc:897
save_type get_save_type(double, double)
Definition: ls-utils.cc:35
bool isnan(double x)
Definition: lo-mappers.cc:347
#define ARRAY_METHOD_MAPPER(UMAP, FCN)
for large enough k
Definition: lu.cc:606
octave_idx_type numel(void) const
Definition: ov-base-mat.h:112
void resize(int n, int fill_value=0)
Definition: dim-vector.h:316
double atanh(double x)
Definition: lo-specfun.cc:149
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)
double ceil(double x)
Definition: lo-mappers.h:138
function atanh(X)
Definition: atanh.f:2
void error(const char *fmt,...)
Definition: error.cc:570
ComplexMatrix complex_matrix_value(bool=false) const
void * get_data(void) const
Definition: mxarray.h:449
octave_value diag(octave_idx_type k=0) const
Definition: ov-base-mat.h:132
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
Definition: ov-base.h:169
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:482
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Complex acos(const Complex &x)
Definition: lo-mappers.cc:90
double expm1(double x)
Definition: lo-specfun.cc:473
octave_value map(unary_mapper_t umap) const
double asinh(double x)
Definition: lo-specfun.cc:105
double fix(double x)
Definition: lo-mappers.h:158
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:830
Complex asin(const Complex &x)
Definition: lo-mappers.cc:150
void err_nan_to_logical_conversion(void)
bool all_integers(float &max_val, float &min_val) const
Definition: fCNDArray.cc:520
double real(double x)
Definition: lo-mappers.h:113
octave_idx_type rows(void) const
Definition: Array.h:401
octave_value arg
Definition: pr-output.cc:3440
double acosh(double x)
Definition: lo-specfun.cc:61
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:389
double round(double x)
Definition: lo-mappers.cc:333
bool is_NA(double x)
Definition: lo-mappers.cc:54
ComplexNDArray complex_array_value(bool=false) const
bool any_element_is_nan(void) const
Definition: fCNDArray.cc:496
FloatComplexMatrix diag(octave_idx_type k=0) const
Definition: fCMatrix.cc:2899
bool swap
Definition: load-save.cc:725
float erfi(float x)
Definition: lo-specfun.cc:289
void warn_load(const char *type) const
Definition: ov-base.cc:1151
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:216
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:1688
OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number!nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable name
Definition: input.cc:871
void swap_bytes< 4 >(void *ptr)
Definition: byte-swap.h:60
Complex atan(const Complex &x)
Definition: lo-mappers.cc:210
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
Definition: ls-oct-text.cc:80
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
function asinh(X)
Definition: asinh.f:2
bool load_ascii(std::istream &is)
nd deftypefn *octave_map m
Definition: ov-struct.cc:2058
bool hdf5_types_compatible(octave_hdf5_id t1, octave_hdf5_id t2)
Definition: ls-hdf5.cc:192
double signum(double x)
Definition: lo-mappers.h:259
FloatComplexNDArray float_complex_array_value(bool=false) const
float dawson(float x)
Definition: lo-specfun.cc:307
const T * data(void) const
Definition: Array.h:582
FloatComplexMatrix float_complex_matrix_value(bool=false) const
void resize(const dim_vector &dv, const T &rfv)
Definition: Array.cc:1028
octave_hdf5_id save_type_to_hdf5(save_type st)
Definition: ls-hdf5.cc:997
double tmp
Definition: data.cc:6300
octave_value retval
Definition: data.cc:6294
#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)
boolMatrix mx_el_ne(const boolMatrix &m1, const boolMatrix &m2)
Definition: boolMatrix.cc:90
double double_value(bool=false) const
double imag(double)
Definition: lo-mappers.h:103
Definition: dMatrix.h:37
FloatMatrix float_matrix_value(bool=false) const
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
Definition: lu.cc:138
float lo_ieee_float_nan_value(void)
Definition: lo-ieee.cc:202
void warn_save(const char *type) const
Definition: ov-base.cc:1160
Complex complex_value(bool=false) const
void mxArray
Definition: mex.h:55
bool isinf(double x)
Definition: lo-mappers.cc:387
function acosh(X)
Definition: acosh.f:2
double erf(double x)
Definition: lo-specfun.cc:193
void err_invalid_conversion(const std::string &from, const std::string &to)
Definition: errwarn.cc:68
bool all_elements_are_real(void) const
Definition: fCNDArray.cc:510
octave_base_value * try_narrowing_conversion(void)
SparseMatrix sparse_matrix_value(bool=false) const
octave_value as_single(void) const
void * get_imag_data(void) const
Definition: mxarray.h:451
=val(i)}if ode{val(i)}occurs in table i
Definition: lookup.cc:239
double log1p(double x)
Definition: lo-specfun.cc:587
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
Matrix matrix_value(bool=false) const
int current_print_indent_level(void) const
Definition: ov-base.h:830
p
Definition: lu.cc:138
void octave_print_internal(std::ostream &, char, bool)
Definition: pr-output.cc:1722
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Definition: errwarn.cc:332
bool save_binary(std::ostream &os, bool &save_as_floats)
octave_value diag(octave_idx_type k=0) const
float float_value(bool=false) const
double roundb(double x)
Definition: lo-mappers.h:189
octave_idx_type ndims(void) const
Number of dimensions.
Definition: dim-vector.h:301
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
Definition: oct-locbuf.h:200
virtual octave_value map(unary_mapper_t) const
Definition: ov-base.cc:1175
ColumnVector imag(const ComplexColumnVector &a)
Definition: dColVector.cc:142
double floor(double x)
Definition: lo-mappers.cc:330
const octave_hdf5_id octave_H5P_DEFAULT
double erfc(double x)
Definition: lo-specfun.cc:232
std::complex< float > FloatComplex
Definition: oct-cmplx.h:32
octave_value as_double(void) const
std::complex< double > Complex
Definition: oct-cmplx.h:31
const T * fortran_vec(void) const
Definition: Array.h:584
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
ColumnVector real(const ComplexColumnVector &a)
Definition: dColVector.cc:136
static const char *const keywords[]
Definition: help.cc:147
write the output to stdout if nargout is
Definition: load-save.cc:1576
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:328
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:854
dim_vector dv
Definition: sub2ind.cc:263
octave_idx_type columns(void) const
Definition: Array.h:410
double log2(double x)
Definition: lo-mappers.cc:233
octave_idx_type rows(void) const
Definition: ov-base.h:312
static const double pi
Definition: lo-specfun.cc:3610
std::complex< double > erfc(std::complex< double > z, double relerr=0)