26#if defined (HAVE_CONFIG_H)
78 return tmp.
index_op (idx, resize_ok);
107 return static_cast<double> (
scalar);
175 if (octave::math::isnan (
scalar))
176 octave::err_nan_to_character_conversion ();
178 int ival = octave::math::nint (
scalar);
180 if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ())
186 ::warning (
"range error for conversion to character value");
189 retval =
octave_value (std::string (1,
static_cast<char> (ival)), type);
199 octave::write_value<float> (os,
d);
209 scalar = octave::read_value<float> (is);
211 error (
"load: failed to load scalar constant");
220 os.write (
reinterpret_cast<char *
> (&tmp), 1);
222 os.write (
reinterpret_cast<char *
> (&dtmp), 4);
229 octave::mach_info::float_format fmt)
232 if (! is.read (
reinterpret_cast<char *
> (&tmp), 1))
251#if defined (HAVE_HDF5)
253 hsize_t dimens[3] = {0};
254 hid_t space_hid, data_hid;
255 space_hid = data_hid = -1;
257 space_hid = H5Screate_simple (0, dimens,
nullptr);
258 if (space_hid < 0)
return false;
259#if defined (HAVE_HDF5_18)
260 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_FLOAT, space_hid,
264 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_FLOAT, space_hid,
269 H5Sclose (space_hid);
278 H5Sclose (space_hid);
281 octave_unused_parameter (loc_id);
282 octave_unused_parameter (name);
293#if defined (HAVE_HDF5)
295#if defined (HAVE_HDF5_18)
298 hid_t data_hid = H5Dopen (loc_id, name);
300 hid_t space_id = H5Dget_space (data_hid);
302 hsize_t rank = H5Sget_simple_extent_ndims (space_id);
325 octave_unused_parameter (loc_id);
326 octave_unused_parameter (name);
337 mxArray *retval =
new mxArray (interleaved, mxSINGLE_CLASS, 1, 1, mxREAL);
339 mxSingle *pd =
static_cast<mxSingle *
> (retval->
get_data ());
358#define SCALAR_MAPPER(UMAP, FCN) \
359 case umap_ ## UMAP: \
360 return octave_value (FCN (scalar))
425 return str_conv.
map (umap);
441 *(
reinterpret_cast<float *
> (where)) =
scalar;
N Dimensional Array with copy-on-write semantics.
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.
virtual octave_value map(unary_mapper_t) const
virtual octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
void warn_load(const char *type) const
friend class octave_value
void warn_save(const char *type) const
octave_value as_uint8() const
bool save_ascii(std::ostream &os)
octave_value as_int16() const
octave_value as_int64() const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
bool fast_elem_insert_self(void *where, builtin_type_t btyp) const
mxArray * as_mxArray(bool interleaved) const
octave_value as_uint32() const
octave_value as_uint64() const
octave_value convert_to_str_internal(bool pad, bool force, char type) const
octave_value diag(octave_idx_type m, octave_idx_type n) const
octave_value as_int8() const
octave_value as_single() const
float float_value(bool=false) const
octave_value resize(const dim_vector &dv, bool fill=false) const
octave_value map(unary_mapper_t umap) const
octave_value as_double() const
octave_value as_uint16() const
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
octave_value as_int32() const
FloatMatrix float_matrix_value(bool=false) 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)
bool load_ascii(std::istream &is)
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
octave_value index_op(const octave_value_list &idx, bool resize_ok=false)
octave_value map(octave_base_value::unary_mapper_t umap) const
const octave_hdf5_id octave_H5P_DEFAULT
const octave_hdf5_id octave_H5S_ALL
void read_floats(std::istream &is, float *data, save_type type, octave_idx_type len, bool swap, octave::mach_info::float_format fmt)
void warning(const char *fmt,...)
void error(const char *fmt,...)
Complex log2(const Complex &x)
Complex asin(const Complex &x)
Complex acos(const Complex &x)
std::complex< T > ceil(const std::complex< T > &x)
Complex atan(const Complex &x)
std::complex< T > floor(const std::complex< T > &x)
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
Complex erf(const Complex &x)
Complex expm1(const Complex &x)
Complex log1p(const Complex &x)
Complex erfc(const Complex &x)
std::complex< float > FloatComplex
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)
#define SCALAR_MAPPER(UMAP, FCN)
template int8_t abs(int8_t)