24 #if defined (HAVE_CONFIG_H) 122 "real matrix",
"real scalar");
134 "real matrix",
"real scalar");
160 "real matrix",
"complex scalar");
176 "real matrix",
"complex scalar");
326 error (
"diag: expecting vector argument");
330 return mat.
diag (m, n);
456 ::warning (
"range error for conversion to character value");
461 chm(
i) =
static_cast<char> (ival);
478 os <<
"# ndims: " <<
dv.
ndims () <<
"\n";
489 os <<
"# rows: " <<
rows () <<
"\n" 490 <<
"# columns: " <<
columns () <<
"\n";
503 keywords[0] =
"ndims";
504 keywords[1] =
"rows";
510 error (
"load: failed to extract number of rows and columns");
514 int mdims =
static_cast<int> (
val);
517 error (
"load: failed to extract number of dimensions");
522 for (
int i = 0;
i < mdims;
i++)
526 error (
"load: failed to read dimensions");
533 error (
"load: failed to load matrix constant");
537 else if (kw ==
"rows")
543 error (
"load: failed to extract number of rows and columns");
545 if (nr > 0 && nc > 0)
550 error (
"load: failed to load matrix constant");
554 else if (nr == 0 || nc == 0)
575 os.
write (reinterpret_cast<char *> (&
tmp), 4);
579 os.
write (reinterpret_cast<char *> (&
tmp), 4);
588 warning (
"save: some values too large to save as floats --");
589 warning (
"save: saving as doubles instead");
596 double max_val, min_val;
601 const double *mtmp = m.
data ();
613 if (!
is.read (reinterpret_cast<char *> (&mdims), 4))
624 for (
int i = 0;
i < mdims;
i++)
626 if (!
is.read (reinterpret_cast<char *> (&di), 4))
645 if (!
is.read (reinterpret_cast<char *> (&
tmp), 1))
662 if (!
is.read (reinterpret_cast<char *> (&nc), 4))
666 if (!
is.read (reinterpret_cast<char *> (&
tmp), 1))
687 #if defined (HAVE_HDF5) 695 hid_t space_hid, data_hid;
696 space_hid = data_hid = -1;
702 for (
int i = 0;
i < rank;
i++)
703 hdims[
i] =
dv(rank-
i-1);
705 space_hid = H5Screate_simple (rank, hdims,
nullptr);
707 if (space_hid < 0)
return false;
709 hid_t save_type_hid = H5T_NATIVE_DOUBLE;
715 warning (
"save: some values too large to save as floats --");
716 warning (
"save: saving as doubles instead");
719 save_type_hid = H5T_NATIVE_FLOAT;
721 #if defined (HAVE_HDF5_INT2FLOAT_CONVERSIONS) 725 double max_val, min_val;
733 #if defined (HAVE_HDF5_18) 734 data_hid = H5Dcreate (loc_id,
name, save_type_hid, space_hid,
737 data_hid = H5Dcreate (loc_id,
name, save_type_hid, space_hid,
742 H5Sclose (space_hid);
751 H5Sclose (space_hid);
754 octave_unused_parameter (loc_id);
755 octave_unused_parameter (
name);
769 #if defined (HAVE_HDF5) 778 #if defined (HAVE_HDF5_18) 781 hid_t data_hid = H5Dopen (loc_id,
name);
783 hid_t space_id = H5Dget_space (data_hid);
785 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
797 H5Sget_simple_extent_dims (space_id, hdims, maxdims);
809 for (hsize_t
i = 0, j = rank - 1;
i < rank;
i++, j--)
826 octave_unused_parameter (loc_id);
827 octave_unused_parameter (
name);
837 bool pr_as_read_syntax)
const 848 double *pr =
static_cast<double *
> (
retval->get_data ());
874 if (
tmp.imag () == 0.0)
912 #define ARRAY_METHOD_MAPPER(UMAP, FCN) \ 913 case umap_ ## UMAP: \ 914 return octave_value (matrix.FCN ()) 921 #define ARRAY_MAPPER(UMAP, TYPE, FCN) \ 922 case umap_ ## UMAP: \ 923 return octave_value (matrix.map<TYPE> (FCN)) 925 #define RC_ARRAY_MAPPER(UMAP, TYPE, FCN) \ 926 case umap_ ## UMAP: \ 927 return do_rc_map (matrix, FCN) 988 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
Complex complex_value(bool=false) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
octave_value map(octave_base_value::unary_mapper_t umap) const
Matrix matrix_value(bool=false) const
Complex rc_log10(double x)
intNDArray< octave_int64 > int64NDArray
octave_value convert_to_str_internal(bool pad, bool force, char type) const
const T * data(void) const
octave_value reshape(const dim_vector &new_dims) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
octave_idx_type extent(octave_idx_type n) 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
octave_value as_double(void) const
identity matrix If supplied two scalar respectively For allows like xample val
const octave_hdf5_id octave_H5S_ALL
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
intNDArray< octave_uint32 > uint32NDArray
octave_value as_int64(void) const
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
static octave_value do_rc_map(const NDArray &a, Complex(&fcn)(double))
save_type get_save_type(double, double)
Array< T > squeeze(void) const
Chop off leading singleton dimensions.
intNDArray< octave_uint8 > uint8NDArray
ComplexNDArray complex_array_value(bool=false) const
FloatComplex float_complex_value(bool=false) const
intNDArray< octave_uint16 > uint16NDArray
octave_value squeeze(void) const
void resize(int n, int fill_value=0)
const T * fortran_vec(void) const
octave_value as_uint32(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)
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
std::complex< T > ceil(const std::complex< T > &x)
void error(const char *fmt,...)
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
std::complex< T > floor(const std::complex< T > &x)
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
static octave_base_value * default_numeric_demotion_function(const octave_base_value &a)
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)
FloatComplexNDArray float_complex_array_value(bool=false) const
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
Ordering is auto-detected or can be specified.
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)
NDArray array_value(bool=false) const
Complex atan(const Complex &x)
intNDArray< octave_int16 > int16NDArray
float float_value(bool=false) const
bool too_large_for_float(void) const
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
Complex asin(const Complex &x)
void err_nan_to_logical_conversion(void)
octave_value as_uint64(void) const
#define RC_ARRAY_MAPPER(UMAP, TYPE, FCN)
Complex log2(const Complex &x)
octave_value as_single(void) const
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
double double_value(bool=false) const
mxArray * as_mxArray(void) const
void warn_load(const char *type) const
Array< T > reshape(octave_idx_type nr, octave_idx_type nc) 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)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
SparseMatrix sparse_matrix_value(bool=false) const
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
octave_base_value * try_narrowing_conversion(void)
octave_value squeeze(void) const
Complex expm1(const Complex &x)
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
Matrix diag(octave_idx_type k=0) const
void swap_bytes< 4 >(void *ptr)
MArray< T > reshape(const dim_vector &new_dims) const
sortmode issorted(sortmode mode=UNSORTED) const
Ordering is auto-detected or can be specified.
virtual octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
octave_value diag(octave_idx_type k=0) const
intNDArray< octave_int8 > int8NDArray
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)
sortmode issorted(sortmode mode=UNSORTED) const
Complex log1p(const Complex &x)
octave_idx_type rows(void) const
octave_value as_uint8(void) const
ComplexMatrix complex_matrix_value(bool=false) const
octave_value as_int16(void) const
bool all_integers(double &max_val, double &min_val) const
Complex rc_log2(double x)
void resize(const dim_vector &dv, const T &rfv)
Resizing (with fill).
sortmode issorted(sortmode mode=UNSORTED) const
octave_hdf5_id save_type_to_hdf5(save_type st)
#define panic_impossible()
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
std::complex< double > erfcx(std::complex< double > z, double relerr=0)
bool save_ascii(std::ostream &os)
void warn_save(const char *type) const
octave_value map(unary_mapper_t umap) const
octave_value reshape(const dim_vector &new_dims) const
octave_value as_uint16(void) const
Complex erf(const Complex &x)
float lo_ieee_float_nan_value(void)
type_conv_info numeric_demotion_function(void) const
friend class octave_value
Complex rc_acos(double x)
void warning(const char *fmt,...)
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
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)
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
bool any_element_not_one_or_zero(void) const
octave_value as_int8(void) const
bool save_binary(std::ostream &os, bool &save_as_floats)
dim_vector dims(void) const
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Complex rc_asin(double x)
FloatMatrix float_matrix_value(bool=false) const
Complex rc_log1p(double x)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
octave_idx_type numel(void) const
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
FloatNDArray float_array_value(bool=false) const
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
static int static_type_id(void)
const octave_hdf5_id octave_H5P_DEFAULT
octave_idx_type columns(void) const
std::complex< float > FloatComplex
#define ARRAY_MAPPER(UMAP, TYPE, FCN)
octave_idx_type ndims(void) const
Number of dimensions.
std::complex< double > Complex
bool load_ascii(std::istream &is)
charNDArray char_array_value(bool=false) const
Array< octave_idx_type > as_array(void) const
octave_idx_type numel(void) const
Number of elements in the array.
#define ARRAY_METHOD_MAPPER(UMAP, FCN)
write the output to stdout if nargout is
void err_nan_to_character_conversion(void)
Vector representing the dimensions (size) of an Array.
octave_value diag(octave_idx_type k=0) 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
boolNDArray bool_array_value(bool warn=false) const
bool any_element_is_nan(void) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
NDArray squeeze(void) const
octave_value as_int32(void) const
intNDArray< octave_uint64 > uint64NDArray
std::complex< double > erfc(std::complex< double > z, double relerr=0)