31 #include "octave-config.h"
118 type_name (),
"real scalar");
120 retval = m_matrix(0).double_value ();
134 type_name (),
"real scalar");
136 retval = m_matrix(0).float_value ();
151 error (
"invalid conversion of %s to Matrix", type_name ().c_str ());
153 retval =
Matrix (dv(0), dv(1));
157 vec[i] = m_matrix(i).double_value ();
168 error (
"invalid conversion of %s to FloatMatrix", type_name ().c_str ());
174 vec[i] = m_matrix(i).float_value ();
185 error (
"invalid conversion of %s to Matrix", type_name ().c_str ());
191 vec[i] =
Complex (m_matrix(i).double_value ());
202 error (
"invalid conversion of %s to FloatMatrix", type_name ().c_str ());
216 NDArray retval (m_matrix.dims ());
220 vec[i] = m_matrix(i).double_value ();
231 vec[i] = m_matrix(i).float_value ();
242 vec[i] =
Complex (m_matrix(i).double_value ());
264 if (warn && m_matrix.any_element_not_one_or_zero ())
269 vec[i] = m_matrix(i).bool_value ();
283 vec[i] = m_matrix(i).char_value ();
301 matrix_ref ().changesign ();
306 return m_idx_cache ? *m_idx_cache
310 int write (octave::stream& os,
int block_size,
313 {
return os.write (m_matrix, block_size, output_type, skip, flt_fmt); }
320 OCTAVE_INT_T::val_type *pd
321 =
static_cast<OCTAVE_INT_T::val_type *
> (retval->
get_data ());
323 mwSize nel =
numel ();
327 for (mwIndex i = 0; i < nel; i++)
328 pd[i] = pdata[i].value ();
338 return m_matrix.
abs ();
340 return m_matrix.
signum ();
374 return save_hdf5_internal (loc_id, s_hdf5_save_type, name, flag);
379 return load_hdf5_internal (loc_id, s_hdf5_save_type, name);
411 bool resize_ok =
false)
427 return tmp.
index_op (idx, resize_ok);
519 {
return scalar.float_value (); }
525 retval(0, 0) =
scalar.double_value ();
533 retval(0, 0) =
scalar.float_value ();
557 retval(0) =
scalar.double_value ();
565 retval(0) =
scalar.float_value ();
590 return scalar.bool_value ();
601 retval(0) =
scalar.bool_value ();
610 retval(0) =
scalar.char_value ();
627 int write (octave::stream& os,
int block_size,
632 block_size, output_type, skip, flt_fmt);
640 OCTAVE_INT_T::val_type *pd
641 =
static_cast<OCTAVE_INT_T::val_type *
> (retval->
get_data ());
687 return save_hdf5_internal (loc_id, s_hdf5_save_type, name, flag);
692 return load_hdf5_internal (loc_id, s_hdf5_save_type, name);
N Dimensional Array with copy-on-write semantics.
OCTARRAY_API T * fortran_vec(void)
Size of the specified dimension.
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.
octave_idx_type ndims(void) const
Number of dimensions.
void * get_data(void) const
octave::idx_vector index_vector(bool=false) const
builtin_type_t builtin_type(void) const
mxArray * as_mxArray(bool interleaved) const
double double_value(bool=false) const
float float_value(bool=false) const
int64NDArray int64_array_value(void) const
static octave_hdf5_id s_hdf5_save_type
uint16NDArray uint16_array_value(void) const
FloatMatrix float_matrix_value(bool=false) const
octave_value map(unary_mapper_t umap) const
boolNDArray bool_array_value(bool warn=false) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
uint64NDArray uint64_array_value(void) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
float float_scalar_value(bool=false) const
FloatNDArray float_array_value(bool=false) const
octave_base_value * empty_clone(void) const
bool isinteger(void) const
Matrix matrix_value(bool=false) const
int write(octave::stream &os, int block_size, oct_data_conv::data_type output_type, int skip, octave::mach_info::float_format flt_fmt) const
FloatComplexNDArray float_complex_array_value(bool=false) const
ComplexNDArray complex_array_value(bool=false) const
uint8NDArray uint8_array_value(void) const
NDArray array_value(bool=false) const
int16NDArray int16_array_value(void) const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
uint32NDArray uint32_array_value(void) const
charNDArray char_array_value(bool=false) const
octave_base_value * clone(void) const
ComplexMatrix complex_matrix_value(bool=false) const
int8NDArray int8_array_value(void) const
int32NDArray int32_array_value(void) const
double scalar_value(bool=false) const
Matrix matrix_value(bool=false) const
static octave_hdf5_id s_hdf5_save_type
octave_uint32 uint32_scalar_value(void) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
int8NDArray int8_array_value(void) const
FloatNDArray float_array_value(bool=false) const
int32NDArray int32_array_value(void) const
uint64NDArray uint64_array_value(void) const
octave_base_value * empty_clone(void) const
bool bool_value(bool warn=false) const
FloatMatrix float_matrix_value(bool=false) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
int64NDArray int64_array_value(void) const
uint8NDArray uint8_array_value(void) const
octave_int8 int8_scalar_value(void) const
NDArray array_value(bool=false) const
ComplexNDArray complex_array_value(bool=false) const
int write(octave::stream &os, int block_size, oct_data_conv::data_type output_type, int skip, octave::mach_info::float_format flt_fmt) const
octave_uint16 uint16_scalar_value(void) const
float float_value(bool=false) const
double double_value(bool=false) const
mxArray * as_mxArray(bool interleaved) const
ComplexMatrix complex_matrix_value(bool=false) const
octave::idx_vector index_vector(bool=false) const
octave_base_value * clone(void) const
FloatComplexNDArray float_complex_array_value(bool=false) const
double scalar_value(bool=false) const
FloatComplexMatrix float_complex_matrix_value(bool=false) const
octave_uint8 uint8_scalar_value(void) const
octave_int64 int64_scalar_value(void) const
builtin_type_t builtin_type(void) const
int16NDArray int16_array_value(void) const
uint32NDArray uint32_array_value(void) const
float float_scalar_value(bool=false) const
octave_value map(unary_mapper_t umap) const
octave_uint64 uint64_scalar_value(void) const
bool isinteger(void) const
uint16NDArray uint16_array_value(void) const
octave_value resize(const dim_vector &dv, bool fill=false) const
octave_int32 int32_scalar_value(void) const
octave_int16 int16_scalar_value(void) const
charNDArray char_array_value(bool=false) const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
boolNDArray bool_array_value(bool warn=false) const
octave_value signum(void) const
octave_value index_op(const octave_value_list &idx, bool resize_ok=false)
octave_value abs(void) const
void error(const char *fmt,...)
void err_invalid_conversion(const std::string &from, const std::string &to)
void warn_logical_conversion(void)
void warn_implicit_conversion(const char *id, const char *from, const char *to)
octave::idx_vector idx_vector
intNDArray< octave_int16 > int16NDArray
intNDArray< octave_int32 > int32NDArray
intNDArray< octave_int64 > int64NDArray
intNDArray< octave_int8 > int8NDArray
class OCTAVE_API boolNDArray
class OCTAVE_API ComplexMatrix
class OCTAVE_API FloatComplexMatrix
class OCTAVE_API FloatMatrix
std::complex< double > Complex
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
T::size_type numel(const T &str)
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
#define OCTAVE_INT_MX_CLASS
#define OCTAVE_TYPE_PREDICATE_FUNCTION
#define OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION
#define OCTAVE_VALUE_INT_MATRIX_T
#define OCTAVE_VALUE_INT_SCALAR_T
static bool scalar(const dim_vector &dims)
intNDArray< octave_uint16 > uint16NDArray
intNDArray< octave_uint32 > uint32NDArray
intNDArray< octave_uint64 > uint64NDArray
intNDArray< octave_uint8 > uint8NDArray