26 #if defined (HAVE_CONFIG_H)
43 =
"Octave:nonconformant-args";
46 =
"Octave:index-out-of-bounds";
51 =
"Octave:nearly-singular-matrix";
58 (*current_liboctave_error_handler)
59 (
"invalid conversion from NaN to logical");
65 (*current_liboctave_error_handler)
66 (
"invalid conversion from NaN to character");
75 (*current_liboctave_error_with_id_handler)
76 (err_id,
"%s: nonconformant arguments (op1 len: %" OCTAVE_IDX_TYPE_FORMAT
77 ", op2 len: % " OCTAVE_IDX_TYPE_FORMAT
")",
78 op, op1_len, op2_len);
88 (*current_liboctave_error_with_id_handler)
89 (err_id,
"%s: nonconformant arguments "
90 "(op1 is %" OCTAVE_IDX_TYPE_FORMAT
"x%" OCTAVE_IDX_TYPE_FORMAT
", "
91 "op2 is %" OCTAVE_IDX_TYPE_FORMAT
"x%" OCTAVE_IDX_TYPE_FORMAT
")",
92 op, op1_nr, op1_nc, op2_nr, op2_nc);
101 std::string op1_dims_str = op1_dims.
str ();
102 std::string op2_dims_str = op2_dims.
str ();
104 (*current_liboctave_error_with_id_handler)
105 (err_id,
"%s: nonconformant arguments (op1 is %s, op2 is %s)",
106 op, op1_dims_str.c_str (), op2_dims_str.c_str ());
115 (*current_liboctave_error_with_id_handler)
116 (err_id,
"A(%s) = []: index out of bounds: value %" OCTAVE_IDX_TYPE_FORMAT
117 " out of bound %" OCTAVE_IDX_TYPE_FORMAT,
118 is1d ?
"I" :
"..,I,..", idx, ext);
128 std::ostringstream buf;
135 bool show_parens =
m_dim > 0;
147 buf <<
"(...[x" <<
m_dim - 1 <<
"]...";
163 buf <<
"...[x" <<
m_nd -
m_dim <<
"]...)";
183 static std::string exp
184 = std::to_string (std::numeric_limits<octave_idx_type>::digits);
187 +
": subscripts must be either integers 1 to (2^" + exp
188 +
")-1 or logicals");
218 const std::string& var)
220 std::ostringstream buf;
227 if (
n + 1 != nearest && (buf.str ().find (
'.') == std::string::npos))
228 buf << std::showpos << (
n + 1 - nearest);
251 set_message (
expression () +
": out of bound "
253 +
" (dimensions are " +
m_size.
str (
'x') +
")");
276 throw out_of_range (std::to_string (idx), nd, dim, ext, dv);
282 (*current_liboctave_error_with_id_handler)
283 (
"Octave:invalid-resize",
284 "Invalid resizing operation or ambiguous assignment to an out-of-bounds array element");
292 (*current_liboctave_warning_with_id_handler)
294 "matrix singular to machine precision");
298 (*current_liboctave_warning_with_id_handler)
300 "matrix singular to machine precision, rcond = %g", rcond);
Vector representing the dimensions (size) of an Array.
std::string str(char sep='x') const
std::string expression(void) const
const char * err_id(void) const
void update_message(void)
invalid_index(const std::string &value, octave_idx_type ndim, octave_idx_type dimen)
const char * err_id(void) const
out_of_range(const std::string &value, octave_idx_type nd, octave_idx_type dim, octave_idx_type ext, const dim_vector &size)
void update_message(void)
std::complex< T > floor(const std::complex< T > &x)
static const char * error_id_index_out_of_bounds
void err_invalid_index(const std::string &idx, octave_idx_type nd, octave_idx_type dim, const std::string &)
void err_del_index_out_of_range(bool is1d, octave_idx_type idx, octave_idx_type ext)
void err_nan_to_logical_conversion(void)
void err_invalid_resize(void)
void err_index_out_of_range(int nd, int dim, octave_idx_type idx, octave_idx_type ext, const dim_vector &dv)
void warn_singular_matrix(double rcond)
static const char * error_id_nonconformant_args
static const char * warning_id_nearly_singular_matrix
static const char * warning_id_singular_matrix
void err_nan_to_character_conversion(void)
static const char * error_id_invalid_index
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)