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";
300 for (
int i = 0;
i < dv.
ndims ();
i++)
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);
395 for (
int i = 0;
i < dv.
ndims ();
i++)
398 os.write (reinterpret_cast<char *> (&tmp), 4);
403 if (dv.
numel () > 4096)
405 float max_val, min_val;
411 write_floats (os, reinterpret_cast<const float *> (mtmp), st,
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))
461 static_cast<save_type> (tmp), 2 * dv.
numel (),
swap, fmt);
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)
505 int rank = dv.
ndims ();
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, 0);
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 ());
709 #define ARRAY_METHOD_MAPPER(UMAP, FCN) \
710 case umap_ ## UMAP: \
711 return octave_value (matrix.FCN ())
718 #define ARRAY_MAPPER(UMAP, TYPE, FCN) \
719 case umap_ ## UMAP: \
720 return octave_value (matrix.map<TYPE> (FCN))
void write_floats(std::ostream &os, const float *data, save_type type, octave_idx_type len)
FloatComplex float_complex_value(bool=false) const
boolNDArray bool_array_value(bool warn=false) const
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
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.
void warn_logical_conversion(void)
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)
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector d)
save_type get_save_type(double, double)
#define ARRAY_METHOD_MAPPER(UMAP, FCN)
octave_idx_type numel(void) const
void resize(int n, int fill_value=0)
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 error(const char *fmt,...)
ComplexMatrix complex_matrix_value(bool=false) const
void * get_data(void) const
octave_value diag(octave_idx_type k=0) const
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
int load_hdf5_empty(octave_hdf5_id loc_id, const char *name, dim_vector &d)
T & elem(octave_idx_type n)
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Complex acos(const Complex &x)
octave_value map(unary_mapper_t umap) const
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)
bool all_integers(float &max_val, float &min_val) const
octave_idx_type rows(void) const
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
ComplexNDArray complex_array_value(bool=false) const
bool any_element_is_nan(void) const
FloatComplexMatrix diag(octave_idx_type k=0) const
void warn_load(const char *type) const
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 swap_bytes< 4 >(void *ptr)
Complex atan(const Complex &x)
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)
nd deftypefn *octave_map m
bool hdf5_types_compatible(octave_hdf5_id t1, octave_hdf5_id t2)
FloatComplexNDArray float_complex_array_value(bool=false) const
const T * data(void) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
void resize(const dim_vector &dv, const T &rfv)
octave_hdf5_id save_type_to_hdf5(save_type st)
#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)
double double_value(bool=false) const
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
float lo_ieee_float_nan_value(void)
void warn_save(const char *type) const
Complex complex_value(bool=false) const
dim_vector dims(void) const
void err_invalid_conversion(const std::string &from, const std::string &to)
bool all_elements_are_real(void) const
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
=val(i)}if ode{val(i)}occurs in table i
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
void octave_print_internal(std::ostream &, char, bool)
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)
octave_value diag(octave_idx_type k=0) const
float float_value(bool=false) const
octave_idx_type ndims(void) const
Number of dimensions.
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
virtual octave_value map(unary_mapper_t) const
ColumnVector imag(const ComplexColumnVector &a)
const octave_hdf5_id octave_H5P_DEFAULT
std::complex< float > FloatComplex
octave_value as_double(void) const
std::complex< double > Complex
const T * fortran_vec(void) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
ColumnVector real(const ComplexColumnVector &a)
static const char *const keywords[]
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
octave_idx_type columns(void) const
octave_idx_type rows(void) const
std::complex< double > erfc(std::complex< double > z, double relerr=0)