81 if (beg < 0 || end >=
length () || end < beg)
83 (*current_liboctave_error_handler) (
"range error for fill");
97 if (beg < 0 || end >=
length () || end < beg)
99 (*current_liboctave_error_handler) (
"range error for fill");
115 (*current_liboctave_error_handler) (
"range error for fill");
131 (*current_liboctave_error_handler) (
"range error for fill");
147 (*current_liboctave_error_handler) (
"range error for fill");
163 (*current_liboctave_error_handler) (
"range error for fill");
177 if (beg < 0 || beg + a_len >=
length ())
179 (*current_liboctave_error_handler) (
"range error for fill");
193 if (beg < 0 || beg + a_len >=
length ())
195 (*current_liboctave_error_handler) (
"range error for fill");
209 if (beg < 0 || beg + a_len >=
length ())
211 (*current_liboctave_error_handler) (
"range error for fill");
225 if (beg < 0 || beg + a_len >=
length ())
227 (*current_liboctave_error_handler) (
"range error for fill");
255 if (r1 > r2) { std::swap (r1, r2); }
256 if (c1 > c2) { std::swap (c1, c2); }
265 result.
elem (i, j) =
elem (r1+i, c1+j);
279 (*current_liboctave_error_handler) (
"invalid row selection");
284 if (r <= c || (r > c && i < c))
295 (*current_liboctave_error_handler) (
"invalid row selection");
300 if (c ==
'f' || c ==
'F')
301 return row (static_cast<octave_idx_type>(0));
302 else if (c ==
'l' || c ==
'L')
306 (*current_liboctave_error_handler) (
"invalid row selection");
318 (*current_liboctave_error_handler) (
"invalid column selection");
323 if (r >= c || (r < c && i < r))
334 (*current_liboctave_error_handler) (
"invalid column selection");
339 if (c ==
'f' || c ==
'F')
340 return column (static_cast<octave_idx_type>(0));
341 else if (c ==
'l' || c ==
'L')
345 (*current_liboctave_error_handler) (
"invalid column selection");
364 (*current_liboctave_error_handler) (
"inverse requires square matrix");
373 if (
elem (i, i) == 0.0)
379 retval.
elem (i, i) = 1.0 /
elem (i, i);
396 if (
elem (i, i) != 0.0)
397 retval.
elem (i, i) = 1.0 /
elem (i, i);
399 retval.
elem (i, i) = 0.0;
422 if (r != a_nr || c != a_nc)
428 if (r == 0 || c == 0)
476 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
485 double a_element = a.
elem (i, i);
488 c.
elem (i, i) = a_element * b_element;
509 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
521 c.
elem (i, i) = a_element * b_element;
535 (*current_liboctave_error_handler) (
"determinant requires square matrix");
552 double amx = av.
max (), amn = av.
min ();
553 return amx == 0 ? 0.0 : amn / amx;
568 os <<
" " << a.
elem (i, i);