25 #if defined (HAVE_CONFIG_H) 143 elem (
i, j) =
static_cast<unsigned char> (
a.elem (
i, j));
160 if (
rows () !=
a.rows () ||
cols () !=
a.cols ())
169 return !(*
this ==
a);
199 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
200 (*current_liboctave_error_handler) (
"range error for insert");
219 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
220 (*current_liboctave_error_handler) (
"range error for insert");
239 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
240 (*current_liboctave_error_handler) (
"range error for insert");
260 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
261 (*current_liboctave_error_handler) (
"range error for insert");
291 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
292 (*current_liboctave_error_handler) (
"range error for insert");
306 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
307 (*current_liboctave_error_handler) (
"range error for insert");
327 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
328 (*current_liboctave_error_handler) (
"range error for insert");
351 if (nr > 0 && nc > 0)
369 if (nr > 0 && nc > 0)
388 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
389 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
390 (*current_liboctave_error_handler) (
"range error for fill");
395 if (r2 >= r1 && c2 >= c1)
414 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
415 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
416 (*current_liboctave_error_handler) (
"range error for fill");
421 if (r2 >= r1 && c2 >=c1)
443 retval.insert (*
this, 0, 0);
444 retval.insert (
a, 0, nc_insert);
454 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
458 retval.insert (*
this, 0, 0);
459 retval.insert (
a, 0, nc_insert);
468 if (nr !=
a.numel ())
473 retval.insert (*
this, 0, 0);
474 retval.insert (
a, 0, nc_insert);
488 retval.insert (*
this, 0, 0);
489 retval.insert (
a, 0, nc_insert);
503 retval.insert (*
this, 0, 0);
504 retval.insert (
a, 0, nc_insert);
514 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
518 retval.insert (*
this, 0, 0);
519 retval.insert (
a, 0, nc_insert);
528 if (nr !=
a.numel ())
533 retval.insert (*
this, 0, 0);
534 retval.insert (
a, 0, nc_insert);
548 retval.insert (*
this, 0, 0);
549 retval.insert (
a, 0, nc_insert);
563 retval.insert (*
this, 0, 0);
564 retval.insert (
a, nr_insert, 0);
573 if (nc !=
a.numel ())
578 retval.insert (*
this, 0, 0);
579 retval.insert (
a, nr_insert, 0);
589 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
593 retval.insert (*
this, 0, 0);
594 retval.insert (
a, nr_insert, 0);
608 retval.insert (*
this, 0, 0);
609 retval.insert (
a, nr_insert, 0);
623 retval.insert (*
this, 0, 0);
624 retval.insert (
a, nr_insert, 0);
633 if (nc !=
a.numel ())
638 retval.insert (*
this, 0, 0);
639 retval.insert (
a, nr_insert, 0);
649 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
653 retval.insert (*
this, 0, 0);
654 retval.insert (
a, nr_insert, 0);
668 retval.insert (*
this, 0, 0);
669 retval.insert (
a, nr_insert, 0);
676 return do_mx_unary_map<Complex, Complex, std::conj<double>> (
a);
741 return inverse (mattype, info, rcon, 0, 0);
749 return inverse (mattype, info, rcon, 0, 0);
754 bool calc_cond)
const 757 return inverse (mattype, info, rcon, force, calc_cond);
765 return inverse (mattype, info, rcon, 0, 0);
772 return inverse (mattype, info, rcon, 0, 0);
777 double& rcon,
bool force,
bool calc_cond)
const 784 if (nr != nc || nr == 0 || nc == 0)
785 (*current_liboctave_error_handler) (
"inverse requires square matrix");
787 int typ = mattype.
type ();
795 F77_XFCN (ztrtri, ZTRTRI,(F77_CONST_CHAR_ARG2 (&uplo, 1),
796 F77_CONST_CHAR_ARG2 (&udiag, 1),
799 F77_CHAR_ARG_LEN (1)));
815 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&job, 1),
816 F77_CONST_CHAR_ARG2 (&uplo, 1),
817 F77_CONST_CHAR_ARG2 (&udiag, 1),
822 F77_CHAR_ARG_LEN (1)));
824 if (ztrcon_info != 0)
828 if (info == -1 && ! force)
836 double& rcon,
bool force,
bool calc_cond)
const 844 (*current_liboctave_error_handler) (
"inverse requires square matrix");
847 F77_INT *pipvt = ipvt.fortran_vec ();
866 lwork = (lwork < 2 * nc ? 2 * nc : lwork);
900 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
903 F77_CHAR_ARG_LEN (1)));
905 if (zgecon_info != 0)
909 if ((info == -1 && ! force)
919 if (zgetri_info != 0)
931 double& rcon,
bool force,
bool calc_cond)
const 933 int typ = mattype.
type (
false);
937 typ = mattype.
type (*
this);
940 ret =
tinverse (mattype, info, rcon, force, calc_cond);
949 rcon =
chol.rcond ();
952 ret =
chol.inverse ();
959 ret =
finverse (mattype, info, rcon, force, calc_cond);
961 if ((calc_cond || mattype.
ishermitian ()) && rcon == 0.)
995 * std::numeric_limits<double>::epsilon ();
1001 while (r >= 0 && sigma.
elem (r) < tol)
1017 #if defined (HAVE_FFTW) 1022 size_t nr =
rows ();
1023 size_t nc =
cols ();
1027 size_t npts, nsamples;
1029 if (nr == 1 || nc == 1)
1031 npts = (nr > nc ? nr : nc);
1051 size_t nr =
rows ();
1052 size_t nc =
cols ();
1056 size_t npts, nsamples;
1058 if (nr == 1 || nc == 1)
1060 npts = (nr > nc ? nr : nc);
1120 if (nr == 1 || nc == 1)
1122 npts = octave::to_f77_int (nr > nc ? nr : nc);
1127 npts = octave::to_f77_int (nr);
1134 Complex *pwsave = wsave.fortran_vec ();
1163 if (nr == 1 || nc == 1)
1165 npts = octave::to_f77_int (nr > nc ? nr : nc);
1170 npts = octave::to_f77_int (nr);
1177 Complex *pwsave = wsave.fortran_vec ();
1193 tmp_data[j] = tmp_data[j] / static_cast<double> (npts);
1208 if (nr == 1 || nc == 1)
1210 npts = (nr > nc ? nr : nc);
1222 Complex *pwsave = wsave.fortran_vec ();
1229 for (
F77_INT j = 0; j < nsamples; j++)
1242 pwsave = wsave.fortran_vec ();
1249 for (
F77_INT j = 0; j < nsamples; j++)
1254 prow[
i] = tmp_data[
i*nr + j];
1260 tmp_data[
i*nr + j] = prow[
i];
1276 if (nr == 1 || nc == 1)
1278 npts = (nr > nc ? nr : nc);
1290 Complex *pwsave = wsave.fortran_vec ();
1297 for (
F77_INT j = 0; j < nsamples; j++)
1305 for (
F77_INT j = 0; j < npts*nsamples; j++)
1306 tmp_data[j] = tmp_data[j] / static_cast<double> (npts);
1313 pwsave = wsave.fortran_vec ();
1320 for (
F77_INT j = 0; j < nsamples; j++)
1325 prow[
i] = tmp_data[
i*nr + j];
1331 tmp_data[
i*nr + j] = prow[
i] / static_cast<double> (npts);
1356 bool calc_cond)
const 1359 return determinant (mattype, info, rcon, calc_cond);
1365 bool calc_cond)
const 1376 (*current_liboctave_error_handler) (
"matrix must be square");
1378 volatile int typ = mattype.
type ();
1385 typ = mattype.
type (*
this);
1401 anorm =
norm1 (*
this);
1406 F77_XFCN (zpotrf, ZPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1408 F77_CHAR_ARG_LEN (1)));
1425 F77_XFCN (zpocon, ZPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1428 F77_CHAR_ARG_LEN (1)));
1442 (*current_liboctave_error_handler) (
"det: invalid dense matrix type");
1455 double anorm =
norm1 (*
this);
1488 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1491 F77_CHAR_ARG_LEN (1)));
1519 return rcond (mattype);
1530 (*current_liboctave_error_handler) (
"matrix must be square");
1532 if (nr == 0 || nc == 0)
1536 volatile int typ = mattype.
type ();
1539 typ = mattype.
type (*
this);
1555 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1556 F77_CONST_CHAR_ARG2 (&uplo, 1),
1557 F77_CONST_CHAR_ARG2 (&dia, 1),
1560 F77_CHAR_ARG_LEN (1)
1561 F77_CHAR_ARG_LEN (1)
1562 F77_CHAR_ARG_LEN (1)));
1568 (*current_liboctave_error_handler)
1569 (
"permuted triangular matrix not implemented");
1583 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1584 F77_CONST_CHAR_ARG2 (&uplo, 1),
1585 F77_CONST_CHAR_ARG2 (&dia, 1),
1588 F77_CHAR_ARG_LEN (1)
1589 F77_CHAR_ARG_LEN (1)
1590 F77_CHAR_ARG_LEN (1)));
1596 (*current_liboctave_error_handler)
1597 (
"permuted triangular matrix not implemented");
1600 double anorm = -1.0;
1610 anorm =
norm1 (atmp);
1612 F77_XFCN (zpotrf, ZPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1614 F77_CHAR_ARG_LEN (1)));
1630 F77_XFCN (zpocon, ZPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1633 F77_CHAR_ARG_LEN (1)));
1651 anorm =
norm1 (atmp);
1673 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1676 F77_CHAR_ARG_LEN (1)));
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 ();
1715 (*current_liboctave_error_handler) (
"incorrect matrix type");
1721 (*current_liboctave_error_handler)
1722 (
"permuted triangular matrix not implemented");
1735 F77_XFCN (ztrtrs, ZTRTRS, (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 (ztrcon, ZTRCON, (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 double rcond_plus_one = rcon + 1.0;
1778 sing_handler (rcon);
1803 (*current_liboctave_error_handler)
1804 (
"matrix dimension mismatch solution of linear equations");
1806 if (nr == 0 || nc == 0 ||
b_nc == 0)
1810 volatile int typ = mattype.
type ();
1813 (*current_liboctave_error_handler) (
"incorrect matrix type");
1819 (*current_liboctave_error_handler)
1820 (
"permuted triangular matrix not implemented");
1833 F77_XFCN (ztrtrs, ZTRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1834 F77_CONST_CHAR_ARG2 (&trans, 1),
1835 F77_CONST_CHAR_ARG2 (&dia, 1),
1838 F77_CHAR_ARG_LEN (1)
1839 F77_CHAR_ARG_LEN (1)
1840 F77_CHAR_ARG_LEN (1)));
1855 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1856 F77_CONST_CHAR_ARG2 (&uplo, 1),
1857 F77_CONST_CHAR_ARG2 (&dia, 1),
1860 F77_CHAR_ARG_LEN (1)
1861 F77_CHAR_ARG_LEN (1)
1862 F77_CHAR_ARG_LEN (1)));
1869 volatile double rcond_plus_one = rcon + 1.0;
1876 sing_handler (rcon);
1890 bool calc_cond)
const 1900 if (nr != nc || nr !=
b_nr)
1901 (*current_liboctave_error_handler)
1902 (
"matrix dimension mismatch solution of linear equations");
1904 if (nr == 0 ||
b_nc == 0)
1908 volatile int typ = mattype.
type ();
1921 anorm =
norm1 (atmp);
1925 F77_XFCN (zpotrf, ZPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1927 F77_CHAR_ARG_LEN (1)));
1949 F77_XFCN (zpocon, ZPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1952 F77_CHAR_ARG_LEN (1)));
1959 volatile double rcond_plus_one = rcon + 1.0;
1966 sing_handler (rcon);
1977 F77_XFCN (zpotrs, ZPOTRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1980 F77_CHAR_ARG_LEN (1)));
2009 anorm =
norm1 (atmp);
2032 sing_handler (rcon);
2045 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
2048 F77_CHAR_ARG_LEN (1)));
2055 volatile double rcond_plus_one = rcon + 1.0;
2062 sing_handler (rcon);
2074 F77_XFCN (zgetrs, ZGETRS, (F77_CONST_CHAR_ARG2 (&job, 1),
2077 F77_CHAR_ARG_LEN (1)));
2101 return solve (mattype,
b, info, rcon,
nullptr);
2109 return solve (mattype,
b, info, rcon,
nullptr);
2116 return solve (mattype,
b, info, rcon,
nullptr);
2126 return solve (mattype,
tmp, info, rcon, sing_handler, singular_fallback,
2135 return solve (mattype,
b, info, rcon,
nullptr);
2143 return solve (mattype,
b, info, rcon,
nullptr);
2150 return solve (mattype,
b, info, rcon,
nullptr);
2160 int typ = mattype.
type ();
2163 typ = mattype.
type (*
this);
2167 retval =
utsolve (mattype,
b, info, rcon, sing_handler,
true, transt);
2169 retval =
ltsolve (mattype,
b, info, rcon, sing_handler,
true, transt);
2177 retval =
fsolve (mattype,
b, info, rcon, sing_handler,
true);
2179 (*current_liboctave_error_handler) (
"unknown matrix type");
2229 return solve (mattype,
b, info, rcon,
nullptr);
2237 return solve (mattype,
b, info, rcon,
nullptr);
2244 return solve (mattype,
b, info, rcon,
nullptr);
2255 tmp =
solve (mattype,
tmp, info, rcon, sing_handler,
true, transt);
2256 return tmp.column (static_cast<octave_idx_type> (0));
2264 return solve (
b, info, rcon,
nullptr);
2271 return solve (
b, info, rcon,
nullptr);
2278 return solve (
b, info, rcon,
nullptr);
2287 return solve (
tmp, info, rcon, sing_handler, transt);
2295 return solve (
b, info, rcon,
nullptr);
2302 return solve (
b, info, rcon,
nullptr);
2309 return solve (
b, info, rcon,
nullptr);
2319 return solve (mattype,
b, info, rcon, sing_handler,
true, transt);
2358 return solve (
b, info, rcon,
nullptr);
2365 return solve (
b, info, rcon,
nullptr);
2372 return solve (
b, info, rcon,
nullptr);
2382 return solve (mattype,
b, info, rcon, sing_handler, transt);
2423 return lssolve (
b, info, rank, rcon);
2431 return lssolve (
b, info, rank, rcon);
2439 return lssolve (
b, info, rank, rcon);
2448 F77_INT nrhs = octave::to_f77_int (
b.cols ());
2457 (*current_liboctave_error_handler)
2458 (
"matrix dimension mismatch solution of linear equations");
2460 if (m == 0 || n == 0 ||
b_nc == 0)
2464 volatile F77_INT minmn = (m < n ? m : n);
2465 F77_INT maxmn = (m > n ? m : n);
2472 for (
F77_INT j = 0; j < nrhs; j++)
2484 double *ps =
s.fortran_vec ();
2493 F77_CONST_CHAR_ARG2 (
" ", 1),
2495 F77_CHAR_ARG_LEN (6)
2496 F77_CHAR_ARG_LEN (1));
2500 F77_CONST_CHAR_ARG2 (
" ", 1),
2501 m, n, nrhs, -1, mnthr
2502 F77_CHAR_ARG_LEN (6)
2503 F77_CHAR_ARG_LEN (1));
2508 double dminmn =
static_cast<double> (minmn);
2509 double dsmlsizp1 =
static_cast<double> (smlsiz+1);
2517 F77_INT lrwork = minmn*(10 + 2*smlsiz + 8*nlvl)
2520 n*(1+nrhs) + 2*nrhs);
2526 F77_INT liwork = 3 * minmn * nlvl + 11 * minmn;
2538 lwork, prwork, piwork, tmp_info));
2547 if (n > m && n >= mnthr)
2560 const F77_INT lworkaround = 4*m + m*m + addend;
2563 work(0) = lworkaround;
2567 F77_INT lworkaround = 2*m + m*nrhs;
2570 work(0) = lworkaround;
2576 anorm =
norm1 (*
this);
2594 maxmn, ps, rcon, tmp_rank,
2596 lwork, prwork, piwork, tmp_info));
2601 if (
s.elem (0) == 0.0)
2604 rcon =
s.elem (minmn - 1) /
s.elem (0);
2651 return lssolve (
b, info, rank, rcon);
2660 return lssolve (
b, info, rank, rcon);
2668 return lssolve (
b, info, rank, rcon);
2683 F77_INT b_nel = octave::to_f77_int (
b.numel ());
2686 (*current_liboctave_error_handler)
2687 (
"matrix dimension mismatch solution of linear equations");
2689 if (m == 0 || n == 0)
2693 volatile F77_INT minmn = (m < n ? m : n);
2694 F77_INT maxmn = (m > n ? m : n);
2712 double *ps =
s.fortran_vec ();
2721 F77_CONST_CHAR_ARG2 (
" ", 1),
2723 F77_CHAR_ARG_LEN (6)
2724 F77_CHAR_ARG_LEN (1));
2729 double dminmn =
static_cast<double> (minmn);
2730 double dsmlsizp1 =
static_cast<double> (smlsiz+1);
2737 F77_INT lrwork = minmn*(10 + 2*smlsiz + 8*nlvl)
2738 + 3*smlsiz*nrhs + (smlsiz+1)*(smlsiz+1);
2744 F77_INT liwork = 3 * minmn * nlvl + 11 * minmn;
2756 lwork, prwork, piwork, tmp_info));
2768 maxmn, ps, rcon, tmp_rank,
2770 prwork, piwork, tmp_info));
2777 if (
s.elem (0) == 0.0)
2780 rcon =
s.elem (minmn - 1) /
s.elem (0);
2814 F77_INT a_len = octave::to_f77_int (
a.numel ());
2819 F77_XFCN (zgemm, ZGEMM, (F77_CONST_CHAR_ARG2 (
"N", 1),
2820 F77_CONST_CHAR_ARG2 (
"N", 1),
2823 F77_CHAR_ARG_LEN (1)
2824 F77_CHAR_ARG_LEN (1)));
2918 if (nr == 0 || nc == 0)
2939 if (nr == 0 || nc == 0)
3010 if (nr != 1 && nc != 1)
3011 (*current_liboctave_error_handler) (
"diag: expecting vector argument");
3069 if (nr > 0 && nc > 0)
3084 for (idx_j = 0; idx_j < nc; idx_j++)
3086 tmp_min =
elem (
i, idx_j);
3090 abs_min = (real_only ? tmp_min.real ()
3105 if (abs_tmp < abs_min)
3116 idx_arg.
elem (
i) = 0;
3121 idx_arg.
elem (
i) = idx_j;
3144 if (nr > 0 && nc > 0)
3159 for (idx_j = 0; idx_j < nc; idx_j++)
3161 tmp_max =
elem (
i, idx_j);
3165 abs_max = (real_only ? tmp_max.real ()
3180 if (abs_tmp > abs_max)
3191 idx_arg.
elem (
i) = 0;
3196 idx_arg.
elem (
i) = idx_j;
3219 if (nr > 0 && nc > 0)
3234 for (idx_i = 0; idx_i < nr; idx_i++)
3236 tmp_min =
elem (idx_i, j);
3240 abs_min = (real_only ? tmp_min.real ()
3255 if (abs_tmp < abs_min)
3266 idx_arg.
elem (j) = 0;
3270 result.elem (j) = tmp_min;
3271 idx_arg.
elem (j) = idx_i;
3294 if (nr > 0 && nc > 0)
3309 for (idx_i = 0; idx_i < nr; idx_i++)
3311 tmp_max =
elem (idx_i, j);
3315 abs_max = (real_only ? tmp_max.real ()
3330 if (abs_tmp > abs_max)
3341 idx_arg.
elem (j) = 0;
3345 result.elem (j) = tmp_max;
3346 idx_arg.
elem (j) = idx_i;
3377 if (nr > 0 && nc > 0)
3383 tmp = octave_read_value<Complex> (
is);
3385 a.elem (
i, j) =
tmp;
3451 F77_XFCN (ztrsyl, ZTRSYL, (F77_CONST_CHAR_ARG2 (
"N", 1),
3452 F77_CONST_CHAR_ARG2 (
"N", 1),
3455 F77_CHAR_ARG_LEN (1)
3456 F77_CHAR_ARG_LEN (1)));
3509 return trans ? (
conj ?
'C' :
'T') :
'N';
3525 F77_INT a_nr = octave::to_f77_int (tra ?
a.cols () :
a.rows ());
3526 F77_INT a_nc = octave::to_f77_int (tra ?
a.rows () :
a.cols ());
3528 F77_INT b_nr = octave::to_f77_int (trb ?
b.cols () :
b.rows ());
3529 F77_INT b_nc = octave::to_f77_int (trb ?
b.rows () :
b.cols ());
3536 else if (
a.data () ==
b.data () &&
a_nr ==
b_nc && tra != trb)
3538 F77_INT lda = octave::to_f77_int (
a.rows ());
3551 F77_XFCN (zherk, ZHERK, (F77_CONST_CHAR_ARG2 (
"U", 1),
3552 F77_CONST_CHAR_ARG2 (&ctra, 1),
3555 F77_CHAR_ARG_LEN (1)
3556 F77_CHAR_ARG_LEN (1)));
3563 F77_XFCN (zsyrk, ZSYRK, (F77_CONST_CHAR_ARG2 (
"U", 1),
3564 F77_CONST_CHAR_ARG2 (&ctra, 1),
3567 F77_CHAR_ARG_LEN (1)
3568 F77_CHAR_ARG_LEN (1)));
3578 F77_INT lda = octave::to_f77_int (
a.rows ());
3579 F77_INT tda = octave::to_f77_int (
a.cols ());
3580 F77_INT ldb = octave::to_f77_int (
b.rows ());
3581 F77_INT tdb = octave::to_f77_int (
b.cols ());
3604 else if (
b_nc == 1 && ! cjb)
3607 F77_XFCN (zgemv, ZGEMV, (F77_CONST_CHAR_ARG2 (&ctra, 1),
3610 F77_CHAR_ARG_LEN (1)));
3612 else if (
a_nr == 1 && ! cja && ! cjb)
3615 F77_XFCN (zgemv, ZGEMV, (F77_CONST_CHAR_ARG2 (&crevtrb, 1),
3618 F77_CHAR_ARG_LEN (1)));
3624 F77_XFCN (zgemm, ZGEMM, (F77_CONST_CHAR_ARG2 (&ctra, 1),
3625 F77_CONST_CHAR_ARG2 (&ctrb, 1),
3629 F77_CHAR_ARG_LEN (1)
3630 F77_CHAR_ARG_LEN (1)));
3645 #define EMPTY_RETURN_CHECK(T) \ 3646 if (nr == 0 || nc == 0) \ 3681 if (nr !=
b.rows () || nc !=
b.columns ())
3683 (
"two-arg min requires same size arguments");
3691 bool columns_are_real_only =
true;
3697 columns_are_real_only =
false;
3702 if (columns_are_real_only)
3753 if (nr !=
b.rows () || nc !=
b.columns ())
3755 (
"two-arg max requires same size arguments");
3763 bool columns_are_real_only =
true;
3769 columns_are_real_only =
false;
3775 if (columns_are_real_only)
3803 if (x2.
numel () != m)
3805 (
"linspace: vectors must be of equal length");
3822 delta[
i] = (x2(
i) - x1(
i)) / (n - 1.0);
3826 retval(
i, j) = x1(
i) +
static_cast<double> (j)*delta[
i];
ComplexNDArray cumprod(int dim=-1) const
octave_idx_type rows(void) const
ComplexMatrix extract_n(octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const
ComplexMatrix lssolve(const Matrix &b) const
void mx_inline_add2(size_t n, R *r, const X *x)
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT F77_DBLE * V
ComplexMatrix sumsq(int dim=-1) const
ColumnVector extract_diag(octave_idx_type k=0) const
void mx_inline_sub2(size_t n, R *r, const X *x)
#define MM_BOOL_OPS(M1, M2)
ComplexRowVector column_min(void) const
bool operator==(const ComplexMatrix &a) const
bool column_is_real_only(octave_idx_type) const
ComplexDET determinant(void) const
const Complex * data(void) const
void(* solve_singularity_handler)(double rcon)
static const idx_vector colon
subroutine zffti(n, wsave)
ComplexMatrix fourier(void) const
identity matrix If supplied two scalar respectively For allows like xample val
bool ishermitian(void) const
bool row_is_real_only(octave_idx_type) const
bool ishermitian(void) const
ComplexMatrix Sylvester(const ComplexMatrix &a, const ComplexMatrix &b, const ComplexMatrix &c)
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
#define F77_DBLE_CMPLX_ARG(x)
ComplexNDArray sumsq(int dim=-1) const
#define SM_BOOL_OPS(S, M)
const T * fortran_vec(void) const
ComplexMatrix cumsum(int dim=-1) const
ComplexMatrix stack(const Matrix &a) const
void octave_write_complex(std::ostream &os, const Complex &c)
ComplexNDArray 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 &)
ComplexMatrix fourier2d(void) const
ComplexMatrix conj(const ComplexMatrix &a)
ComplexNDArray sum(int dim=-1) const
subroutine xilaenv(ispec, name, opts, n1, n2, n3, n4, retval)
octave_idx_type columns(void) const
Complex & elem(octave_idx_type n)
ComplexMatrix operator*(const ColumnVector &v, const ComplexRowVector &a)
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
ComplexMatrix transpose(void) const
#define F77_XFCN(f, F, args)
Complex log2(const Complex &x)
ComplexMatrix cumprod(int dim=-1) const
ComplexNDArray prod(int dim=-1) 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
subroutine zfftb(n, c, wsave)
ComplexMatrix inverse(void) const
ComplexMatrix fsolve(MatrixType &mattype, const ComplexMatrix &b, octave_idx_type &info, double &rcon, solve_singularity_handler sing_handler, bool calc_cond=false) const
octave_idx_type cols(void) const
octave_value resize(const dim_vector &dv, bool fill=false) const
ComplexMatrix ifourier2d(void) 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
boolMatrix all(int dim=-1) const
ComplexColumnVector row_min(void) const
subroutine xzdotu(n, zx, incx, zy, incy, retval)
ComplexRowVector row(octave_idx_type i) const
ComplexMatrix tinverse(MatrixType &mattype, octave_idx_type &info, double &rcon, bool force, bool calc_cond) const
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)
Array< Complex > index(const idx_vector &i) const
Indexing without resizing.
bool issquare(void) const
ComplexMatrix diag(octave_idx_type k=0) const
T schur_matrix(void) const
ComplexNDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
static const Complex Complex_NaN_result(octave::numeric_limits< double >::NaN(), octave::numeric_limits< double >::NaN())
boolNDArray any(int dim=-1) const
ComplexMatrix & operator-=(const DiagMatrix &a)
std::istream & operator>>(std::istream &is, ComplexMatrix &a)
double norm(const ColumnVector &v)
ComplexMatrix min(const Complex &c, const ComplexMatrix &m)
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)
void mark_as_unsymmetric(void)
boolMatrix any(int dim=-1) const
T unitary_matrix(void) const
ComplexMatrix solve(MatrixType &mattype, const Matrix &b) const
ComplexMatrix finverse(MatrixType &mattype, octave_idx_type &info, double &rcon, bool force, bool calc_cond) const
ColumnVector extract(octave_idx_type r1, octave_idx_type r2) const
ComplexMatrix max(const Complex &c, const ComplexMatrix &m)
static char get_blas_trans_arg(bool trans, bool conj)
void mark_as_rectangular(void)
ComplexMatrix & insert(const Matrix &a, octave_idx_type r, octave_idx_type c)
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
ComplexMatrix & operator+=(const DiagMatrix &a)
friend OCTAVE_API ComplexMatrix conj(const ComplexMatrix &a)
F77_RET_T F77_FUNC(xerbla, XERBLA)
With real return the complex result
ComplexColumnVector row_max(void) const
Complex & xelem(octave_idx_type n)
ComplexMatrix linspace(const ComplexColumnVector &x1, const ComplexColumnVector &x2, octave_idx_type n)
ComplexMatrix utsolve(MatrixType &mattype, const ComplexMatrix &b, octave_idx_type &info, double &rcon, solve_singularity_handler sing_handler, bool calc_cond=false, blas_trans_type transt=blas_no_trans) const
ComplexMatrix xgemm(const ComplexMatrix &a, const ComplexMatrix &b, blas_trans_type transa, blas_trans_type transb)
ComplexNDArray cumsum(int dim=-1) const
subroutine xzdotc(n, zx, incx, zy, incy, retval)
N Dimensional Array with copy-on-write semantics.
#define F77_CONST_DBLE_CMPLX_ARG(x)
This is a simple wrapper template that will subclass an Array<T> type or any later type derived from ...
ComplexMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
bool operator!=(const ComplexMatrix &a) const
octave_f77_int_type F77_INT
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$)
ComplexMatrix Givens(const Complex &x, const Complex &y)
ComplexMatrix ifourier(void) const
ComplexMatrix pseudo_inverse(double tol=0.0) const
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
the element is set to zero In other the statement xample y
void scale(Matrix &m, double x, double y, double z)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
ComplexMatrix & fill(double val)
#define MS_BOOL_OPS(M, S)
#define MM_CMP_OPS(M1, M2)
char get_blas_char(blas_trans_type transt)
static double norm1(const ComplexMatrix &a)
std::ostream & operator<<(std::ostream &os, const ComplexMatrix &a)
ComplexColumnVector column(octave_idx_type i) const
ColumnVector imag(const ComplexColumnVector &a)
base_det< Complex > ComplexDET
ComplexMatrix append(const Matrix &a) const
ComplexMatrix prod(int dim=-1) const
std::complex< double > Complex
ComplexMatrix sum(int dim=-1) const
octave_idx_type numel(void) const
Number of elements in the array.
ColumnVector real(const ComplexColumnVector &a)
ComplexMatrix ltsolve(MatrixType &mattype, const ComplexMatrix &b, octave_idx_type &info, double &rcon, solve_singularity_handler sing_handler, bool calc_cond=false, blas_trans_type transt=blas_no_trans) const
bool mx_inline_equal(size_t n, const T1 *x, const T2 *y)
write the output to stdout if nargout is
boolNDArray all(int dim=-1) const
Vector representing the dimensions (size) of an Array.
void warn_singular_matrix(double rcond)
ComplexRowVector column_max(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 * x
subroutine zfftf(n, c, wsave)
#define EMPTY_RETURN_CHECK(T)
ComplexMatrix hermitian(void) const