26#if defined (HAVE_CONFIG_H)
54 "float complex scalar",
"single");
84 return tmp.
index_op (idx, resize_ok);
90 if (! force_conversion)
92 "complex scalar",
"real scalar");
100 if (! force_conversion)
102 "complex scalar",
"real scalar");
112 if (! force_conversion)
114 "complex scalar",
"real matrix");
126 if (! force_conversion)
128 "complex scalar",
"real matrix");
140 if (! force_conversion)
142 "complex scalar",
"real matrix");
154 if (! force_conversion)
156 "complex scalar",
"real matrix");
247 octave::write_value<FloatComplex> (os, c);
257 scalar = octave::read_value<FloatComplex> (is);
260 error (
"load: failed to load complex scalar constant");
268 char tmp =
static_cast<char> (
LS_FLOAT);
269 os.write (
reinterpret_cast<char *
> (&tmp), 1);
271 os.write (
reinterpret_cast<char *
> (&ctmp), 8);
278 octave::mach_info::float_format fmt)
281 if (! is.read (
reinterpret_cast<char *
> (&tmp), 1))
285 read_floats (is,
reinterpret_cast<float *
> (&ctmp),
286 static_cast<save_type> (tmp), 2, swap, fmt);
301#if defined (HAVE_HDF5)
303 hsize_t dimens[3] = {0};
304 hid_t space_hid, type_hid, data_hid;
305 space_hid = type_hid = data_hid = -1;
307 space_hid = H5Screate_simple (0, dimens,
nullptr);
314 H5Sclose (space_hid);
317#if defined (HAVE_HDF5_18)
318 data_hid = H5Dcreate (loc_id, name, type_hid, space_hid,
326 H5Sclose (space_hid);
337 H5Sclose (space_hid);
340 octave_unused_parameter (loc_id);
341 octave_unused_parameter (name);
354#if defined (HAVE_HDF5)
356#if defined (HAVE_HDF5_18)
359 hid_t data_hid = H5Dopen (loc_id, name);
361 hid_t type_hid = H5Dget_type (data_hid);
367 H5Tclose (complex_type);
372 hid_t space_id = H5Dget_space (data_hid);
373 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
377 H5Tclose (complex_type);
393 H5Tclose (complex_type);
398 octave_unused_parameter (loc_id);
399 octave_unused_parameter (name);
410 mxArray *retval =
new mxArray (interleaved, mxSINGLE_CLASS, 1, 1, mxCOMPLEX);
415 =
static_cast<mxComplexSingle *
> (retval->
get_data ());
417 pd[0].real =
scalar.real ();
418 pd[0].imag =
scalar.imag ();
422 mxSingle *pr =
static_cast<mxSingle *
> (retval->
get_data ());
423 mxSingle *pi =
static_cast<mxSingle *
> (retval->
get_imag_data ());
437#define SCALAR_MAPPER(UMAP, FCN) \
438 case umap_ ## UMAP: \
439 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.
void * get_imag_data() const
virtual octave_value map(unary_mapper_t) const
void warn_load(const char *type) const
void warn_save(const char *type) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
bool load_ascii(std::istream &is)
FloatMatrix float_matrix_value(bool=false) const
octave_value as_double() const
bool save_ascii(std::ostream &os)
FloatComplexNDArray float_complex_array_value(bool=false) const
Complex complex_value(bool=false) const
NDArray array_value(bool=false) const
ComplexNDArray complex_array_value(bool=false) const
bool save_binary(std::ostream &os, bool save_as_floats)
octave_value map(unary_mapper_t umap) const
ComplexMatrix complex_matrix_value(bool=false) const
mxArray * as_mxArray(bool interleaved) const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
octave_value diag(octave_idx_type m, octave_idx_type n) const
float float_value(bool=false) const
Matrix matrix_value(bool=false) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
double double_value(bool=false) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
octave_value as_single() const
FloatNDArray float_array_value(bool=false) const
octave_base_value * try_narrowing_conversion()
FloatComplex float_complex_value(bool=false) const
octave_value resize(const dim_vector &dv, bool fill=false) const
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
octave_value 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_floats(std::istream &is, float *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)
Complex log2(const Complex &x)
Complex asin(const Complex &x)
Complex acos(const Complex &x)
std::complex< T > ceil(const std::complex< T > &x)
Complex atan(const Complex &x)
std::complex< T > floor(const std::complex< T > &x)
Complex erf(const Complex &x)
Complex expm1(const Complex &x)
Complex log1p(const Complex &x)
Complex erfc(const Complex &x)
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 > Complex
std::complex< float > FloatComplex
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
#define SCALAR_MAPPER(UMAP, FCN)
template int8_t abs(int8_t)