26 #if defined (HAVE_CONFIG_H)
66 "complex scalar",
"double");
87 set_message (expression ()
88 +
": subscripts must be real (forgot to initialize i or j?)");
94 return "Octave:invalid-index";
120 double im =
scalar.imag ();
150 std::ostringstream buf;
151 buf <<
scalar.real () << std::showpos <<
scalar.imag () <<
'i';
160 if (! force_conversion)
162 "complex scalar",
"real scalar");
170 if (! force_conversion)
172 "complex scalar",
"real scalar");
182 if (! force_conversion)
184 "complex scalar",
"real matrix");
196 if (! force_conversion)
198 "complex scalar",
"real matrix");
210 if (! force_conversion)
212 "complex scalar",
"real matrix");
224 if (! force_conversion)
226 "complex scalar",
"real matrix");
326 scalar = octave_read_value<Complex> (is);
329 error (
"load: failed to load complex scalar constant");
337 char tmp =
static_cast<char> (
LS_DOUBLE);
338 os.write (
reinterpret_cast<char *
> (&tmp), 1);
340 os.write (
reinterpret_cast<char *
> (&ctmp), 16);
350 if (! is.read (
reinterpret_cast<char *
> (&tmp), 1))
355 static_cast<save_type> (tmp), 2, swap, fmt);
370 #if defined (HAVE_HDF5)
373 hid_t space_hid, type_hid, data_hid;
374 space_hid = type_hid = data_hid = -1;
376 space_hid = H5Screate_simple (0, dimens,
nullptr);
383 H5Sclose (space_hid);
386 #if defined (HAVE_HDF5_18)
387 data_hid = H5Dcreate (loc_id,
name, type_hid, space_hid,
394 H5Sclose (space_hid);
405 H5Sclose (space_hid);
408 octave_unused_parameter (loc_id);
409 octave_unused_parameter (
name);
422 #if defined (HAVE_HDF5)
424 #if defined (HAVE_HDF5_18)
427 hid_t data_hid = H5Dopen (loc_id,
name);
429 hid_t type_hid = H5Dget_type (data_hid);
435 H5Tclose (complex_type);
440 hid_t space_id = H5Dget_space (data_hid);
441 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
445 H5Tclose (complex_type);
460 H5Tclose (complex_type);
465 octave_unused_parameter (loc_id);
466 octave_unused_parameter (
name);
479 double *pr =
static_cast<double *
> (
retval->get_data ());
480 double *
pi =
static_cast<double *
> (
retval->get_imag_data ());
493 #define SCALAR_MAPPER(UMAP, FCN) \
494 case umap_ ## UMAP: \
495 return octave_value (FCN (scalar))
ComplexColumnVector conj(const ComplexColumnVector &a)
N Dimensional Array with copy-on-write semantics.
Vector representing the dimensions (size) of an Array.
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
~complex_index_exception(void)=default
complex_index_exception(const std::string &value)
void update_message(void)
const char * err_id(void) const
virtual octave_value map(unary_mapper_t) const
void warn_load(const char *type) const
void warn_save(const char *type) const
float float_value(bool=false) const
octave_base_value * try_narrowing_conversion(void)
idx_vector index_vector(bool=false) const
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
bool save_binary(std::ostream &os, bool save_as_floats)
octave_value as_single(void) const
FloatComplex float_complex_value(bool=false) const
NDArray array_value(bool=false) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
octave_value diag(octave_idx_type m, octave_idx_type n) const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
ComplexMatrix complex_matrix_value(bool=false) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
bool save_ascii(std::ostream &os)
mxArray * as_mxArray(void) const
octave_value map(unary_mapper_t umap) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
FloatNDArray float_array_value(bool=false) const
octave_value as_double(void) const
type_conv_info numeric_demotion_function(void) const
octave_value resize(const dim_vector &dv, bool fill=false) const
FloatMatrix float_matrix_value(bool=false) const
bool load_ascii(std::istream &is)
ComplexNDArray complex_array_value(bool=false) const
FloatComplexNDArray float_complex_array_value(bool=false) const
Matrix matrix_value(bool=false) const
double double_value(bool=false) const
Complex complex_value(bool=false) const
static int static_type_id(void)
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
const octave_hdf5_id octave_H5P_DEFAULT
const octave_hdf5_id octave_H5S_ALL
ColumnVector real(const ComplexColumnVector &a)
ColumnVector imag(const ComplexColumnVector &a)
void read_doubles(std::istream &is, double *data, save_type type, octave_idx_type len, bool swap, octave::mach_info::float_format fmt)
void error(const char *fmt,...)
void warn_implicit_conversion(const char *id, const char *from, const char *to)
void octave_write_complex(std::ostream &os, const Complex &c)
octave_hdf5_id hdf5_make_complex_type(octave_hdf5_id num_type)
bool hdf5_types_compatible(octave_hdf5_id t1, octave_hdf5_id t2)
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)
Complex atan(const Complex &x)
Complex log1p(const Complex &x)
Complex acos(const Complex &x)
Complex asin(const Complex &x)
Complex erfc(const Complex &x)
std::complex< T > ceil(const std::complex< T > &x)
Complex log2(const Complex &x)
std::complex< T > floor(const std::complex< T > &x)
Complex erf(const Complex &x)
Complex expm1(const Complex &x)
std::complex< double > Complex
std::complex< float > FloatComplex
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
#define SCALAR_MAPPER(UMAP, FCN)
static octave_base_value * default_numeric_demotion_function(const octave_base_value &a)
octave_value::octave_value(const Array< char > &chm, char type) return retval