24 #if defined (HAVE_CONFIG_H) 68 "bool matrix",
"logical");
97 if (nr == 1 && nc == 1)
111 "bool matrix",
"real scalar");
123 "bool matrix",
"real scalar");
135 "bool matrix",
"complex scalar");
151 "bool matrix",
"complex scalar");
163 return tmp.convert_to_str (pad, force,
type);
228 bool pr_as_read_syntax)
const 241 os <<
"# ndims: " <<
dv.
ndims () <<
"\n";
252 os <<
"# rows: " <<
rows () <<
"\n" 253 <<
"# columns: " <<
columns () <<
"\n";
268 keywords[0] =
"ndims";
269 keywords[1] =
"rows";
275 error (
"load: failed to extract number of rows and columns");
279 int mdims =
static_cast<int> (
val);
282 error (
"load: failed to extract number of dimensions");
287 for (
int i = 0;
i < mdims;
i++)
291 error (
"load: failed to extract dimensions");
303 error (
"load: failed to load matrix constant");
311 else if (kw ==
"rows")
317 error (
"load: failed to extract number of rows and columns");
319 if (nr > 0 && nc > 0)
324 error (
"load: failed to load matrix constant");
329 btmp.
elem (
i,j) = (
tmp.elem (
i, j) != 0.);
333 else if (nr == 0 || nc == 0)
354 os.
write (reinterpret_cast<char *> (&
tmp), 4);
358 os.
write (reinterpret_cast<char *> (&
tmp), 4);
367 htmp[
i] = (mtmp[
i] ? 1 : 0);
379 if (!
is.read (reinterpret_cast<char *> (&mdims), 4))
394 for (
int i = 0;
i < mdims;
i++)
396 if (!
is.read (reinterpret_cast<char *> (&di), 4))
417 if (!
is.read (htmp, nel))
422 mtmp[
i] = (htmp[
i] ? 1 : 0);
434 #if defined (HAVE_HDF5) 442 hid_t space_hid, data_hid;
443 space_hid = data_hid = -1;
449 for (
int i = 0;
i < rank;
i++)
450 hdims[
i] =
dv(rank-
i-1);
452 space_hid = H5Screate_simple (rank, hdims,
nullptr);
453 if (space_hid < 0)
return false;
454 #if defined (HAVE_HDF5_18) 455 data_hid = H5Dcreate (loc_id,
name, H5T_NATIVE_HBOOL, space_hid,
458 data_hid = H5Dcreate (loc_id,
name, H5T_NATIVE_HBOOL, space_hid,
463 H5Sclose (space_hid);
478 H5Sclose (space_hid);
481 octave_unused_parameter (loc_id);
482 octave_unused_parameter (
name);
495 #if defined (HAVE_HDF5) 504 #if defined (HAVE_HDF5_18) 507 hid_t data_hid = H5Dopen (loc_id,
name);
509 hid_t space_id = H5Dget_space (data_hid);
511 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
522 H5Sget_simple_extent_dims (space_id, hdims, maxdims);
534 for (hsize_t
i = 0, j = rank - 1;
i < rank;
i++, j--)
556 octave_unused_parameter (loc_id);
557 octave_unused_parameter (
name);
570 bool *pr =
static_cast<bool *
> (
retval->get_data ());
582 DEFUN (logical, args, ,
596 if (args.length () != 1)
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
static octave_base_value * default_numeric_conversion_function(const octave_base_value &a)
octave_value as_int64(void) const
intNDArray< octave_int64 > int64NDArray
const T * data(void) const
bool islogical(void) const
OCTINTERP_API void print_usage(void)
int current_print_indent_level(void) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
octave_value as_uint64(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
Complex 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
FloatComplex float_complex_value(bool=false) const
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
#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)
intNDArray< octave_int16 > int16NDArray
octave_value as_int8(void) const
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
float float_value(bool=false) const
void warn_load(const char *type) const
octave_idx_type cols(void) const
octave_value as_uint8(void) 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
bool bool_value(bool warn=false) const
octave_value as_int16(void) 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
void swap_bytes< 4 >(void *ptr)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
intNDArray< octave_int8 > int8NDArray
octave_value convert_to_str_internal(bool pad, bool force, char type) const
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
octave_idx_type rows(void) const
static int static_type_id(void)
octave_value as_int32(void) const
bool save_binary(std::ostream &os, bool &save_as_floats)
void resize(const dim_vector &dv, const T &rfv)
Resizing (with fill).
bool issparse(void) const
#define panic_impossible()
mxArray * as_mxArray(void) const
void warn_save(const char *type) const
double double_value(bool=false) const
octave_value as_double(void) const
octave_value as_uint16(void) const
float lo_ieee_float_nan_value(void)
void err_wrong_type_arg(const char *name, const char *s)
friend class octave_value
bool save_ascii(std::ostream &os)
int save_hdf5_empty(octave_hdf5_id loc_id, const char *name, const dim_vector &d)
intNDArray< octave_int32 > int32NDArray
boolNDArray bool_array_value(bool warn=false) const
void err_invalid_conversion(const std::string &from, const std::string &to)
octave_value as_uint32(void) const
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
octave_base_value * try_narrowing_conversion(void)
dim_vector dims(void) const
Matrix matrix_value(bool=false) const
void warn_implicit_conversion(const char *id, const char *from, const char *to)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
octave_idx_type numel(void) const
SparseBoolMatrix sparse_bool_matrix_value(bool warn=false) const
const octave_hdf5_id octave_H5P_DEFAULT
octave_idx_type columns(void) const
std::complex< float > FloatComplex
octave_idx_type ndims(void) const
Number of dimensions.
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
std::complex< double > Complex
octave_idx_type numel(void) const
Number of elements in the array.
octave_value as_single(void) const
write the output to stdout if nargout is
Vector representing the dimensions (size) of an Array.
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
type_conv_info numeric_conversion_function(void) const
bool is_scalar_type(void) const
bool isnumeric(void) const
boolNDArray bool_array_value(bool=false) const
NDArray array_value(bool=false) const
intNDArray< octave_uint64 > uint64NDArray
bool load_ascii(std::istream &is)