24 #if defined (HAVE_CONFIG_H) 106 "real matrix",
"real scalar");
118 "real matrix",
"real scalar");
144 "real matrix",
"complex scalar");
160 "real matrix",
"complex scalar");
316 error (
"diag: expecting vector argument");
320 return mat.
diag (m, n);
353 ::warning (
"range error for conversion to character value");
358 chm(
i) =
static_cast<char> (ival);
375 os <<
"# ndims: " <<
dv.
ndims () <<
"\n";
386 os <<
"# rows: " <<
rows () <<
"\n" 387 <<
"# columns: " <<
columns () <<
"\n";
400 keywords[0] =
"ndims";
401 keywords[1] =
"rows";
407 error (
"load: failed to extract number of rows and columns");
411 int mdims =
static_cast<int> (
val);
414 error (
"load: failed to extract number of dimensions");
419 for (
int i = 0;
i < mdims;
i++)
423 error (
"load: failed to read dimensions");
430 error (
"load: failed to load matrix constant");
434 else if (kw ==
"rows")
440 error (
"load: failed to extract number of rows and columns");
442 if (nr > 0 && nc > 0)
447 error (
"load: failed to load matrix constant");
451 else if (nr == 0 || nc == 0)
471 os.
write (reinterpret_cast<char *> (&
tmp), 4);
475 os.
write (reinterpret_cast<char *> (&
tmp), 4);
482 float max_val, min_val;
487 const float *mtmp = m.
data ();
499 if (!
is.read (reinterpret_cast<char *> (&mdims), 4))
510 for (
int i = 0;
i < mdims;
i++)
512 if (!
is.read (reinterpret_cast<char *> (&di), 4))
531 if (!
is.read (reinterpret_cast<char *> (&
tmp), 1))
548 if (!
is.read (reinterpret_cast<char *> (&nc), 4))
552 if (!
is.read (reinterpret_cast<char *> (&
tmp), 1))
572 #if defined (HAVE_HDF5) 580 hid_t space_hid, data_hid;
581 space_hid = data_hid = -1;
587 for (
int i = 0;
i < rank;
i++)
588 hdims[
i] =
dv(rank-
i-1);
590 space_hid = H5Screate_simple (rank, hdims,
nullptr);
592 if (space_hid < 0)
return false;
594 hid_t save_type_hid = H5T_NATIVE_FLOAT;
596 #if defined (HAVE_HDF5_INT2FLOAT_CONVERSIONS) 600 float max_val, min_val;
607 #if defined (HAVE_HDF5_18) 608 data_hid = H5Dcreate (loc_id,
name, save_type_hid, space_hid,
611 data_hid = H5Dcreate (loc_id,
name, save_type_hid, space_hid,
616 H5Sclose (space_hid);
625 H5Sclose (space_hid);
628 octave_unused_parameter (loc_id);
629 octave_unused_parameter (
name);
642 #if defined (HAVE_HDF5) 651 #if defined (HAVE_HDF5_18) 654 hid_t data_hid = H5Dopen (loc_id,
name);
656 hid_t space_id = H5Dget_space (data_hid);
658 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
670 H5Sget_simple_extent_dims (space_id, hdims, maxdims);
682 for (hsize_t
i = 0, j = rank - 1;
i < rank;
i++, j--)
699 octave_unused_parameter (loc_id);
700 octave_unused_parameter (
name);
710 bool pr_as_read_syntax)
const 721 float *pr =
static_cast<float *
> (
retval->get_data ());
747 if (
tmp.imag () == 0.0)
785 #define ARRAY_METHOD_MAPPER(UMAP, FCN) \ 786 case umap_ ## UMAP: \ 787 return octave_value (matrix.FCN ()) 794 #define ARRAY_MAPPER(UMAP, TYPE, FCN) \ 795 case umap_ ## UMAP: \ 796 return octave_value (matrix.map<TYPE> (FCN)) 798 #define RC_ARRAY_MAPPER(UMAP, TYPE, FCN) \ 799 case umap_ ## UMAP: \ 800 return do_rc_map (matrix, FCN) 861 return str_conv.
map (umap);
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
bool all_integers(float &max_val, float &min_val) const
octave_value as_single(void) const
octave_value map(octave_base_value::unary_mapper_t umap) const
void write_floats(std::ostream &os, const float *data, save_type type, octave_idx_type len)
Complex rc_log10(double x)
intNDArray< octave_int64 > int64NDArray
octave_value as_int64(void) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
octave_value as_double(void) const
octave_value as_int16(void) const
octave_value as_uint64(void) const
charNDArray char_array_value(bool=false) const
Matrix matrix_value(bool=false) const
const T * data(void) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
Complex rc_acosh(double x)
Complex rc_sqrt(double x)
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
intNDArray< octave_uint32 > uint32NDArray
save_type get_save_type(double, double)
FloatComplex float_complex_value(bool=false) const
intNDArray< octave_uint8 > uint8NDArray
intNDArray< octave_uint16 > uint16NDArray
void resize(int n, int fill_value=0)
const T * fortran_vec(void) const
Complex rc_lgamma(double x)
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)
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
std::complex< T > ceil(const std::complex< T > &x)
void error(const char *fmt,...)
std::complex< T > floor(const std::complex< T > &x)
bool any_element_is_nan(void) const
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
#define ARRAY_METHOD_MAPPER(UMAP, FCN)
#define ARRAY_MAPPER(UMAP, TYPE, FCN)
octave_idx_type columns(void) 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)
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Complex atan(const Complex &x)
intNDArray< octave_int16 > int16NDArray
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)
std::complex< double > erf(std::complex< double > z, double relerr=0)
virtual octave_value map(unary_mapper_t) const
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
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 rc_atanh(double x)
Complex expm1(const Complex &x)
ComplexMatrix complex_matrix_value(bool=false) const
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
FloatNDArray float_array_value(bool=false) const
void swap_bytes< 4 >(void *ptr)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
float float_value(bool=false) const
virtual octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
bool any_element_not_one_or_zero(void) const
octave_value diag(octave_idx_type k=0) const
intNDArray< octave_int8 > int8NDArray
boolNDArray bool_array_value(bool warn=false) const
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
Complex log1p(const Complex &x)
FloatMatrix float_matrix_value(bool=false) const
octave_idx_type rows(void) const
octave_value map(unary_mapper_t umap) const
bool save_ascii(std::ostream &os)
FloatComplexNDArray float_complex_array_value(bool=false) const
Complex rc_log2(double x)
void resize(const dim_vector &dv, const T &rfv)
Resizing (with fill).
octave_hdf5_id save_type_to_hdf5(save_type st)
NDArray array_value(bool=false) const
#define panic_impossible()
std::complex< double > erfcx(std::complex< double > z, double relerr=0)
octave_value as_uint8(void) const
bool load_ascii(std::istream &is)
void warn_save(const char *type) const
double double_value(bool=false) const
Complex erf(const Complex &x)
float lo_ieee_float_nan_value(void)
friend class octave_value
Complex rc_acos(double x)
void warning(const char *fmt,...)
octave_value convert_to_str_internal(bool pad, bool force, char type) const
charNDArray max(char d, const charNDArray &m)
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector &d)
intNDArray< octave_int32 > int32NDArray
bool save_binary(std::ostream &os, bool &save_as_floats)
octave_value as_int32(void) const
This is a simple wrapper template that will subclass an Array<T> type or any later type derived from ...
void err_invalid_conversion(const std::string &from, const std::string &to)
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
SparseMatrix sparse_matrix_value(bool=false) const
mxArray * as_mxArray(void) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
dim_vector dims(void) const
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Complex rc_asin(double x)
Complex rc_log1p(double x)
FloatMatrix diag(octave_idx_type k=0) const
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
Complex complex_value(bool=false) const
static octave_value do_rc_map(const FloatNDArray &a, FloatComplex(&fcn)(float))
octave_idx_type numel(void) const
#define RC_ARRAY_MAPPER(UMAP, TYPE, FCN)
const octave_hdf5_id octave_H5P_DEFAULT
octave_idx_type columns(void) const
std::complex< float > FloatComplex
ComplexNDArray complex_array_value(bool=false) const
octave_idx_type ndims(void) const
Number of dimensions.
std::complex< double > Complex
octave_idx_type numel(void) const
Number of elements in the array.
write the output to stdout if nargout is
void err_nan_to_character_conversion(void)
octave_value as_int8(void) const
octave_base_value * try_narrowing_conversion(void)
Vector representing the dimensions (size) of an Array.
octave_value as_uint32(void) 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_value as_uint16(void) const
intNDArray< octave_uint64 > uint64NDArray
octave_value diag(octave_idx_type k=0) const
std::complex< double > erfc(std::complex< double > z, double relerr=0)