25 #if defined (HAVE_CONFIG_H) 51 #include "mx-fcm-fdm.h" 52 #include "mx-fcm-fs.h" 53 #include "mx-fdm-fcm.h" 142 elem (
i, j) =
static_cast<unsigned char> (
a.elem (
i, j));
160 if (
rows () !=
a.rows () ||
cols () !=
a.cols ())
169 return !(*
this ==
a);
200 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
201 (*current_liboctave_error_handler) (
"range error for insert");
221 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
222 (*current_liboctave_error_handler) (
"range error for insert");
241 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
242 (*current_liboctave_error_handler) (
"range error for insert");
262 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
263 (*current_liboctave_error_handler) (
"range error for insert");
293 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
294 (*current_liboctave_error_handler) (
"range error for insert");
308 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
309 (*current_liboctave_error_handler) (
"range error for insert");
329 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
330 (*current_liboctave_error_handler) (
"range error for insert");
353 if (nr > 0 && nc > 0)
371 if (nr > 0 && nc > 0)
390 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
391 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
392 (*current_liboctave_error_handler) (
"range error for fill");
397 if (r2 >= r1 && c2 >= c1)
417 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
418 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
419 (*current_liboctave_error_handler) (
"range error for fill");
424 if (r2 >= r1 && c2 >=c1)
446 retval.insert (*
this, 0, 0);
447 retval.insert (
a, 0, nc_insert);
457 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
461 retval.insert (*
this, 0, 0);
462 retval.insert (
a, 0, nc_insert);
471 if (nr !=
a.numel ())
476 retval.insert (*
this, 0, 0);
477 retval.insert (
a, 0, nc_insert);
491 retval.insert (*
this, 0, 0);
492 retval.insert (
a, 0, nc_insert);
506 retval.insert (*
this, 0, 0);
507 retval.insert (
a, 0, nc_insert);
517 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
521 retval.insert (*
this, 0, 0);
522 retval.insert (
a, 0, nc_insert);
531 if (nr !=
a.numel ())
536 retval.insert (*
this, 0, 0);
537 retval.insert (
a, 0, nc_insert);
551 retval.insert (*
this, 0, 0);
552 retval.insert (
a, 0, nc_insert);
566 retval.insert (*
this, 0, 0);
567 retval.insert (
a, nr_insert, 0);
576 if (nc !=
a.numel ())
581 retval.insert (*
this, 0, 0);
582 retval.insert (
a, nr_insert, 0);
592 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
596 retval.insert (*
this, 0, 0);
597 retval.insert (
a, nr_insert, 0);
611 retval.insert (*
this, 0, 0);
612 retval.insert (
a, nr_insert, 0);
626 retval.insert (*
this, 0, 0);
627 retval.insert (
a, nr_insert, 0);
636 if (nc !=
a.numel ())
641 retval.insert (*
this, 0, 0);
642 retval.insert (
a, nr_insert, 0);
652 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
656 retval.insert (*
this, 0, 0);
657 retval.insert (
a, nr_insert, 0);
671 retval.insert (*
this, 0, 0);
672 retval.insert (
a, nr_insert, 0);
679 return do_mx_unary_map<FloatComplex, FloatComplex, std::conj<float>> (
a);
725 float sum = colsum.
xelem (
i);
744 return inverse (mattype, info, rcon, 0, 0);
752 return inverse (mattype, info, rcon, 0, 0);
757 bool calc_cond)
const 760 return inverse (mattype, info, rcon, force, calc_cond);
768 return inverse (mattype, info, rcon, 0, 0);
775 return inverse (mattype, info, rcon, 0, 0);
780 float& rcon,
bool force,
bool calc_cond)
const 787 if (nr != nc || nr == 0 || nc == 0)
788 (*current_liboctave_error_handler) (
"inverse requires square matrix");
790 int typ = mattype.
type ();
798 F77_XFCN (ctrtri, CTRTRI, (F77_CONST_CHAR_ARG2 (&uplo, 1),
799 F77_CONST_CHAR_ARG2 (&udiag, 1),
802 F77_CHAR_ARG_LEN (1)));
818 F77_XFCN (ctrcon, CTRCON, (F77_CONST_CHAR_ARG2 (&job, 1),
819 F77_CONST_CHAR_ARG2 (&uplo, 1),
820 F77_CONST_CHAR_ARG2 (&udiag, 1),
825 F77_CHAR_ARG_LEN (1)));
827 if (ztrcon_info != 0)
831 if (info == -1 && ! force)
839 float& rcon,
bool force,
bool calc_cond)
const 847 (*current_liboctave_error_handler) (
"inverse requires square matrix");
850 F77_INT *pipvt = ipvt.fortran_vec ();
869 lwork = (lwork < 2 * nc ? 2 * nc : lwork);
903 F77_XFCN (cgecon, CGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
906 F77_CHAR_ARG_LEN (1)));
908 if (cgecon_info != 0)
912 if ((info == -1 && ! force)
922 if (zgetri_info != 0)
934 float& rcon,
bool force,
bool calc_cond)
const 936 int typ = mattype.
type (
false);
940 typ = mattype.
type (*
this);
943 ret =
tinverse (mattype, info, rcon, force, calc_cond);
952 rcon =
chol.rcond ();
955 ret =
chol.inverse ();
962 ret =
finverse (mattype, info, rcon, force, calc_cond);
964 if ((calc_cond || mattype.
ishermitian ()) && rcon == 0.)
998 * std::numeric_limits<float>::epsilon ();
1004 while (r >= 0 && sigma.
elem (r) < tol)
1020 #if defined (HAVE_FFTW) 1025 size_t nr =
rows ();
1026 size_t nc =
cols ();
1030 size_t npts, nsamples;
1032 if (nr == 1 || nc == 1)
1034 npts = (nr > nc ? nr : nc);
1054 size_t nr =
rows ();
1055 size_t nc =
cols ();
1059 size_t npts, nsamples;
1061 if (nr == 1 || nc == 1)
1063 npts = (nr > nc ? nr : nc);
1123 if (nr == 1 || nc == 1)
1125 npts = octave::to_f77_int (nr > nc ? nr : nc);
1130 npts = octave::to_f77_int (nr);
1166 if (nr == 1 || nc == 1)
1168 npts = octave::to_f77_int (nr > nc ? nr : nc);
1173 npts = octave::to_f77_int (nr);
1196 tmp_data[j] = tmp_data[j] / static_cast<float> (npts);
1211 if (nr == 1 || nc == 1)
1213 npts = (nr > nc ? nr : nc);
1232 for (
F77_INT j = 0; j < nsamples; j++)
1245 pwsave = wsave.fortran_vec ();
1252 for (
F77_INT j = 0; j < nsamples; j++)
1257 prow[
i] = tmp_data[
i*nr + j];
1262 tmp_data[
i*nr + j] = prow[
i];
1278 if (nr == 1 || nc == 1)
1280 npts = (nr > nc ? nr : nc);
1299 for (
F77_INT j = 0; j < nsamples; j++)
1307 for (
F77_INT j = 0; j < npts*nsamples; j++)
1308 tmp_data[j] = tmp_data[j] / static_cast<float> (npts);
1315 pwsave = wsave.fortran_vec ();
1322 for (
F77_INT j = 0; j < nsamples; j++)
1327 prow[
i] = tmp_data[
i*nr + j];
1332 tmp_data[
i*nr + j] = prow[
i] / static_cast<float> (npts);
1357 bool calc_cond)
const 1360 return determinant (mattype, info, rcon, calc_cond);
1366 bool calc_cond)
const 1377 (*current_liboctave_error_handler) (
"matrix must be square");
1379 volatile int typ = mattype.
type ();
1386 typ = mattype.
type (*
this);
1402 anorm =
norm1 (*
this);
1407 F77_XFCN (cpotrf, CPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1409 F77_CHAR_ARG_LEN (1)));
1426 F77_XFCN (cpocon, CPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1429 F77_CHAR_ARG_LEN (1)));
1443 (*current_liboctave_error_handler) (
"det: invalid dense matrix type");
1456 float anorm =
norm1 (*
this);
1489 F77_XFCN (cgecon, CGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1492 F77_CHAR_ARG_LEN (1)));
1520 return rcond (mattype);
1531 (*current_liboctave_error_handler) (
"matrix must be square");
1533 if (nr == 0 || nc == 0)
1537 volatile int typ = mattype.
type ();
1540 typ = mattype.
type (*
this);
1556 F77_XFCN (ctrcon, CTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1557 F77_CONST_CHAR_ARG2 (&uplo, 1),
1558 F77_CONST_CHAR_ARG2 (&dia, 1),
1561 F77_CHAR_ARG_LEN (1)
1562 F77_CHAR_ARG_LEN (1)
1563 F77_CHAR_ARG_LEN (1)));
1569 (*current_liboctave_error_handler)
1570 (
"permuted triangular matrix not implemented");
1584 F77_XFCN (ctrcon, CTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1585 F77_CONST_CHAR_ARG2 (&uplo, 1),
1586 F77_CONST_CHAR_ARG2 (&dia, 1),
1589 F77_CHAR_ARG_LEN (1)
1590 F77_CHAR_ARG_LEN (1)
1591 F77_CHAR_ARG_LEN (1)));
1597 (*current_liboctave_error_handler)
1598 (
"permuted triangular matrix not implemented");
1611 anorm =
norm1 (atmp);
1613 F77_XFCN (cpotrf, CPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1615 F77_CHAR_ARG_LEN (1)));
1631 F77_XFCN (cpocon, CPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1634 F77_CHAR_ARG_LEN (1)));
1652 anorm =
norm1 (atmp);
1673 F77_XFCN (cgecon, CGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1676 F77_CHAR_ARG_LEN (1)));
1693 solve_singularity_handler sing_handler,
1705 (*current_liboctave_error_handler)
1706 (
"matrix dimension mismatch solution of linear equations");
1708 if (nr == 0 || nc == 0 ||
b_nc == 0)
1712 volatile int typ = mattype.
type ();
1720 (*current_liboctave_error_handler)
1721 (
"permuted triangular matrix not implemented");
1735 F77_XFCN (ctrtrs, CTRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1736 F77_CONST_CHAR_ARG2 (&trans, 1),
1737 F77_CONST_CHAR_ARG2 (&dia, 1),
1740 F77_CHAR_ARG_LEN (1)
1741 F77_CHAR_ARG_LEN (1)
1742 F77_CHAR_ARG_LEN (1)));
1757 F77_XFCN (ctrcon, CTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1758 F77_CONST_CHAR_ARG2 (&uplo, 1),
1759 F77_CONST_CHAR_ARG2 (&dia, 1),
1762 F77_CHAR_ARG_LEN (1)
1763 F77_CHAR_ARG_LEN (1)
1764 F77_CHAR_ARG_LEN (1)));
1771 volatile float rcond_plus_one = rcon + 1.0;
1778 sing_handler (rcon);
1795 solve_singularity_handler sing_handler,
1807 (*current_liboctave_error_handler)
1808 (
"matrix dimension mismatch solution of linear equations");
1810 if (nr == 0 || nc == 0 ||
b_nc == 0)
1814 volatile int typ = mattype.
type ();
1822 (*current_liboctave_error_handler)
1823 (
"permuted triangular matrix not implemented");
1837 F77_XFCN (ctrtrs, CTRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1838 F77_CONST_CHAR_ARG2 (&trans, 1),
1839 F77_CONST_CHAR_ARG2 (&dia, 1),
1842 F77_CHAR_ARG_LEN (1)
1843 F77_CHAR_ARG_LEN (1)
1844 F77_CHAR_ARG_LEN (1)));
1859 F77_XFCN (ctrcon, CTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1860 F77_CONST_CHAR_ARG2 (&uplo, 1),
1861 F77_CONST_CHAR_ARG2 (&dia, 1),
1864 F77_CHAR_ARG_LEN (1)
1865 F77_CHAR_ARG_LEN (1)
1866 F77_CHAR_ARG_LEN (1)));
1873 volatile float rcond_plus_one = rcon + 1.0;
1880 sing_handler (rcon);
1897 solve_singularity_handler sing_handler,
1898 bool calc_cond)
const 1908 if (nr != nc || nr !=
b_nr)
1909 (*current_liboctave_error_handler)
1910 (
"matrix dimension mismatch solution of linear equations");
1912 if (nr == 0 ||
b_nc == 0)
1916 volatile int typ = mattype.
type ();
1929 anorm =
norm1 (atmp);
1933 F77_XFCN (cpotrf, CPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1935 F77_CHAR_ARG_LEN (1)));
1957 F77_XFCN (cpocon, CPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1960 F77_CHAR_ARG_LEN (1)));
1967 volatile float rcond_plus_one = rcon + 1.0;
1974 sing_handler (rcon);
1985 F77_XFCN (cpotrs, CPOTRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1988 F77_CHAR_ARG_LEN (1)));
2017 anorm =
norm1 (atmp);
2040 sing_handler (rcon);
2053 F77_XFCN (cgecon, CGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
2056 F77_CHAR_ARG_LEN (1)));
2063 volatile float rcond_plus_one = rcon + 1.0;
2070 sing_handler (rcon);
2082 F77_XFCN (cgetrs, CGETRS, (F77_CONST_CHAR_ARG2 (&job, 1),
2085 F77_CHAR_ARG_LEN (1)));
2110 return solve (mattype,
b, info, rcon,
nullptr);
2118 return solve (mattype,
b, info, rcon,
nullptr);
2125 return solve (mattype,
b, info, rcon,
nullptr);
2131 solve_singularity_handler sing_handler,
2135 return solve (mattype,
tmp, info, rcon, sing_handler, singular_fallback,
2145 return solve (mattype,
b, info, rcon,
nullptr);
2153 return solve (mattype,
b, info, rcon,
nullptr);
2160 return solve (mattype,
b, info, rcon,
nullptr);
2166 solve_singularity_handler sing_handler,
2167 bool singular_fallback,
2171 int typ = mattype.
type ();
2174 typ = mattype.
type (*
this);
2178 retval =
utsolve (mattype,
b, info, rcon, sing_handler,
true, transt);
2181 retval =
ltsolve (mattype,
b, info, rcon, sing_handler,
true, transt);
2189 retval =
fsolve (mattype,
b, info, rcon, sing_handler,
true);
2191 (*current_liboctave_error_handler) (
"unknown matrix type");
2230 solve_singularity_handler sing_handler,
2234 sing_handler, transt);
2243 return solve (mattype,
b, info, rcon,
nullptr);
2252 return solve (mattype,
b, info, rcon,
nullptr);
2260 return solve (mattype,
b, info, rcon,
nullptr);
2267 solve_singularity_handler sing_handler,
2272 tmp =
solve (mattype,
tmp, info, rcon, sing_handler,
true, transt);
2273 return tmp.column (static_cast<octave_idx_type> (0));
2281 return solve (
b, info, rcon,
nullptr);
2288 return solve (
b, info, rcon,
nullptr);
2295 return solve (
b, info, rcon,
nullptr);
2301 solve_singularity_handler sing_handler,
2305 return solve (
tmp, info, rcon, sing_handler, transt);
2313 return solve (
b, info, rcon,
nullptr);
2321 return solve (
b, info, rcon,
nullptr);
2328 return solve (
b, info, rcon,
nullptr);
2334 solve_singularity_handler sing_handler,
2338 return solve (mattype,
b, info, rcon, sing_handler,
true, transt);
2367 solve_singularity_handler sing_handler,
2378 return solve (
b, info, rcon,
nullptr);
2386 return solve (
b, info, rcon,
nullptr);
2394 return solve (
b, info, rcon,
nullptr);
2401 solve_singularity_handler sing_handler,
2405 return solve (mattype,
b, info, rcon, sing_handler, transt);
2446 return lssolve (
b, info, rank, rcon);
2455 return lssolve (
b, info, rank, rcon);
2463 return lssolve (
b, info, rank, rcon);
2472 F77_INT nrhs = octave::to_f77_int (
b.cols ());
2481 (*current_liboctave_error_handler)
2482 (
"matrix dimension mismatch solution of linear equations");
2484 if (m == 0 || n == 0 ||
b_nc == 0)
2488 volatile F77_INT minmn = (m < n ? m : n);
2489 F77_INT maxmn = (m > n ? m : n);
2496 for (
F77_INT j = 0; j < nrhs; j++)
2508 float *ps =
s.fortran_vec ();
2517 F77_CONST_CHAR_ARG2 (
" ", 1),
2519 F77_CHAR_ARG_LEN (6)
2520 F77_CHAR_ARG_LEN (1));
2524 F77_CONST_CHAR_ARG2 (
" ", 1),
2525 m, n, nrhs, -1, mnthr
2526 F77_CHAR_ARG_LEN (6)
2527 F77_CHAR_ARG_LEN (1));
2532 float dminmn =
static_cast<float> (minmn);
2533 float dsmlsizp1 =
static_cast<float> (smlsiz+1);
2541 F77_INT lrwork = minmn*(10 + 2*smlsiz + 8*nlvl)
2544 n*(1+nrhs) + 2*nrhs);
2550 F77_INT liwork = 3 * minmn * nlvl + 11 * minmn;
2562 lwork, prwork, piwork, tmp_info));
2571 if (n > m && n >= mnthr)
2584 const F77_INT lworkaround = 4*m + m*m + addend;
2587 work(0) = lworkaround;
2591 F77_INT lworkaround = 2*m + m*nrhs;
2594 work(0) = lworkaround;
2600 anorm =
norm1 (*
this);
2618 maxmn, ps, rcon, tmp_rank,
2620 lwork, prwork, piwork, tmp_info));
2625 if (
s.elem (0) == 0.0)
2628 rcon =
s.elem (minmn - 1) /
s.elem (0);
2676 return lssolve (
b, info, rank, rcon);
2685 return lssolve (
b, info, rank, rcon);
2694 return lssolve (
b, info, rank, rcon);
2710 F77_INT b_nel = octave::to_f77_int (
b.numel ());
2713 (*current_liboctave_error_handler)
2714 (
"matrix dimension mismatch solution of linear equations");
2716 if (m == 0 || n == 0)
2720 volatile F77_INT minmn = (m < n ? m : n);
2721 F77_INT maxmn = (m > n ? m : n);
2739 float *ps =
s.fortran_vec ();
2748 F77_CONST_CHAR_ARG2 (
" ", 1),
2750 F77_CHAR_ARG_LEN (6)
2751 F77_CHAR_ARG_LEN (1));
2756 float dminmn =
static_cast<float> (minmn);
2757 float dsmlsizp1 =
static_cast<float> (smlsiz+1);
2764 F77_INT lrwork = minmn*(10 + 2*smlsiz + 8*nlvl)
2765 + 3*smlsiz*nrhs + (smlsiz+1)*(smlsiz+1);
2771 F77_INT liwork = 3 * minmn * nlvl + 11 * minmn;
2783 lwork, prwork, piwork, tmp_info));
2795 maxmn, ps, rcon, tmp_rank,
2797 prwork, piwork, tmp_info));
2804 if (
s.elem (0) == 0.0)
2807 rcon =
s.elem (minmn - 1) /
s.elem (0);
2841 F77_INT a_len = octave::to_f77_int (
a.numel ());
2846 F77_XFCN (cgemm, CGEMM, (F77_CONST_CHAR_ARG2 (
"N", 1),
2847 F77_CONST_CHAR_ARG2 (
"N", 1),
2850 F77_CHAR_ARG_LEN (1)
2851 F77_CHAR_ARG_LEN (1)));
2945 if (nr == 0 || nc == 0)
2966 if (nr == 0 || nc == 0)
3038 if (nr == 1 || nc == 1)
3099 if (nr > 0 && nc > 0)
3114 for (idx_j = 0; idx_j < nc; idx_j++)
3116 tmp_min =
elem (
i, idx_j);
3120 abs_min = (real_only ? tmp_min.real ()
3135 if (abs_tmp < abs_min)
3146 idx_arg.
elem (
i) = 0;
3151 idx_arg.
elem (
i) = idx_j;
3174 if (nr > 0 && nc > 0)
3189 for (idx_j = 0; idx_j < nc; idx_j++)
3191 tmp_max =
elem (
i, idx_j);
3195 abs_max = (real_only ? tmp_max.real ()
3210 if (abs_tmp > abs_max)
3221 idx_arg.
elem (
i) = 0;
3226 idx_arg.
elem (
i) = idx_j;
3249 if (nr > 0 && nc > 0)
3264 for (idx_i = 0; idx_i < nr; idx_i++)
3266 tmp_min =
elem (idx_i, j);
3270 abs_min = (real_only ? tmp_min.real ()
3285 if (abs_tmp < abs_min)
3296 idx_arg.
elem (j) = 0;
3300 result.elem (j) = tmp_min;
3301 idx_arg.
elem (j) = idx_i;
3324 if (nr > 0 && nc > 0)
3339 for (idx_i = 0; idx_i < nr; idx_i++)
3341 tmp_max =
elem (idx_i, j);
3345 abs_max = (real_only ? tmp_max.real ()
3360 if (abs_tmp > abs_max)
3371 idx_arg.
elem (j) = 0;
3375 result.elem (j) = tmp_max;
3376 idx_arg.
elem (j) = idx_i;
3407 if (nr > 0 && nc > 0)
3413 tmp = octave_read_value<FloatComplex> (
is);
3415 a.elem (
i, j) =
tmp;
3480 F77_XFCN (ctrsyl, CTRSYL, (F77_CONST_CHAR_ARG2 (
"N", 1),
3481 F77_CONST_CHAR_ARG2 (
"N", 1),
3484 F77_CHAR_ARG_LEN (1)
3485 F77_CHAR_ARG_LEN (1)));
3538 return trans ? (
conj ?
'C' :
'T') :
'N';
3554 F77_INT a_nr = octave::to_f77_int (tra ?
a.cols () :
a.rows ());
3555 F77_INT a_nc = octave::to_f77_int (tra ?
a.rows () :
a.cols ());
3557 F77_INT b_nr = octave::to_f77_int (trb ?
b.cols () :
b.rows ());
3558 F77_INT b_nc = octave::to_f77_int (trb ?
b.rows () :
b.cols ());
3565 else if (
a.data () ==
b.data () &&
a_nr ==
b_nc && tra != trb)
3567 F77_INT lda = octave::to_f77_int (
a.rows ());
3580 F77_XFCN (cherk, CHERK, (F77_CONST_CHAR_ARG2 (
"U", 1),
3581 F77_CONST_CHAR_ARG2 (&ctra, 1),
3584 F77_CHAR_ARG_LEN (1)
3585 F77_CHAR_ARG_LEN (1)));
3592 F77_XFCN (csyrk, CSYRK, (F77_CONST_CHAR_ARG2 (
"U", 1),
3593 F77_CONST_CHAR_ARG2 (&ctra, 1),
3596 F77_CHAR_ARG_LEN (1)
3597 F77_CHAR_ARG_LEN (1)));
3607 F77_INT lda = octave::to_f77_int (
a.rows ());
3608 F77_INT tda = octave::to_f77_int (
a.cols ());
3609 F77_INT ldb = octave::to_f77_int (
b.rows ());
3610 F77_INT tdb = octave::to_f77_int (
b.cols ());
3633 else if (
b_nc == 1 && ! cjb)
3636 F77_XFCN (cgemv, CGEMV, (F77_CONST_CHAR_ARG2 (&ctra, 1),
3639 F77_CHAR_ARG_LEN (1)));
3641 else if (
a_nr == 1 && ! cja && ! cjb)
3644 F77_XFCN (cgemv, CGEMV, (F77_CONST_CHAR_ARG2 (&crevtrb, 1),
3647 F77_CHAR_ARG_LEN (1)));
3653 F77_XFCN (cgemm, CGEMM, (F77_CONST_CHAR_ARG2 (&ctra, 1),
3654 F77_CONST_CHAR_ARG2 (&ctrb, 1),
3657 F77_CHAR_ARG_LEN (1)
3658 F77_CHAR_ARG_LEN (1)));
3674 #define EMPTY_RETURN_CHECK(T) \ 3675 if (nr == 0 || nc == 0) \ 3710 if (nr !=
b.rows () || nc !=
b.columns ())
3712 (
"two-arg min requires same size arguments");
3720 bool columns_are_real_only =
true;
3726 columns_are_real_only =
false;
3731 if (columns_are_real_only)
3782 if (nr !=
b.rows () || nc !=
b.columns ())
3784 (
"two-arg max requires same size arguments");
3792 bool columns_are_real_only =
true;
3798 columns_are_real_only =
false;
3803 if (columns_are_real_only)
3832 if (x2.
numel () != m)
3834 (
"linspace: vectors must be of equal length");
3851 delta[
i] = (x2(
i) - x1(
i)) / (n - 1.0f);
3855 retval(
i, j) = x1(
i) +
static_cast<float> (j)*delta[
i];
FloatComplexNDArray sumsq(int dim=-1) const
octave_idx_type rows(void) const
FloatComplexNDArray cumsum(int dim=-1) const
FloatColumnVector extract_diag(octave_idx_type k=0) const
void mx_inline_add2(size_t n, R *r, const X *x)
FloatComplexMatrix transpose(void) const
FloatComplexMatrix finverse(MatrixType &mattype, octave_idx_type &info, float &rcon, bool force, bool calc_cond) const
FloatMatrix abs(void) const
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT F77_DBLE * V
void mx_inline_sub2(size_t n, R *r, const X *x)
#define MM_BOOL_OPS(M1, M2)
base_det< FloatComplex > FloatComplexDET
FloatComplexMatrix diag(octave_idx_type k=0) const
static char get_blas_trans_arg(bool trans, bool conj)
const FloatComplex * data(void) const
FloatComplexMatrix fourier2d(void) const
FloatComplexMatrix stack(const FloatMatrix &a) const
static const idx_vector colon
identity matrix If supplied two scalar respectively For allows like xample val
bool ishermitian(void) const
FloatComplexNDArray cumprod(int dim=-1) const
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
FloatComplexMatrix utsolve(MatrixType &mattype, const FloatComplexMatrix &b, octave_idx_type &info, float &rcon, solve_singularity_handler sing_handler, bool calc_cond=false, blas_trans_type transt=blas_no_trans) const
#define SM_BOOL_OPS(S, M)
boolMatrix any(int dim=-1) const
FloatNDArray abs(void) const
boolNDArray all(int dim=-1) const
const T * fortran_vec(void) const
void octave_write_complex(std::ostream &os, const Complex &c)
FloatComplexNDArray diag(octave_idx_type k=0) const
static int ifft(const Complex *in, Complex *out, size_t npts, size_t nsamples=1, octave_idx_type stride=1, octave_idx_type dist=-1)
static int fftNd(const double *, Complex *, const int, const dim_vector &)
FloatComplexNDArray sum(int dim=-1) const
subroutine xilaenv(ispec, name, opts, n1, n2, n3, n4, retval)
octave_idx_type columns(void) const
FloatComplex & elem(octave_idx_type n)
FloatComplexMatrix pseudo_inverse(float tol=0.0) const
FloatComplexMatrix xgemm(const FloatComplexMatrix &a, const FloatComplexMatrix &b, blas_trans_type transa, blas_trans_type transb)
subroutine cfftb(n, c, wsave)
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
FloatComplexRowVector column_min(void) const
FloatComplexMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
#define F77_XFCN(f, F, args)
FloatComplexMatrix & fill(float val)
Complex log2(const Complex &x)
bool ishermitian(void) const
FloatComplexMatrix lssolve(const FloatMatrix &b) const
FloatComplexMatrix hermitian(void) const
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
octave_idx_type cols(void) const
Array< T > & insert(const Array< T > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
octave_value resize(const dim_vector &dv, bool fill=false) const
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
FloatComplexMatrix Givens(const FloatComplex &x, const FloatComplex &y)
FloatComplexMatrix sumsq(int dim=-1) const
FloatComplexMatrix fourier(void) const
subroutine cffti(n, wsave)
FloatColumnVector extract(octave_idx_type r1, octave_idx_type r2) const
FloatComplexMatrix & insert(const FloatMatrix &a, octave_idx_type r, octave_idx_type c)
static int fft(const double *in, Complex *out, size_t npts, size_t nsamples=1, octave_idx_type stride=1, octave_idx_type dist=-1)
int type(bool quiet=true)
FloatComplexMatrix inverse(void) const
Array< FloatComplex > index(const idx_vector &i) const
Indexing without resizing.
bool issquare(void) const
T schur_matrix(void) const
FloatComplexMatrix operator*(const FloatColumnVector &v, const FloatComplexRowVector &a)
FloatComplexMatrix min(const FloatComplex &c, const FloatComplexMatrix &m)
std::ostream & operator<<(std::ostream &os, const FloatComplexMatrix &a)
FloatComplexDET determinant(void) const
FloatComplexMatrix & operator-=(const FloatDiagMatrix &a)
FloatComplexNDArray prod(int dim=-1) const
boolNDArray any(int dim=-1) const
FloatComplexMatrix tinverse(MatrixType &mattype, octave_idx_type &info, float &rcon, bool force, bool calc_cond) const
FloatComplexMatrix & operator+=(const FloatDiagMatrix &a)
double norm(const ColumnVector &v)
FloatComplexMatrix Sylvester(const FloatComplexMatrix &a, const FloatComplexMatrix &b, const FloatComplexMatrix &c)
bool operator==(const FloatComplexMatrix &a) const
void resize(const dim_vector &dv, const T &rfv)
Resizing (with fill).
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
subroutine cfftf(n, c, wsave)
bool operator!=(const FloatComplexMatrix &a) const
FloatComplexRowVector row(octave_idx_type i) const
FloatComplexMatrix cumprod(int dim=-1) const
void mark_as_unsymmetric(void)
#define EMPTY_RETURN_CHECK(T)
boolMatrix all(int dim=-1) const
T unitary_matrix(void) const
static float norm1(const FloatComplexMatrix &a)
void mark_as_rectangular(void)
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
FloatComplexMatrix conj(const FloatComplexMatrix &a)
F77_RET_T F77_FUNC(xerbla, XERBLA)
With real return the complex result
FloatComplex & xelem(octave_idx_type n)
FloatComplexMatrix fsolve(MatrixType &mattype, const FloatComplexMatrix &b, octave_idx_type &info, float &rcon, solve_singularity_handler sing_handler, bool calc_cond=false) const
friend class FloatComplexColumnVector
FloatComplexMatrix append(const FloatMatrix &a) const
N Dimensional Array with copy-on-write semantics.
This is a simple wrapper template that will subclass an Array<T> type or any later type derived from ...
subroutine xcdotc(n, zx, incx, zy, incy, retval)
bool row_is_real_only(octave_idx_type) const
octave_f77_int_type F77_INT
FloatComplexColumnVector row_max(void) const
FloatComplexMatrix ifourier2d(void) const
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol NaN(Not a Number). NaN is the result of operations which do not produce a well defined 0 result. Common operations which produce a NaN are arithmetic with infinity ex($\infty - \infty$)
static const FloatComplex FloatComplex_NaN_result(octave::numeric_limits< float >::NaN(), octave::numeric_limits< float >::NaN())
FloatComplexMatrix cumsum(int dim=-1) const
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
FloatComplexColumnVector column(octave_idx_type i) const
the element is set to zero In other the statement xample y
void scale(Matrix &m, double x, double y, double z)
friend OCTAVE_API FloatComplexMatrix conj(const FloatComplexMatrix &a)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
#define MS_BOOL_OPS(M, S)
#define MM_CMP_OPS(M1, M2)
char get_blas_char(blas_trans_type transt)
FloatComplexMatrix linspace(const FloatComplexColumnVector &x1, const FloatComplexColumnVector &x2, octave_idx_type n)
FloatComplexMatrix extract_n(octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const
#define F77_CONST_CMPLX_ARG(x)
ColumnVector imag(const ComplexColumnVector &a)
std::complex< float > FloatComplex
FloatComplexMatrix prod(int dim=-1) const
FloatComplexMatrix sum(int dim=-1) const
octave_idx_type numel(void) const
Number of elements in the array.
ColumnVector real(const ComplexColumnVector &a)
bool mx_inline_equal(size_t n, const T1 *x, const T2 *y)
write the output to stdout if nargout is
FloatComplexColumnVector row_min(void) const
FloatComplexRowVector column_max(void) const
Vector representing the dimensions (size) of an Array.
FloatComplexMatrix max(const FloatComplex &c, const FloatComplexMatrix &m)
FloatComplexMatrix ifourier(void) const
void warn_singular_matrix(double rcond)
subroutine xcdotu(n, zx, incx, zy, incy, retval)
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE * x
bool column_is_real_only(octave_idx_type) const
FloatComplexMatrix ltsolve(MatrixType &mattype, const FloatComplexMatrix &b, octave_idx_type &info, float &rcon, solve_singularity_handler sing_handler, bool calc_cond=false, blas_trans_type transt=blas_no_trans) const
std::istream & operator>>(std::istream &is, FloatComplexMatrix &a)
FloatComplexMatrix solve(MatrixType &mattype, const FloatMatrix &b) const