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
229 mxChar *pd =
static_cast<mxChar *
> (retval->
get_data ());
231 mwSize nel =
numel ();
235 for (mwIndex i = 0; i < nel; i++)
248 #if defined (HAVE_ISASCII)
251 return (c >= 0x00 && c <= 0x7f);
262 #define STRING_MAPPER(UMAP,FCN,TYPE) \
263 case umap_ ## UMAP: \
264 return octave_value (m_matrix.map<TYPE, int (&) (int)> (FCN))
268 #define STRING_U8_MAPPER(UMAP,FCN) \
269 case umap_ ## UMAP: \
271 charNDArray in_m = m_matrix; \
272 Array<octave_idx_type> p (dim_vector (m_matrix.ndims (), 1)); \
273 if (m_matrix.ndims () > 1) \
275 for (octave_idx_type i=0; i < m_matrix.ndims (); i++) \
279 in_m = m_matrix.permute (p); \
281 boolNDArray b_array = boolNDArray (in_m.dims ()); \
282 const uint8_t *in = reinterpret_cast<const uint8_t *> (in_m.data ()); \
284 for (octave_idx_type i = 0; i < in_m.numel (); ) \
286 int mblen = octave_u8_strmbtouc_wrapper (&uc, in + i); \
289 bool is_upper = FCN (uc); \
290 for (int j = 0; j < mblen; j++) \
291 b_array(i+j) = is_upper; \
294 return octave_value ((m_matrix.ndims () > 1) ? b_array.permute (p, true) \
310 #define STRING_U8_FCN(UMAP,U8_FCN,STD_FCN) \
311 case umap_ ## UMAP: \
313 charNDArray in_m = m_matrix; \
314 Array<octave_idx_type> p (dim_vector (m_matrix.ndims (), 1)); \
315 if (m_matrix.ndims () > 1) \
317 for (octave_idx_type i=0; i < m_matrix.ndims (); i++) \
321 in_m = m_matrix.permute (p); \
323 std::size_t output_length = in_m.numel (); \
324 charNDArray ch_array = charNDArray (in_m.dims ()); \
325 const uint8_t *in = reinterpret_cast<const uint8_t *> (in_m.data ()); \
326 uint8_t *buf = reinterpret_cast<uint8_t *> (ch_array.fortran_vec ()); \
327 U8_FCN (in, m_matrix.numel (), nullptr, buf, &output_length); \
328 if (output_length != static_cast<std::size_t> (m_matrix.numel ())) \
330 warning_with_id ("Octave:multi_byte_char_length", \
331 "UMAP: Possible multi-byte error."); \
332 return octave_value (m_matrix.map<char, int (&) (int)> (STD_FCN)); \
334 return octave_value ((m_matrix.ndims () > 1) ? ch_array.permute (p, true)\
OCTARRAY_OVERRIDABLE_FUNC_API const T * data(void) const
Size of the specified dimension.
void * get_data(void) const
octave_idx_type numel(void) const
dim_vector dims(void) const
octave_idx_type columns(void) const
int current_print_indent_level(void) const
static OCTINTERP_API const char * get_umap_name(unary_mapper_t)
octave_idx_type rows(void) const
octave_value as_double(void) const
octave::idx_vector index_vector(bool require_integers=false) const
octave_uint64 uint64_scalar_value() const
float float_value(bool=false) const
Complex complex_value(bool=false) const
mxArray * as_mxArray(bool interleaved) const
octave_value as_uint64(void) const
octave_value as_uint16(void) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
octave_value map(unary_mapper_t umap) const
octave_int64 int64_scalar_value() const
FloatComplex float_complex_value(bool=false) const
octave_value as_uint8(void) const
octave_value as_single(void) const
octave_value as_int16(void) const
octave_value as_int8(void) const
octave_value as_uint32(void) const
octave_value as_int32(void) const
NDArray array_value(bool=false) const
double double_value(bool=false) const
octave_value as_int64(void) 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(void)
class OCTAVE_API FloatNDArray
std::complex< double > Complex
std::complex< float > FloatComplex
octave_int< int64_t > octave_int64
octave_int< uint64_t > octave_uint64
static int xisascii(int c)
#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)