26 #if defined (HAVE_CONFIG_H)
94 return tmp.
index_op (idx, resize_ok);
100 return static_cast<double> (
scalar);
106 return static_cast<float> (
scalar);
180 s[0] =
static_cast<char> (
scalar);
191 octave::write_value<double> (os,
d);
200 scalar = (octave::read_value<double> (is) != 0.0);
203 error (
"load: failed to load scalar constant");
211 char tmp = (
scalar ? 1 : 0);
212 os.write (
reinterpret_cast<char *
> (&tmp), 1);
222 if (! is.read (
reinterpret_cast<char *
> (&tmp), 1))
234 #if defined (HAVE_HDF5)
236 hsize_t dimens[3] = {0};
237 hid_t space_hid, data_hid;
238 space_hid = data_hid = -1;
240 space_hid = H5Screate_simple (0, dimens,
nullptr);
241 if (space_hid < 0)
return false;
242 #if defined (HAVE_HDF5_18)
243 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid,
247 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid,
252 H5Sclose (space_hid);
261 H5Sclose (space_hid);
264 octave_unused_parameter (loc_id);
265 octave_unused_parameter (name);
276 #if defined (HAVE_HDF5)
278 #if defined (HAVE_HDF5_18)
281 hid_t data_hid = H5Dopen (loc_id, name);
283 hid_t space_id = H5Dget_space (data_hid);
285 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
306 octave_unused_parameter (loc_id);
307 octave_unused_parameter (name);
318 mxArray *retval =
new mxArray (interleaved, mxLOGICAL_CLASS, 1, 1, mxREAL);
320 mxLogical *pd =
static_cast<mxLogical *
> (retval->
get_data ());
Vector representing the dimensions (size) of an Array.
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
void * get_data(void) const
OCTINTERP_API void warn_load(const char *type) const
friend class octave_value
OCTINTERP_API void warn_save(const char *type) const
octave_value as_uint8(void) const
octave_value convert_to_str_internal(bool pad, bool force, char type) const
octave_value as_int32(void) const
octave_value as_single(void) const
boolMatrix bool_matrix_value(bool=false) const
octave_value as_uint64(void) const
double double_value(bool=false) const
bool load_ascii(std::istream &is)
octave_value as_int8(void) const
octave_value as_double(void) const
bool bool_value(bool=false) const
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
octave_value resize(const dim_vector &dv, bool fill=false) const
octave_value as_int16(void) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
octave_value as_int64(void) const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
octave_value as_uint16(void) const
bool save_ascii(std::ostream &os)
type_conv_info numeric_conversion_function(void) const
octave_value as_uint32(void) const
bool save_binary(std::ostream &os, bool save_as_floats)
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
mxArray * as_mxArray(bool interleaved) const
static int static_type_id(void)
octave_value index_op(const octave_value_list &idx, bool resize_ok=false)
const octave_hdf5_id octave_H5P_DEFAULT
const octave_hdf5_id octave_H5S_ALL
void error(const char *fmt,...)
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
octave_int< uint32_t > octave_uint32
octave_int< int32_t > octave_int32
octave_int< int16_t > octave_int16
octave_int< int8_t > octave_int8
octave_int< int64_t > octave_int64
octave_int< uint64_t > octave_uint64
octave_int< uint16_t > octave_uint16
octave_int< uint8_t > octave_uint8
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
static octave_base_value * default_numeric_conversion_function(const octave_base_value &a)