110 s[0] =
static_cast<char> (
scalar);
130 scalar = (octave_read_value<double> (is) != 0.);
134 error (
"load: failed to load scalar constant");
144 char tmp = (
scalar ? 1 : 0);
145 os.write (reinterpret_cast<char *> (&tmp), 1);
155 if (! is.read (reinterpret_cast<char *> (&tmp), 1))
167 #if defined (HAVE_HDF5)
170 hid_t space_hid, data_hid;
171 space_hid = data_hid = -1;
173 space_hid = H5Screate_simple (0, dimens, 0);
174 if (space_hid < 0)
return false;
176 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid,
177 H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
179 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid,
184 H5Sclose (space_hid);
189 retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL,
190 H5P_DEFAULT, &tmp) >= 0;
193 H5Sclose (space_hid);
205 #if defined (HAVE_HDF5)
208 hid_t data_hid = H5Dopen (loc_id, name, H5P_DEFAULT);
210 hid_t data_hid = H5Dopen (loc_id, name);
212 hid_t space_id = H5Dget_space (data_hid);
214 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
223 if (H5Dread (data_hid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL,
224 H5P_DEFAULT, &dtmp) < 0)
246 bool *pr =
static_cast<bool *
> (retval->
get_data ());
void octave_write_double(std::ostream &os, double d)
type_conv_info numeric_conversion_function(void) const
bool load_ascii(std::istream &is)
void gripe_load(const char *type) const
void error(const char *fmt,...)
double double_value(bool=false) const
void * get_data(void) const
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
void gripe_save(const char *type) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
bool load_binary(std::istream &is, bool swap, oct_mach_info::float_format fmt)
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
F77_RET_T const double const double double * d
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
bool save_binary(std::ostream &os, bool &save_as_floats)
mxArray * as_mxArray(void) const
octave_value convert_to_str_internal(bool pad, bool force, char type) const
static octave_base_value * default_numeric_conversion_function(const octave_base_value &a)
friend class octave_value
boolMatrix bool_matrix_value(bool=false) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
bool save_ascii(std::ostream &os)
static int static_type_id(void)
octave_value resize(const dim_vector &dv, bool fill=false) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)