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);
397 if (val < tol || val == 0.0)
398 retval.
elem (i, i) = 0.0;
400 retval.
elem (i, i) = 1.0 /
elem (i, i);
423 if (r != a_nr || c != a_nc)
429 if (r == 0 || c == 0)
478 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
487 double a_element = a.
elem (i, i);
490 c.
elem (i, i) = a_element * b_element;
511 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
523 c.
elem (i, i) = a_element * b_element;
537 (*current_liboctave_error_handler) (
"determinant requires square matrix");
554 double amx = av.
max ();
555 double amn = av.
min ();
556 return amx == 0 ? 0.0 : amn / amx;
571 os <<
" " << a.
elem (i, i);
void mx_inline_add2(size_t n, R *r, const X *x)
bool operator!=(const ComplexDiagMatrix &a) const
void gripe_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
const Complex * fortran_vec(void) const
Complex elem(octave_idx_type r, octave_idx_type c) const
std::ostream & operator<<(std::ostream &os, const ComplexDiagMatrix &a)
ComplexDiagMatrix conj(const ComplexDiagMatrix &a)
ComplexColumnVector extract_diag(octave_idx_type k=0) const
ComplexDiagMatrix inverse(void) const
ComplexMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
octave_idx_type rows(void) const
const Complex * data(void) const
ComplexRowVector row(octave_idx_type i) const
T & elem(octave_idx_type n)
ComplexDiagMatrix pseudo_inverse(double tol=0.0) const
bool operator==(const ComplexDiagMatrix &a) const
octave_idx_type rows(void) const
F77_RET_T const double const double double * d
ComplexDiagMatrix operator*(const ComplexDiagMatrix &a, const DiagMatrix &b)
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
Array< U > map(F fcn) const
Apply function fcn to each element of the Array.
ComplexDiagMatrix & operator+=(const DiagMatrix &a)
friend class ComplexColumnVector
T & dgxelem(octave_idx_type i)
ComplexDET determinant(void) const
octave_idx_type cols(void) const
octave_idx_type length(void) const
Number of elements in the array.
ComplexDiagMatrix & fill(double val)
octave_idx_type columns(void) const
base_det< Complex > ComplexDET
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
std::complex< double > Complex
bool mx_inline_equal(size_t n, const T1 *x, const T2 *y)
octave_idx_type cols(void) const
bool all_elements_are_real(void) const
ComplexColumnVector column(octave_idx_type i) const
octave_idx_type length(void) const
DiagMatrix abs(void) const