24 #if defined (HAVE_CONFIG_H)
67 "complex matrix",
"double");
108 if (! force_conversion)
110 "complex matrix",
"real scalar");
116 "complex matrix",
"real scalar");
124 if (! force_conversion)
126 "complex matrix",
"real scalar");
132 "complex matrix",
"real scalar");
142 if (! force_conversion)
144 "complex matrix",
"real matrix");
156 if (! force_conversion)
158 "complex matrix",
"real matrix");
170 if (! force_conversion)
172 "complex matrix",
"real matrix");
186 "complex matrix",
"complex scalar");
202 "complex matrix",
"complex scalar");
227 ||
real (
matrix).any_element_not_one_or_zero ()))
240 "complex matrix",
"string");
264 if (! force_conversion)
266 "complex matrix",
"real matrix");
309 error (
"diag: expecting vector argument");
313 return mat.
diag (m, n);
324 os <<
"# ndims: " << dv.
ndims () <<
"\n";
326 for (
int i = 0;
i < dv.
ndims ();
i++)
335 os <<
"# rows: " <<
rows () <<
"\n"
336 <<
"# columns: " <<
columns () <<
"\n";
349 keywords[0] =
"ndims";
350 keywords[1] =
"rows";
356 error (
"load: failed to extract number of rows and columns");
360 int mdims =
static_cast<int> (
val);
363 error (
"load: failed to extract number of dimensions");
368 for (
int i = 0;
i < mdims;
i++)
372 error (
"load: failed to read dimensions");
379 error (
"load: failed to load matrix constant");
383 else if (kw ==
"rows")
389 error (
"load: failed to extract number of rows and columns");
391 if (nr > 0 && nc > 0)
396 error (
"load: failed to load matrix constant");
400 else if (nr == 0 || nc == 0)
420 os.write (reinterpret_cast<char *> (&tmp), 4);
421 for (
int i = 0;
i < dv.
ndims ();
i++)
424 os.write (reinterpret_cast<char *> (&tmp), 4);
433 warning (
"save: some values too large to save as floats --");
434 warning (
"save: saving as doubles instead");
439 else if (dv.
numel () > 4096)
441 double max_val, min_val;
447 write_doubles (os, reinterpret_cast<const double *> (mtmp), st,
459 if (! is.read (reinterpret_cast<char *> (&mdims), 4))
470 for (
int i = 0;
i < mdims;
i++)
472 if (! is.read (reinterpret_cast<char *> (&di), 4))
491 if (! is.read (reinterpret_cast<char *> (&tmp), 1))
497 static_cast<save_type> (tmp), 2 * dv.
numel (),
swap, fmt);
508 if (! is.read (reinterpret_cast<char *> (&nc), 4))
512 if (! is.read (reinterpret_cast<char *> (&tmp), 1))
518 static_cast<save_type> (tmp), 2*len, swap, fmt);
532 #if defined (HAVE_HDF5)
539 int rank = dv.
ndims ();
540 hid_t space_hid, data_hid, type_hid;
541 space_hid = data_hid = type_hid = -1;
548 for (
int i = 0;
i < rank;
i++)
549 hdims[
i] =
dv(rank-
i-1);
551 space_hid = H5Screate_simple (rank, hdims, 0);
552 if (space_hid < 0)
return false;
554 hid_t save_type_hid = H5T_NATIVE_DOUBLE;
560 warning (
"save: some values too large to save as floats --");
561 warning (
"save: saving as doubles instead");
564 save_type_hid = H5T_NATIVE_FLOAT;
566 #if defined (HAVE_HDF5_INT2FLOAT_CONVERSIONS)
570 double max_val, min_val;
581 H5Sclose (space_hid);
584 #if defined (HAVE_HDF5_18)
585 data_hid = H5Dcreate (loc_id, name, type_hid, space_hid,
592 H5Sclose (space_hid);
598 if (complex_type_hid < 0) retval =
false;
607 H5Tclose (complex_type_hid);
612 H5Tclose (complex_type_hid);
615 H5Sclose (space_hid);
620 octave_unused_parameter (loc_id);
621 octave_unused_parameter (name);
622 octave_unused_parameter (save_as_floats);
635 #if defined (HAVE_HDF5)
644 #if defined (HAVE_HDF5_18)
647 hid_t data_hid = H5Dopen (loc_id, name);
649 hid_t type_hid = H5Dget_type (data_hid);
655 H5Tclose (complex_type);
660 hid_t space_id = H5Dget_space (data_hid);
662 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
666 H5Tclose (complex_type);
675 H5Sget_simple_extent_dims (space_id, hdims, maxdims);
687 for (hsize_t
i = 0, j = rank - 1;
i < rank;
i++, j--)
701 H5Tclose (complex_type);
706 octave_unused_parameter (loc_id);
707 octave_unused_parameter (name);
717 bool pr_as_read_syntax)
const
728 double *pr =
static_cast<double *
> (retval->
get_data ());
757 #define ARRAY_METHOD_MAPPER(UMAP, FCN) \
758 case umap_ ## UMAP: \
759 return octave_value (matrix.FCN ())
766 #define ARRAY_MAPPER(UMAP, TYPE, FCN) \
767 case umap_ ## UMAP: \
768 return octave_value (matrix.map<TYPE> (FCN))
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
bool all_integers(double &max_val, double &min_val) const
float float_value(bool=false) const
bool any_element_is_nan(void) const
type_conv_info numeric_demotion_function(void) const
octave_idx_type columns(void) const
octave_value as_double(void) 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)
octave_idx_type numel(void) const
Number of elements in the array.
void warn_logical_conversion(void)
FloatComplexNDArray float_complex_array_value(bool=false) const
identity matrix If supplied two scalar respectively For allows like xample val
const octave_hdf5_id octave_H5S_ALL
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector d)
save_type get_save_type(double, double)
Matrix matrix_value(bool=false) const
Complex complex_value(bool=false) const
octave_value diag(octave_idx_type k=0) const
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,...)
void * get_data(void) const
bool save_ascii(std::ostream &os)
bool load_ascii(std::istream &is)
octave_value as_single(void) const
octave_value diag(octave_idx_type k=0) const
ComplexNDArray complex_array_value(bool=false) const
void write_doubles(std::ostream &os, const double *data, save_type type, octave_idx_type len)
#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)
Complex acos(const Complex &x)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
bool save_binary(std::ostream &os, bool &save_as_floats)
Complex asin(const Complex &x)
void err_nan_to_logical_conversion(void)
FloatComplexMatrix float_complex_matrix_value(bool=false) 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.
NDArray array_value(bool=false) const
bool too_large_for_float(void) const
octave_value map(unary_mapper_t umap) 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
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)
FloatComplex float_complex_value(bool=false) const
Complex atan(const Complex &x)
bool all_elements_are_real(void) const
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
void read_doubles(std::istream &is, double *data, save_type type, octave_idx_type len, bool swap, octave::mach_info::float_format fmt)
nd deftypefn *octave_map m
bool hdf5_types_compatible(octave_hdf5_id t1, octave_hdf5_id t2)
octave_base_value * try_narrowing_conversion(void)
const T * data(void) const
void resize(const dim_vector &dv, const T &rfv)
octave_hdf5_id save_type_to_hdf5(save_type st)
#define panic_impossible()
std::complex< double > erfcx(std::complex< double > z, double relerr=0)
boolMatrix mx_el_ne(const boolMatrix &m1, const boolMatrix &m2)
SparseMatrix sparse_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
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
float lo_ieee_float_nan_value(void)
void warn_save(const char *type) const
ComplexMatrix complex_matrix_value(bool=false) const
void warning(const char *fmt,...)
dim_vector dims(void) const
void err_invalid_conversion(const std::string &from, const std::string &to)
void * get_imag_data(void) const
=val(i)}if ode{val(i)}occurs in table i
#define ARRAY_MAPPER(UMAP, TYPE, FCN)
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))<
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
double double_value(bool=false) const
int current_print_indent_level(void) const
#define ARRAY_METHOD_MAPPER(UMAP, FCN)
void octave_print_internal(std::ostream &, char, bool)
void warn_implicit_conversion(const char *id, const char *from, const char *to)
octave_idx_type ndims(void) const
Number of dimensions.
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
virtual octave_value map(unary_mapper_t) const
FloatMatrix float_matrix_value(bool=false) const
mxArray * as_mxArray(void) const
ColumnVector imag(const ComplexColumnVector &a)
const octave_hdf5_id octave_H5P_DEFAULT
std::complex< float > FloatComplex
static int static_type_id(void)
ComplexMatrix diag(octave_idx_type k=0) const
std::complex< double > Complex
const T * fortran_vec(void) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
charNDArray char_array_value(bool frc_str_conv=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)
boolNDArray bool_array_value(bool warn=false) const
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)