26 #if defined (HAVE_CONFIG_H)
64 if (
numel () == 1 && *p ==
':')
77 "character matrix",
"real scalar");
79 return static_cast<unsigned char> (
m_matrix(0, 0));
89 "character matrix",
"real scalar");
91 return static_cast<unsigned char> (
m_matrix(0, 0));
103 "character matrix",
"int64 scalar");
119 "character matrix",
"uint64 scalar");
133 "character matrix",
"complex scalar");
149 "character matrix",
"complex scalar");
151 retval =
static_cast<unsigned char> (
m_matrix(0, 0));
218 bool pr_as_read_syntax)
const
235 for (
mwIndex i = 0; i < nel; i++)
249 #if defined (HAVE_ISASCII)
252 return (c >= 0x00 && c <= 0x7f);
263 #define STRING_MAPPER(UMAP,FCN,TYPE) \
264 case umap_ ## UMAP: \
265 return octave_value (m_matrix.map<TYPE, int (&) (int)> (FCN))
269 #define STRING_U8_MAPPER(UMAP,FCN) \
270 case umap_ ## UMAP: \
272 charNDArray in_m = m_matrix; \
273 Array<octave_idx_type> p (dim_vector (m_matrix.ndims (), 1)); \
274 if (m_matrix.ndims () > 1) \
276 for (octave_idx_type i=0; i < m_matrix.ndims (); i++) \
280 in_m = m_matrix.permute (p); \
282 boolNDArray b_array = boolNDArray (in_m.dims ()); \
283 const uint8_t *in = reinterpret_cast<const uint8_t *> (in_m.data ()); \
285 for (octave_idx_type i = 0; i < in_m.numel (); ) \
287 int mblen = octave_u8_strmbtouc_wrapper (&uc, in + i); \
290 bool is_upper = FCN (uc); \
291 for (int j = 0; j < mblen; j++) \
292 b_array(i+j) = is_upper; \
295 return octave_value ((m_matrix.ndims () > 1) ? b_array.permute (p, true) \
311 #define STRING_U8_FCN(UMAP,U8_FCN,STD_FCN) \
312 case umap_ ## UMAP: \
314 charNDArray in_m = m_matrix; \
315 Array<octave_idx_type> p (dim_vector (m_matrix.ndims (), 1)); \
316 if (m_matrix.ndims () > 1) \
318 for (octave_idx_type i=0; i < m_matrix.ndims (); i++) \
322 in_m = m_matrix.permute (p); \
324 std::size_t output_length = in_m.numel (); \
325 charNDArray ch_array = charNDArray (in_m.dims ()); \
326 const uint8_t *in = reinterpret_cast<const uint8_t *> (in_m.data ()); \
327 uint8_t *buf = reinterpret_cast<uint8_t *> (ch_array.fortran_vec ()); \
328 U8_FCN (in, m_matrix.numel (), nullptr, buf, &output_length); \
329 if (output_length != static_cast<std::size_t> (m_matrix.numel ())) \
331 warning_with_id ("Octave:multi_byte_char_length", \
332 "UMAP: Possible multi-byte error."); \
333 return octave_value (m_matrix.map<char, int (&) (int)> (STD_FCN)); \
335 return octave_value ((m_matrix.ndims () > 1) ? ch_array.permute (p, true)\
const T * data() const
Size of the specified dimension.
octave_idx_type numel() const
octave_idx_type rows() const
octave_idx_type columns() const
int current_print_indent_level() const
static const char * get_umap_name(unary_mapper_t)
octave_value as_single() const
octave_value as_uint64() const
octave::idx_vector index_vector(bool require_integers=false) const
octave_value as_int8() const
octave_uint64 uint64_scalar_value() const
octave_value as_int16() const
float float_value(bool=false) const
Complex complex_value(bool=false) const
mxArray * as_mxArray(bool interleaved) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
octave_value map(unary_mapper_t umap) const
octave_value as_int32() const
octave_int64 int64_scalar_value() const
FloatComplex float_complex_value(bool=false) const
octave_value as_double() const
octave_value as_uint16() const
octave_value as_int64() const
octave_value as_uint8() const
octave_value as_uint32() const
NDArray array_value(bool=false) const
double double_value(bool=false) const
void() error(const char *fmt,...)
void err_invalid_conversion(const std::string &from, const std::string &to)
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
float lo_ieee_float_nan_value()
std::complex< double > Complex
std::complex< float > FloatComplex
octave_int< int64_t > octave_int64
octave_int< uint64_t > octave_uint64
#define STRING_U8_FCN(UMAP, U8_FCN, STD_FCN)
#define STRING_U8_MAPPER(UMAP, FCN)
#define STRING_MAPPER(UMAP, FCN, TYPE)
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)
intNDArray< octave_uint16 > uint16NDArray
intNDArray< octave_uint32 > uint32NDArray
intNDArray< octave_uint64 > uint64NDArray
intNDArray< octave_uint8 > uint8NDArray
uint8_t * octave_u8_toupper_wrapper(const uint8_t *s, size_t n, const char *iso639_language, uint8_t *resultbuf, size_t *lengthp)
uint8_t * octave_u8_tolower_wrapper(const uint8_t *s, size_t n, const char *iso639_language, uint8_t *resultbuf, size_t *lengthp)
bool octave_uc_is_upper_wrapper(ucs4_t uc)
bool octave_uc_is_digit_wrapper(ucs4_t uc)
bool octave_uc_is_lower_wrapper(ucs4_t uc)
bool octave_uc_is_print_wrapper(ucs4_t uc)
bool octave_uc_is_alnum_wrapper(ucs4_t uc)
bool octave_uc_is_space_wrapper(ucs4_t uc)
bool octave_uc_is_cntrl_wrapper(ucs4_t uc)
bool octave_uc_is_xdigit_wrapper(ucs4_t uc)
bool octave_uc_is_alpha_wrapper(ucs4_t uc)
bool octave_uc_is_graph_wrapper(ucs4_t uc)
bool octave_uc_is_punct_wrapper(ucs4_t uc)