23 #if defined (HAVE_CONFIG_H) 62 "complex scalar",
"double");
79 return "subscripts must be real (forgot to initialize i or j?)";
85 return "Octave:invalid-index";
111 double im =
scalar.imag ();
134 return tmp.do_index_op (idx, resize_ok);
141 std::ostringstream buf;
142 buf <<
scalar.real () << std::showpos <<
scalar.imag () <<
'i';
151 if (! force_conversion)
153 "complex scalar",
"real scalar");
161 if (! force_conversion)
163 "complex scalar",
"real scalar");
173 if (! force_conversion)
175 "complex scalar",
"real matrix");
187 if (! force_conversion)
189 "complex scalar",
"real matrix");
201 if (! force_conversion)
203 "complex scalar",
"real matrix");
215 if (! force_conversion)
217 "complex scalar",
"real matrix");
258 static_cast<FloatComplex> (
scalar));
317 scalar = octave_read_value<Complex> (
is);
320 error (
"load: failed to load complex scalar constant");
329 os.
write (reinterpret_cast<char *> (&
tmp), 1);
331 os.
write (reinterpret_cast<char *> (&ctmp), 16);
341 if (!
is.read (reinterpret_cast<char *> (&
tmp), 1))
346 static_cast<save_type> (
tmp), 2,
swap, fmt);
361 #if defined (HAVE_HDF5) 364 hid_t space_hid, type_hid, data_hid;
365 space_hid = type_hid = data_hid = -1;
367 space_hid = H5Screate_simple (0, dimens,
nullptr);
374 H5Sclose (space_hid);
377 #if defined (HAVE_HDF5_18) 378 data_hid = H5Dcreate (loc_id,
name, type_hid, space_hid,
385 H5Sclose (space_hid);
396 H5Sclose (space_hid);
399 octave_unused_parameter (loc_id);
400 octave_unused_parameter (
name);
413 #if defined (HAVE_HDF5) 415 #if defined (HAVE_HDF5_18) 418 hid_t data_hid = H5Dopen (loc_id,
name);
420 hid_t type_hid = H5Dget_type (data_hid);
426 H5Tclose (complex_type);
431 hid_t space_id = H5Dget_space (data_hid);
432 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
436 H5Tclose (complex_type);
451 H5Tclose (complex_type);
456 octave_unused_parameter (loc_id);
457 octave_unused_parameter (
name);
470 double *pr =
static_cast<double *
> (
retval->get_data ());
471 double *
pi =
static_cast<double *
> (
retval->get_imag_data ());
484 #define SCALAR_MAPPER(UMAP, FCN) \ 485 case umap_ ## UMAP: \ 486 return octave_value (FCN (scalar)) 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)
const char * err_id(void) const
octave_value as_single(void) const
ComplexMatrix complex_matrix_value(bool=false) const
bool save_binary(std::ostream &os, bool &save_as_floats)
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
FloatNDArray float_array_value(bool=false) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
NDArray array_value(bool=false) const
static octave_base_value * default_numeric_demotion_function(const octave_base_value &a)
std::complex< double > erfi(std::complex< double > z, double relerr=0)
const octave_hdf5_id octave_H5S_ALL
static int static_type_id(void)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
bool save_ascii(std::ostream &os)
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)
void octave_write_complex(std::ostream &os, const Complex &c)
std::complex< T > ceil(const std::complex< T > &x)
idx_vector index_vector(bool=false) const
void error(const char *fmt,...)
std::complex< T > floor(const std::complex< T > &x)
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
FloatMatrix float_matrix_value(bool=false) const
Complex acos(const Complex &x)
FloatComplex float_complex_value(bool=false) const
Complex atan(const Complex &x)
#define SCALAR_MAPPER(UMAP, FCN)
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
Complex asin(const Complex &x)
Complex log2(const Complex &x)
Complex erfc(const Complex &x)
std::complex< double > erf(std::complex< double > z, double relerr=0)
virtual octave_value map(unary_mapper_t) const
FloatComplexNDArray float_complex_array_value(bool=false) const
void warn_load(const char *type) const
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Complex expm1(const Complex &x)
double double_value(bool=false) const
ComplexColumnVector conj(const ComplexColumnVector &a)
nd deftypefn *std::string name
float float_value(bool=false) const
octave_value as_double(void) const
void read_doubles(std::istream &is, double *data, save_type type, octave_idx_type len, bool swap, octave::mach_info::float_format fmt)
octave_base_value * try_narrowing_conversion(void)
Complex log1p(const Complex &x)
bool hdf5_types_compatible(octave_hdf5_id t1, octave_hdf5_id t2)
mxArray * as_mxArray(void) const
std::complex< double > erfcx(std::complex< double > z, double relerr=0)
void warn_save(const char *type) const
octave_value resize(const dim_vector &dv, bool fill=false) const
ComplexNDArray complex_array_value(bool=false) const
Complex erf(const Complex &x)
octave_value map(unary_mapper_t umap) const
complex_index_exception(const std::string &value)
octave_value diag(octave_idx_type m, octave_idx_type n) const
Complex complex_value(bool=false) const
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
void warn_implicit_conversion(const char *id, const char *from, const char *to)
std::string details(void) const
type_conv_info numeric_demotion_function(void) const
Matrix matrix_value(bool=false) const
bool load_ascii(std::istream &is)
FloatComplexMatrix float_complex_matrix_value(bool=false) const
ColumnVector imag(const ComplexColumnVector &a)
const octave_hdf5_id octave_H5P_DEFAULT
std::complex< float > FloatComplex
std::complex< double > Complex
ColumnVector real(const ComplexColumnVector &a)
write the output to stdout if nargout is
Vector representing the dimensions (size) of an Array.
octave_hdf5_id hdf5_make_complex_type(octave_hdf5_id num_type)
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
nd group nd example For each display the value
std::complex< double > erfc(std::complex< double > z, double relerr=0)