24 #if defined (HAVE_CONFIG_H) 71 "float complex matrix",
"single");
96 if (! force_conversion)
98 "complex matrix",
"real scalar");
104 "complex matrix",
"real scalar");
112 if (! force_conversion)
114 "complex matrix",
"real scalar");
120 "complex matrix",
"real scalar");
130 if (! force_conversion)
132 "complex matrix",
"real matrix");
144 if (! force_conversion)
146 "complex matrix",
"real matrix");
160 "complex matrix",
"complex scalar");
176 "complex matrix",
"complex scalar");
201 ||
real (
matrix).any_element_not_one_or_zero ()))
214 "complex matrix",
"string");
238 if (! force_conversion)
240 "complex matrix",
"real matrix");
283 error (
"diag: expecting vector argument");
287 return mat.
diag (m, n);
298 os <<
"# ndims: " <<
dv.
ndims () <<
"\n";
309 os <<
"# rows: " <<
rows () <<
"\n" 310 <<
"# columns: " <<
columns () <<
"\n";
323 keywords[0] =
"ndims";
324 keywords[1] =
"rows";
330 error (
"load: failed to extract number of rows and columns");
334 int mdims =
static_cast<int> (
val);
337 error (
"load: failed to extract number of dimensions");
342 for (
int i = 0;
i < mdims;
i++)
346 error (
"load: failed to read dimensions");
353 error (
"load: failed to load matrix constant");
357 else if (kw ==
"rows")
363 error (
"load: failed to extract number of rows and columns");
365 if (nr > 0 && nc > 0)
370 error (
"load: failed to load matrix constant");
374 else if (nr == 0 || nc == 0)
394 os.
write (reinterpret_cast<char *> (&
tmp), 4);
398 os.
write (reinterpret_cast<char *> (&
tmp), 4);
405 float max_val, min_val;
423 if (!
is.read (reinterpret_cast<char *> (&mdims), 4))
434 for (
int i = 0;
i < mdims;
i++)
436 if (!
is.read (reinterpret_cast<char *> (&di), 4))
455 if (!
is.read (reinterpret_cast<char *> (&
tmp), 1))
472 if (!
is.read (reinterpret_cast<char *> (&nc), 4))
476 if (!
is.read (reinterpret_cast<char *> (&
tmp), 1))
482 static_cast<save_type> (
tmp), 2*len,
swap, fmt);
498 #if defined (HAVE_HDF5) 506 hid_t space_hid, data_hid, type_hid;
507 space_hid = data_hid = type_hid = -1;
513 for (
int i = 0;
i < rank;
i++)
514 hdims[
i] =
dv(rank-
i-1);
516 space_hid = H5Screate_simple (rank, hdims,
nullptr);
517 if (space_hid < 0)
return false;
519 hid_t save_type_hid = H5T_NATIVE_FLOAT;
521 #if defined (HAVE_HDF5_INT2FLOAT_CONVERSIONS) 525 float max_val, min_val;
536 H5Sclose (space_hid);
539 #if defined (HAVE_HDF5_18) 540 data_hid = H5Dcreate (loc_id,
name, type_hid, space_hid,
547 H5Sclose (space_hid);
553 if (complex_type_hid < 0)
retval =
false;
562 H5Tclose (complex_type_hid);
567 H5Tclose (complex_type_hid);
570 H5Sclose (space_hid);
573 octave_unused_parameter (loc_id);
574 octave_unused_parameter (
name);
587 #if defined (HAVE_HDF5) 596 #if defined (HAVE_HDF5_18) 599 hid_t data_hid = H5Dopen (loc_id,
name);
601 hid_t type_hid = H5Dget_type (data_hid);
607 H5Tclose (complex_type);
612 hid_t space_id = H5Dget_space (data_hid);
614 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
618 H5Tclose (complex_type);
627 H5Sget_simple_extent_dims (space_id, hdims, maxdims);
639 for (hsize_t
i = 0, j = rank - 1;
i < rank;
i++, j--)
653 H5Tclose (complex_type);
658 octave_unused_parameter (loc_id);
659 octave_unused_parameter (
name);
669 bool pr_as_read_syntax)
const 680 float *pr =
static_cast<float *
> (
retval->get_data ());
681 float *
pi =
static_cast<float *
> (
retval->get_imag_data ());
714 #define ARRAY_METHOD_MAPPER(UMAP, FCN) \ 715 case umap_ ## UMAP: \ 716 return octave_value (matrix.FCN ()) 723 #define ARRAY_MAPPER(UMAP, TYPE, FCN) \ 724 case umap_ ## UMAP: \ 725 return octave_value (matrix.map<TYPE> (FCN))
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)
octave_idx_type rows(void) const
FloatComplexNDArray float_complex_array_value(bool=false) const
bool all_integers(float &max_val, float &min_val) const
void write_floats(std::ostream &os, const float *data, save_type type, octave_idx_type len)
FloatMatrix float_matrix_value(bool=false) const
FloatComplexMatrix diag(octave_idx_type k=0) const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
const T * data(void) const
std::complex< double > erfi(std::complex< double > z, double relerr=0)
void warn_logical_conversion(void)
int current_print_indent_level(void) const
identity matrix If supplied two scalar respectively For allows like xample val
const octave_hdf5_id octave_H5S_ALL
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
save_type get_save_type(double, double)
#define ARRAY_METHOD_MAPPER(UMAP, FCN)
void resize(int n, int fill_value=0)
const T * fortran_vec(void) const
bool any_element_is_nan(void) const
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)
std::complex< T > ceil(const std::complex< T > &x)
bool all_elements_are_real(void) const
void error(const char *fmt,...)
std::complex< T > floor(const std::complex< T > &x)
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
octave_idx_type columns(void) const
octave_value diag(octave_idx_type k=0) const
int load_hdf5_empty(octave_hdf5_id loc_id, const char *name, dim_vector &d)
T & elem(octave_idx_type n)
Complex acos(const Complex &x)
Complex atan(const Complex &x)
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
void read_floats(std::istream &is, float *data, save_type type, octave_idx_type len, bool swap, octave::mach_info::float_format fmt)
Complex asin(const Complex &x)
void err_nan_to_logical_conversion(void)
Complex log2(const Complex &x)
Complex erfc(const Complex &x)
mxArray * as_mxArray(void) const
std::complex< double > erf(std::complex< double > z, double relerr=0)
virtual octave_value map(unary_mapper_t) const
void warn_load(const char *type) const
charNDArray char_array_value(bool frc_str_conv=false) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Complex expm1(const Complex &x)
ComplexColumnVector conj(const ComplexColumnVector &a)
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
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)
nd deftypefn *std::string name
void swap_bytes< 4 >(void *ptr)
ComplexMatrix complex_matrix_value(bool=false) const
octave_value diag(octave_idx_type k=0) const
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)
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)
SparseMatrix sparse_matrix_value(bool=false) const
bool hdf5_types_compatible(octave_hdf5_id t1, octave_hdf5_id t2)
octave_idx_type rows(void) const
void resize(const dim_vector &dv, const T &rfv)
Resizing (with fill).
octave_hdf5_id save_type_to_hdf5(save_type st)
ComplexNDArray complex_array_value(bool=false) const
#define panic_impossible()
bool save_ascii(std::ostream &os)
std::complex< double > erfcx(std::complex< double > z, double relerr=0)
#define ARRAY_MAPPER(UMAP, TYPE, FCN)
boolMatrix mx_el_ne(const boolMatrix &m1, const boolMatrix &m2)
void warn_save(const char *type) const
octave_value as_double(void) const
FloatComplex float_complex_value(bool=false) const
Complex erf(const Complex &x)
float lo_ieee_float_nan_value(void)
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)
void err_invalid_conversion(const std::string &from, const std::string &to)
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.
octave_value map(unary_mapper_t umap) const
dim_vector dims(void) const
Matrix matrix_value(bool=false) const
void warn_implicit_conversion(const char *id, const char *from, const char *to)
FloatComplexNDArray matrix
bool save_binary(std::ostream &os, bool &save_as_floats)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
octave_idx_type numel(void) const
ColumnVector imag(const ComplexColumnVector &a)
const octave_hdf5_id octave_H5P_DEFAULT
octave_idx_type columns(void) const
std::complex< float > FloatComplex
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
octave_idx_type ndims(void) const
Number of dimensions.
double double_value(bool=false) const
std::complex< double > Complex
octave_idx_type numel(void) const
Number of elements in the array.
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
std::complex< double > erfc(std::complex< double > z, double relerr=0)