26 #if defined (HAVE_CONFIG_H)
66 if (beg < 0 || end >=
length () || end < beg)
67 (*current_liboctave_error_handler) (
"range error for fill");
80 (*current_liboctave_error_handler) (
"range error for fill");
93 (*current_liboctave_error_handler) (
"range error for fill");
105 if (beg < 0 || beg + a_len >=
length ())
106 (*current_liboctave_error_handler) (
"range error for fill");
118 if (beg < 0 || beg + a_len >=
length ())
119 (*current_liboctave_error_handler) (
"range error for fill");
149 if (r1 > r2) { std::swap (r1, r2); }
150 if (c1 > c2) { std::swap (c1, c2); }
155 Matrix result (new_r, new_c);
159 result.
elem (i, j) =
elem (r1+i, c1+j);
172 (*current_liboctave_error_handler) (
"invalid row selection");
176 retval.elem (i) =
elem (i, i);
185 (*current_liboctave_error_handler) (
"invalid row selection");
188 if (c ==
'f' || c ==
'F')
190 else if (c ==
'l' || c ==
'L')
202 (*current_liboctave_error_handler) (
"invalid column selection");
206 retval.elem (i) =
elem (i, i);
215 (*current_liboctave_error_handler) (
"invalid column selection");
218 if (c ==
'f' || c ==
'F')
220 else if (c ==
'l' || c ==
'L')
239 (*current_liboctave_error_handler) (
"inverse requires square matrix");
249 if (
xelem (i, i) == 0.0)
260 retval.elem (i, i) = 1.0 /
xelem (i, i);
265 (*current_liboctave_error_handler)
266 (
"inverse of the null matrix not defined");
268 else if (z_count > 0)
289 double val = std::abs (
elem (i, i));
290 if (val < tol || val == 0.0)
291 retval.
elem (i, i) = 0.0;
293 retval.
elem (i, i) = 1.0 /
elem (i, i);
335 (*current_liboctave_error_handler) (
"determinant requires square matrix");
348 double amx = av.
max ();
349 double amn = av.
min ();
350 return amx == 0 ? 0.0 : amn / amx;
363 os <<
' ' << a.
elem (i, i);
T & elem(octave_idx_type n)
Size of the specified dimension.
Array< U, A > map(F fcn) const
Apply function fcn to each element of the Array<T, Alloc>.
octave_idx_type numel() const
Number of elements in the array.
ComplexColumnVector extract_diag(octave_idx_type k=0) const
octave_idx_type rows() const
T dgelem(octave_idx_type i) const
octave_idx_type length() const
T elem(octave_idx_type r, octave_idx_type c) const
T & dgxelem(octave_idx_type i)
T xelem(octave_idx_type r, octave_idx_type c) const
octave_idx_type columns() const
octave_idx_type cols() const
DiagMatrix inverse() const
RowVector row(octave_idx_type i) const
Matrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
DiagMatrix & fill(double val)
DiagMatrix pseudo_inverse(double tol=0.0) const
ColumnVector extract_diag(octave_idx_type k=0) const
bool operator!=(const DiagMatrix &a) const
bool operator==(const DiagMatrix &a) const
ColumnVector column(octave_idx_type i) const
DiagMatrix real(const ComplexDiagMatrix &a)
DiagMatrix imag(const ComplexDiagMatrix &a)
std::ostream & operator<<(std::ostream &os, const DiagMatrix &a)
DiagMatrix operator*(const DiagMatrix &a, const DiagMatrix &b)
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
bool mx_inline_equal(std::size_t n, const T1 *x, const T2 *y)