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); }
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')
240 (*current_liboctave_error_handler) (
"inverse requires square matrix");
247 if (
elem (i, i) == 0.0)
250 retval.elem (i, i) = 1.0 /
elem (i, i);
267 float val = std::abs (
elem (i, i));
268 if (val < tol || val == 0.0f)
269 retval.
elem (i, i) = 0.0f;
271 retval.
elem (i, i) = 1.0f /
elem (i, i);
313 (*current_liboctave_error_handler) (
"determinant requires square matrix");
326 float amx = av.
max ();
327 float amn = av.
min ();
328 return amx == 0 ? 0.0f : amn / amx;
341 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.
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)
octave_idx_type columns() const
octave_idx_type cols() const
FloatComplexColumnVector extract_diag(octave_idx_type k=0) const
bool operator==(const FloatDiagMatrix &a) const
FloatRowVector row(octave_idx_type i) const
FloatDiagMatrix inverse() const
FloatDiagMatrix abs() const
bool operator!=(const FloatDiagMatrix &a) const
FloatDiagMatrix & fill(float val)
FloatColumnVector extract_diag(octave_idx_type k=0) const
FloatDET determinant() const
FloatMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
FloatDiagMatrix pseudo_inverse(float tol=0.0f) const
FloatColumnVector column(octave_idx_type i) const
FloatDiagMatrix()=default
std::ostream & operator<<(std::ostream &os, const FloatDiagMatrix &a)
FloatDiagMatrix real(const FloatComplexDiagMatrix &a)
FloatDiagMatrix operator*(const FloatDiagMatrix &a, const FloatDiagMatrix &b)
FloatDiagMatrix imag(const FloatComplexDiagMatrix &a)
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)