82 if (beg < 0 || end >=
length () || end < beg)
84 (*current_liboctave_error_handler) (
"range error for fill");
98 if (beg < 0 || end >=
length () || end < beg)
100 (*current_liboctave_error_handler) (
"range error for fill");
116 (*current_liboctave_error_handler) (
"range error for fill");
132 (*current_liboctave_error_handler) (
"range error for fill");
148 (*current_liboctave_error_handler) (
"range error for fill");
164 (*current_liboctave_error_handler) (
"range error for fill");
178 if (beg < 0 || beg + a_len >=
length ())
180 (*current_liboctave_error_handler) (
"range error for fill");
195 if (beg < 0 || beg + a_len >=
length ())
197 (*current_liboctave_error_handler) (
"range error for fill");
211 if (beg < 0 || beg + a_len >=
length ())
213 (*current_liboctave_error_handler) (
"range error for fill");
228 if (beg < 0 || beg + a_len >=
length ())
230 (*current_liboctave_error_handler) (
"range error for fill");
259 if (r1 > r2) { std::swap (r1, r2); }
260 if (c1 > c2) { std::swap (c1, c2); }
269 result.
elem (i, j) =
elem (r1+i, c1+j);
283 (*current_liboctave_error_handler) (
"invalid row selection");
288 if (r <= c || (r > c && i < c))
299 (*current_liboctave_error_handler) (
"invalid row selection");
304 if (c ==
'f' || c ==
'F')
305 return row (static_cast<octave_idx_type>(0));
306 else if (c ==
'l' || c ==
'L')
310 (*current_liboctave_error_handler) (
"invalid row selection");
322 (*current_liboctave_error_handler) (
"invalid column selection");
327 if (r >= c || (r < c && i < r))
338 (*current_liboctave_error_handler) (
"invalid column selection");
343 if (c ==
'f' || c ==
'F')
344 return column (static_cast<octave_idx_type>(0));
345 else if (c ==
'l' || c ==
'L')
349 (*current_liboctave_error_handler) (
"invalid column selection");
368 (*current_liboctave_error_handler) (
"inverse requires square matrix");
377 if (
elem (i, i) == 0.0f)
383 retval.
elem (i, i) = 1.0f /
elem (i, i);
401 if (val < tol || val == 0.0
f)
402 retval.
elem (i, i) = 0.0f;
404 retval.
elem (i, i) = 1.0f /
elem (i, i);
427 if (r != a_nr || c != a_nc)
433 if (r == 0 || c == 0)
482 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
491 float a_element = a.
elem (i, i);
494 c.
elem (i, i) = a_element * b_element;
515 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
527 c.
elem (i, i) = a_element * b_element;
541 (*current_liboctave_error_handler) (
"determinant requires square matrix");
558 float amx = av.
max ();
559 float amn = av.
min ();
560 return amx == 0 ? 0.0f : amn / amx;
575 os <<
" " << a.
elem (i, i);
FloatComplexColumnVector column(octave_idx_type i) const
void mx_inline_add2(size_t n, R *r, const X *x)
FloatComplexDiagMatrix inverse(void) const
FloatComplexDiagMatrix(void)
void gripe_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
base_det< FloatComplex > FloatComplexDET
const FloatComplex * fortran_vec(void) const
FloatComplex elem(octave_idx_type r, octave_idx_type c) const
FloatComplexRowVector row(octave_idx_type i) const
FloatComplexRowVector(void)
FloatComplexDiagMatrix & fill(float val)
octave_idx_type rows(void) const
const FloatComplex * data(void) const
T & elem(octave_idx_type n)
bool operator==(const FloatComplexDiagMatrix &a) const
octave_idx_type rows(void) const
F77_RET_T const double const double double * d
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type octave_idx_type r2
bool mx_inline_all_real(size_t n, const std::complex< T > *x)
T dgelem(octave_idx_type i) const
bool all_elements_are_real(void) const
FloatComplexDiagMatrix pseudo_inverse(float tol=0.0f) const
F77_RET_T const double const double * f
bool operator!=(const FloatComplexDiagMatrix &a) const
Array< U > map(F fcn) const
Apply function fcn to each element of the Array.
T & dgxelem(octave_idx_type i)
FloatComplexDiagMatrix operator*(const FloatComplexDiagMatrix &a, const FloatDiagMatrix &b)
FloatComplexColumnVector extract_diag(octave_idx_type k=0) const
FloatComplexDiagMatrix & operator+=(const FloatDiagMatrix &a)
FloatComplexDET determinant(void) const
friend class FloatComplexColumnVector
FloatComplexDiagMatrix conj(const FloatComplexDiagMatrix &a)
octave_idx_type cols(void) const
octave_idx_type length(void) const
Number of elements in the array.
octave_idx_type columns(void) const
FloatDiagMatrix abs(void) const
std::complex< float > FloatComplex
std::ostream & operator<<(std::ostream &os, const FloatComplexDiagMatrix &a)
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type octave_idx_type octave_idx_type c1
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type r1
bool mx_inline_equal(size_t n, const T1 *x, const T2 *y)
octave_idx_type cols(void) const
FloatComplexMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
octave_idx_type length(void) const