26 #if defined (HAVE_CONFIG_H)
83 if (beg < 0 || end >=
length () || end < beg)
84 (*current_liboctave_error_handler) (
"range error for fill");
96 if (beg < 0 || end >=
length () || end < beg)
97 (*current_liboctave_error_handler) (
"range error for fill");
110 (*current_liboctave_error_handler) (
"range error for fill");
123 (*current_liboctave_error_handler) (
"range error for fill");
136 (*current_liboctave_error_handler) (
"range error for fill");
149 (*current_liboctave_error_handler) (
"range error for fill");
161 if (beg < 0 || beg + a_len >=
length ())
162 (*current_liboctave_error_handler) (
"range error for fill");
175 if (beg < 0 || beg + a_len >=
length ())
176 (*current_liboctave_error_handler) (
"range error for fill");
188 if (beg < 0 || beg + a_len >=
length ())
189 (*current_liboctave_error_handler) (
"range error for fill");
202 if (beg < 0 || beg + a_len >=
length ())
203 (*current_liboctave_error_handler) (
"range error for fill");
230 if (r1 > r2) { std::swap (r1, r2); }
231 if (c1 > c2) { std::swap (c1, c2); }
240 result.
elem (i, j) =
elem (r1+i, c1+j);
253 (*current_liboctave_error_handler) (
"invalid row selection");
257 retval.elem (i) =
elem (i, i);
266 (*current_liboctave_error_handler) (
"invalid row selection");
269 if (c ==
'f' || c ==
'F')
271 else if (c ==
'l' || c ==
'L')
283 (*current_liboctave_error_handler) (
"invalid column selection");
287 retval.elem (i) =
elem (i, i);
296 (*current_liboctave_error_handler) (
"invalid column selection");
299 if (c ==
'f' || c ==
'F')
301 else if (c ==
'l' || c ==
'L')
320 (*current_liboctave_error_handler) (
"inverse requires square matrix");
327 if (
elem (i, i) == 0.0f)
333 retval.elem (i, i) = 1.0f /
elem (i, i);
350 float val = std::abs (
elem (i, i));
351 if (val < tol || val == 0.0f)
352 retval.
elem (i, i) = 0.0f;
354 retval.
elem (i, i) = 1.0f /
elem (i, i);
377 if (
r != a_nr || c != a_nc)
380 if (
r == 0 || c == 0)
426 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
435 float a_element = a.
elem (i, i);
438 c.
elem (i, i) = a_element * b_element;
456 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
468 c.
elem (i, i) = a_element * b_element;
481 (*current_liboctave_error_handler) (
"determinant requires square matrix");
494 float amx = av.
max ();
495 float amn = av.
min ();
496 return amx == 0 ? 0.0f : amn / amx;
511 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
FloatDiagMatrix abs() const
FloatComplexMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
FloatComplexDiagMatrix pseudo_inverse(float tol=0.0f) const
FloatComplexColumnVector extract_diag(octave_idx_type k=0) const
FloatComplexDiagMatrix & fill(float val)
FloatComplexColumnVector column(octave_idx_type i) const
bool operator==(const FloatComplexDiagMatrix &a) const
FloatComplexDiagMatrix & operator+=(const FloatDiagMatrix &a)
bool all_elements_are_real() const
bool operator!=(const FloatComplexDiagMatrix &a) const
FloatComplexDET determinant() const
FloatComplexRowVector row(octave_idx_type i) const
FloatComplexDiagMatrix inverse() const
FloatComplexDiagMatrix()=default
Template for two dimensional diagonal array with math operators.
FloatComplexDiagMatrix conj(const FloatComplexDiagMatrix &a)
std::ostream & operator<<(std::ostream &os, const FloatComplexDiagMatrix &a)
FloatComplexDiagMatrix operator*(const FloatComplexDiagMatrix &a, const FloatDiagMatrix &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
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
void mx_inline_add2(std::size_t n, R *r, const X *x)
bool mx_inline_all_real(std::size_t n, const std::complex< T > *x)
bool mx_inline_equal(std::size_t n, const T1 *x, const T2 *y)
std::complex< float > FloatComplex