65 if (beg < 0 || end >=
length () || end < beg)
67 (*current_liboctave_error_handler) (
"range error for fill");
83 (*current_liboctave_error_handler) (
"range error for fill");
99 (*current_liboctave_error_handler) (
"range error for fill");
113 if (beg < 0 || beg + a_len >=
length ())
115 (*current_liboctave_error_handler) (
"range error for fill");
129 if (beg < 0 || beg + a_len >=
length ())
131 (*current_liboctave_error_handler) (
"range error for fill");
163 if (r1 > r2) { std::swap (r1, r2); }
164 if (c1 > c2) { std::swap (c1, c2); }
173 result.
elem (i, j) =
elem (r1+i, c1+j);
187 (*current_liboctave_error_handler) (
"invalid row selection");
192 if (r <= c || (r > c && i < c))
203 (*current_liboctave_error_handler) (
"invalid row selection");
208 if (c ==
'f' || c ==
'F')
209 return row (static_cast<octave_idx_type>(0));
210 else if (c ==
'l' || c ==
'L')
214 (*current_liboctave_error_handler) (
"invalid row selection");
226 (*current_liboctave_error_handler) (
"invalid column selection");
231 if (r >= c || (r < c && i < r))
242 (*current_liboctave_error_handler) (
"invalid column selection");
247 if (c ==
'f' || c ==
'F')
248 return column (static_cast<octave_idx_type>(0));
249 else if (c ==
'l' || c ==
'L')
253 (*current_liboctave_error_handler) (
"invalid column selection");
273 (*current_liboctave_error_handler) (
"inverse requires square matrix");
282 if (
elem (i, i) == 0.0)
288 retval.
elem (i, i) = 1.0 /
elem (i, i);
306 if (val < tol || val == 0.0
f)
307 retval.
elem (i, i) = 0.0f;
309 retval.
elem (i, i) = 1.0f /
elem (i, i);
352 (*current_liboctave_error_handler) (
"determinant requires square matrix");
369 float amx = av.
max ();
370 float amn = av.
min ();
371 return amx == 0 ? 0.0f : amn / amx;
384 os <<
" " << a.
elem (i, i);
FloatDiagMatrix & fill(float val)
void gripe_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
float elem(octave_idx_type r, octave_idx_type c) const
FloatDiagMatrix operator*(const FloatDiagMatrix &a, const FloatDiagMatrix &b)
FloatDiagMatrix abs(void) const
octave_idx_type rows(void) const
const float * data(void) const
FloatDET determinant(void) const
T & elem(octave_idx_type n)
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type octave_idx_type r2
T dgelem(octave_idx_type i) const
F77_RET_T const double const double * f
Array< U > map(F fcn) const
Apply function fcn to each element of the Array.
FloatMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
FloatDiagMatrix real(const FloatComplexDiagMatrix &a)
T & dgxelem(octave_idx_type i)
FloatColumnVector extract_diag(octave_idx_type k=0) const
bool operator!=(const FloatDiagMatrix &a) const
FloatComplexColumnVector extract_diag(octave_idx_type k=0) const
FloatDiagMatrix inverse(void) const
FloatDiagMatrix pseudo_inverse(float tol=0.0f) const
octave_idx_type cols(void) const
octave_idx_type length(void) const
Number of elements in the array.
FloatColumnVector column(octave_idx_type i) const
octave_idx_type columns(void) const
bool operator==(const FloatDiagMatrix &a) const
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)
FloatDiagMatrix imag(const FloatComplexDiagMatrix &a)
FloatRowVector row(octave_idx_type i) const
octave_idx_type length(void) const
std::ostream & operator<<(std::ostream &os, const FloatDiagMatrix &a)