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);
472 for (
int i = 0;
i < dv.
ndims ();
i++)
475 os.write (reinterpret_cast<char *> (&tmp), 4);
480 if (dv.
numel () > 8192)
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))
557 read_floats (is, re, static_cast<save_type> (tmp), len, swap, fmt);
572 #if defined (HAVE_HDF5)
579 int rank = dv.
ndims ();
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, 0);
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)
862 return str_conv.
map (umap);
octave_value as_uint16(void) const
octave_value as_int32(void) const
octave_value as_int16(void) 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 convert_to_str_internal(bool pad, bool force, char type) const
octave_value as_int64(void) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
octave_idx_type columns(void) const
octave_value diag(octave_idx_type k=0) const
Complex rc_acosh(double x)
Complex rc_sqrt(double x)
NDArray array_value(bool=false) 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
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector d)
intNDArray< octave_uint32 > uint32NDArray
save_type get_save_type(double, double)
intNDArray< octave_uint8 > uint8NDArray
intNDArray< octave_uint16 > uint16NDArray
SparseMatrix sparse_matrix_value(bool=false) const
octave_idx_type numel(void) const
void resize(int n, int fill_value=0)
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)
void error(const char *fmt,...)
FloatMatrix diag(octave_idx_type k=0) const
void * get_data(void) const
octave_value map(octave_base_value::unary_mapper_t umap) const
octave_value diag(octave_idx_type k=0) const
FloatMatrix float_matrix_value(bool=false) const
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
#define ARRAY_METHOD_MAPPER(UMAP, FCN)
#define ARRAY_MAPPER(UMAP, TYPE, FCN)
bool any_element_is_nan(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)
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)
mxArray * as_mxArray(void) const
Complex asin(const Complex &x)
void err_nan_to_logical_conversion(void)
float float_value(bool=false) const
bool is_empty(void) 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.
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
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)
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
void warn_load(const char *type) 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 swap_bytes< 4 >(void *ptr)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Complex atan(const Complex &x)
intNDArray< octave_int8 > int8NDArray
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
ComplexNDArray complex_array_value(bool=false) const
nd deftypefn *octave_map m
bool any_element_not_one_or_zero(void) const
bool save_ascii(std::ostream &os)
const T * data(void) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
Complex rc_log2(double x)
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)
octave_value as_uint8(void) const
octave_value as_double(void) const
bool load_ascii(std::istream &is)
FloatNDArray float_array_value(bool=false) const
boolNDArray bool_array_value(bool warn=false) const
double double_value(bool=false) const
Matrix matrix_value(bool=false) const
float lo_ieee_float_nan_value(void)
void warn_save(const char *type) const
friend class octave_value
Complex rc_acos(double x)
void warning(const char *fmt,...)
octave_value as_int8(void) const
dim_vector dims(void) const
charNDArray max(char d, const charNDArray &m)
intNDArray< octave_int32 > int32NDArray
bool save_binary(std::ostream &os, bool &save_as_floats)
This is a simple wrapper template that will subclass an Array type or any later type derived from ...
void err_invalid_conversion(const std::string &from, const std::string &to)
=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))<
octave_value map(unary_mapper_t umap) 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)
Complex rc_asin(double x)
octave_value as_uint64(void) const
bool all_integers(float &max_val, float &min_val) const
FloatComplex float_complex_value(bool=false) const
octave_value as_uint32(void) const
octave_idx_type ndims(void) const
Number of dimensions.
Complex rc_log1p(double x)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
virtual octave_value map(unary_mapper_t) const
static octave_value do_rc_map(const FloatNDArray &a, FloatComplex(&fcn)(float))
#define RC_ARRAY_MAPPER(UMAP, TYPE, FCN)
const octave_hdf5_id octave_H5P_DEFAULT
ComplexMatrix complex_matrix_value(bool=false) const
std::complex< float > FloatComplex
octave_value as_single(void) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
std::complex< double > Complex
const T * fortran_vec(void) const
charNDArray char_array_value(bool=false) const
static const char *const keywords[]
write the output to stdout if nargout is
void err_nan_to_character_conversion(void)
octave_base_value * try_narrowing_conversion(void)
Vector representing the dimensions (size) of an Array.
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
virtual octave_value convert_to_str(bool pad=false, bool force=false, char type= '\'') 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
Complex complex_value(bool=false) const
octave_idx_type columns(void) const
octave_idx_type rows(void) const
FloatComplexNDArray float_complex_array_value(bool=false) const
intNDArray< octave_uint64 > uint64NDArray
std::complex< double > erfc(std::complex< double > z, double relerr=0)