26 #if defined (HAVE_CONFIG_H)
144 elem (i, j) =
static_cast<unsigned char> (a.
elem (i, j));
151 (*current_liboctave_error_handler) (
"complex: internal error");
170 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");
203 if (a_nr >0 && a_nc > 0)
220 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
221 (*current_liboctave_error_handler) (
"range error for insert");
240 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
241 (*current_liboctave_error_handler) (
"range error for insert");
261 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
262 (*current_liboctave_error_handler) (
"range error for insert");
264 fill (0.0,
r, c,
r + a_nr - 1, c + a_nc - 1);
292 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
293 (*current_liboctave_error_handler) (
"range error for insert");
307 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
308 (*current_liboctave_error_handler) (
"range error for insert");
328 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
329 (*current_liboctave_error_handler) (
"range error for insert");
331 fill (0.0,
r, c,
r + a_nr - 1, c + a_nc - 1);
352 if (nr > 0 && nc > 0)
370 if (nr > 0 && nc > 0)
389 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
390 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
391 (*current_liboctave_error_handler) (
"range error for fill");
393 if (r1 > r2) { std::swap (r1, r2); }
394 if (c1 > c2) { std::swap (c1, c2); }
396 if (r2 >= r1 && c2 >= c1)
415 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
416 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
417 (*current_liboctave_error_handler) (
"range error for fill");
419 if (r1 > r2) { std::swap (r1, r2); }
420 if (c1 > c2) { std::swap (c1, c2); }
422 if (r2 >= r1 && c2 >=c1)
440 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
455 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
469 if (nr != a.
numel ())
470 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
485 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
500 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
515 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
529 if (nr != a.
numel ())
530 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
545 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
560 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
574 if (nc != a.
numel ())
575 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
590 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
605 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
620 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
634 if (nc != a.
numel ())
635 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
650 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
665 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
677 return do_mx_unary_map<Complex, Complex, std::conj<double>> (a);
686 if (r1 > r2) { std::swap (r1, r2); }
687 if (c1 > c2) { std::swap (c1, c2); }
723 double sum = colsum.
xelem (i);
742 return inverse (mattype, info, rcon, 0, 0);
750 return inverse (mattype, info, rcon, 0, 0);
755 bool calc_cond)
const
758 return inverse (mattype, info, rcon, force, calc_cond);
766 return inverse (mattype, info, rcon, 0, 0);
773 return inverse (mattype, info, rcon, 0, 0);
778 double& rcon,
bool force,
bool calc_cond)
const
785 if (nr != nc || nr == 0 || nc == 0)
786 (*current_liboctave_error_handler) (
"inverse requires square matrix");
788 int typ = mattype.
type ();
796 F77_XFCN (ztrtri, ZTRTRI,(F77_CONST_CHAR_ARG2 (&uplo, 1),
797 F77_CONST_CHAR_ARG2 (&udiag, 1),
800 F77_CHAR_ARG_LEN (1)));
816 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&job, 1),
817 F77_CONST_CHAR_ARG2 (&uplo, 1),
818 F77_CONST_CHAR_ARG2 (&udiag, 1),
823 F77_CHAR_ARG_LEN (1)));
825 if (ztrcon_info != 0)
829 if (info == -1 && ! force)
837 double& rcon,
bool force,
bool calc_cond)
const
845 (*current_liboctave_error_handler) (
"inverse requires square matrix");
848 F77_INT *pipvt = ipvt.fortran_vec ();
865 lwork = (lwork < 2 * nc ? 2 * nc : lwork);
899 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
902 F77_CHAR_ARG_LEN (1)));
904 if (zgecon_info != 0)
908 if ((info == -1 && ! force)
918 if (zgetri_info != 0)
930 double& rcon,
bool force,
bool calc_cond)
const
932 int typ = mattype.
type (
false);
936 typ = mattype.
type (*
this);
939 ret =
tinverse (mattype, info, rcon, force, calc_cond);
948 rcon =
chol.rcond ();
951 ret =
chol.inverse ();
958 ret =
finverse (mattype, info, rcon, force, calc_cond);
960 if ((calc_cond || mattype.
ishermitian ()) && rcon == 0.0)
994 * std::numeric_limits<double>::epsilon ();
1000 while (
r >= 0 && sigma.
elem (
r) < tol)
1016 #if defined (HAVE_FFTW)
1021 size_t nr =
rows ();
1022 size_t nc =
cols ();
1026 size_t npts, nsamples;
1028 if (nr == 1 || nc == 1)
1030 npts = (nr > nc ? nr : nc);
1050 size_t nr =
rows ();
1051 size_t nc =
cols ();
1055 size_t npts, nsamples;
1057 if (nr == 1 || nc == 1)
1059 npts = (nr > nc ? nr : nc);
1109 (*current_liboctave_error_handler)
1110 (
"support for FFTW was unavailable or disabled when liboctave was built");
1118 (*current_liboctave_error_handler)
1119 (
"support for FFTW was unavailable or disabled when liboctave was built");
1127 (*current_liboctave_error_handler)
1128 (
"support for FFTW was unavailable or disabled when liboctave was built");
1136 (*current_liboctave_error_handler)
1137 (
"support for FFTW was unavailable or disabled when liboctave was built");
1161 bool calc_cond)
const
1164 return determinant (mattype, info, rcon, calc_cond);
1170 bool calc_cond)
const
1181 (*current_liboctave_error_handler) (
"matrix must be square");
1183 volatile int typ = mattype.
type ();
1190 typ = mattype.
type (*
this);
1196 for (
F77_INT i = 0; i < nc; i++)
1206 anorm =
norm1 (*
this);
1211 F77_XFCN (zpotrf, ZPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1213 F77_CHAR_ARG_LEN (1)));
1232 F77_XFCN (zpocon, ZPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1235 F77_CHAR_ARG_LEN (1)));
1243 for (
F77_INT i = 0; i < nc; i++)
1250 (*current_liboctave_error_handler) (
"det: invalid dense matrix type");
1263 double anorm =
norm1 (*
this);
1296 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1299 F77_CHAR_ARG_LEN (1)));
1311 for (
F77_INT i = 0; i < nc; i++)
1314 retval *= (ipvt(i) != (i+1)) ? -c : c;
1327 return rcond (mattype);
1338 (*current_liboctave_error_handler) (
"matrix must be square");
1340 if (nr == 0 || nc == 0)
1344 volatile int typ = mattype.
type ();
1347 typ = mattype.
type (*
this);
1363 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1364 F77_CONST_CHAR_ARG2 (&uplo, 1),
1365 F77_CONST_CHAR_ARG2 (&dia, 1),
1368 F77_CHAR_ARG_LEN (1)
1369 F77_CHAR_ARG_LEN (1)
1370 F77_CHAR_ARG_LEN (1)));
1376 (*current_liboctave_error_handler)
1377 (
"permuted triangular matrix not implemented");
1391 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1392 F77_CONST_CHAR_ARG2 (&uplo, 1),
1393 F77_CONST_CHAR_ARG2 (&dia, 1),
1396 F77_CHAR_ARG_LEN (1)
1397 F77_CHAR_ARG_LEN (1)
1398 F77_CHAR_ARG_LEN (1)));
1404 (*current_liboctave_error_handler)
1405 (
"permuted triangular matrix not implemented");
1408 double anorm = -1.0;
1418 anorm =
norm1 (atmp);
1420 F77_XFCN (zpotrf, ZPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1422 F77_CHAR_ARG_LEN (1)));
1438 F77_XFCN (zpocon, ZPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1441 F77_CHAR_ARG_LEN (1)));
1459 anorm =
norm1 (atmp);
1482 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1485 F77_CHAR_ARG_LEN (1)));
1502 solve_singularity_handler sing_handler,
1514 (*current_liboctave_error_handler)
1515 (
"matrix dimension mismatch solution of linear equations");
1517 if (nr == 0 || nc == 0 || b_nc == 0)
1521 volatile int typ = mattype.
type ();
1524 (*current_liboctave_error_handler) (
"incorrect matrix type");
1530 (*current_liboctave_error_handler)
1531 (
"permuted triangular matrix not implemented");
1544 F77_XFCN (ztrtrs, ZTRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1545 F77_CONST_CHAR_ARG2 (&trans, 1),
1546 F77_CONST_CHAR_ARG2 (&dia, 1),
1549 F77_CHAR_ARG_LEN (1)
1550 F77_CHAR_ARG_LEN (1)
1551 F77_CHAR_ARG_LEN (1)));
1566 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1567 F77_CONST_CHAR_ARG2 (&uplo, 1),
1568 F77_CONST_CHAR_ARG2 (&dia, 1),
1571 F77_CHAR_ARG_LEN (1)
1572 F77_CHAR_ARG_LEN (1)
1573 F77_CHAR_ARG_LEN (1)));
1580 volatile double rcond_plus_one = rcon + 1.0;
1587 sing_handler (rcon);
1600 solve_singularity_handler sing_handler,
1612 (*current_liboctave_error_handler)
1613 (
"matrix dimension mismatch solution of linear equations");
1615 if (nr == 0 || nc == 0 || b_nc == 0)
1619 volatile int typ = mattype.
type ();
1622 (*current_liboctave_error_handler) (
"incorrect matrix type");
1628 (*current_liboctave_error_handler)
1629 (
"permuted triangular matrix not implemented");
1642 F77_XFCN (ztrtrs, ZTRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1643 F77_CONST_CHAR_ARG2 (&trans, 1),
1644 F77_CONST_CHAR_ARG2 (&dia, 1),
1647 F77_CHAR_ARG_LEN (1)
1648 F77_CHAR_ARG_LEN (1)
1649 F77_CHAR_ARG_LEN (1)));
1664 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1665 F77_CONST_CHAR_ARG2 (&uplo, 1),
1666 F77_CONST_CHAR_ARG2 (&dia, 1),
1669 F77_CHAR_ARG_LEN (1)
1670 F77_CHAR_ARG_LEN (1)
1671 F77_CHAR_ARG_LEN (1)));
1678 volatile double rcond_plus_one = rcon + 1.0;
1685 sing_handler (rcon);
1698 solve_singularity_handler sing_handler,
1699 bool calc_cond)
const
1709 if (nr != nc || nr != b_nr)
1710 (*current_liboctave_error_handler)
1711 (
"matrix dimension mismatch solution of linear equations");
1713 if (nr == 0 || b_nc == 0)
1717 volatile int typ = mattype.
type ();
1720 double anorm = -1.0;
1732 anorm =
norm1 (atmp);
1736 F77_XFCN (zpotrf, ZPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1738 F77_CHAR_ARG_LEN (1)));
1760 F77_XFCN (zpocon, ZPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1763 F77_CHAR_ARG_LEN (1)));
1770 volatile double rcond_plus_one = rcon + 1.0;
1777 sing_handler (rcon);
1788 F77_XFCN (zpotrs, ZPOTRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1791 F77_CHAR_ARG_LEN (1)));
1819 if (calc_cond && anorm < 0.0)
1820 anorm =
norm1 (atmp);
1831 nr, pipvt, tmp_info));
1843 sing_handler (rcon);
1855 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1858 F77_CHAR_ARG_LEN (1)));
1865 volatile double rcond_plus_one = rcon + 1.0;
1872 sing_handler (rcon);
1884 F77_XFCN (zgetrs, ZGETRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1887 F77_CHAR_ARG_LEN (1)));
1911 return solve (mattype, b, info, rcon,
nullptr);
1919 return solve (mattype, b, info, rcon,
nullptr);
1926 return solve (mattype, b, info, rcon,
nullptr);
1932 solve_singularity_handler sing_handler,
1936 return solve (mattype, tmp, info, rcon, sing_handler, singular_fallback,
1945 return solve (mattype, b, info, rcon,
nullptr);
1953 return solve (mattype, b, info, rcon,
nullptr);
1960 return solve (mattype, b, info, rcon,
nullptr);
1966 solve_singularity_handler sing_handler,
1970 int typ = mattype.
type ();
1973 typ = mattype.
type (*
this);
1977 retval =
utsolve (mattype, b, info, rcon, sing_handler,
true, transt);
1979 retval =
ltsolve (mattype, b, info, rcon, sing_handler,
true, transt);
1987 retval =
fsolve (mattype, b, info, rcon, sing_handler,
true);
1989 (*current_liboctave_error_handler) (
"unknown matrix type");
2027 solve_singularity_handler sing_handler,
2039 return solve (mattype, b, info, rcon,
nullptr);
2047 return solve (mattype, b, info, rcon,
nullptr);
2054 return solve (mattype, b, info, rcon,
nullptr);
2060 solve_singularity_handler sing_handler,
2065 tmp =
solve (mattype, tmp, info, rcon, sing_handler,
true, transt);
2074 return solve (b, info, rcon,
nullptr);
2081 return solve (b, info, rcon,
nullptr);
2088 return solve (b, info, rcon,
nullptr);
2093 solve_singularity_handler sing_handler,
2097 return solve (tmp, info, rcon, sing_handler, transt);
2105 return solve (b, info, rcon,
nullptr);
2112 return solve (b, info, rcon,
nullptr);
2119 return solve (b, info, rcon,
nullptr);
2125 solve_singularity_handler sing_handler,
2129 return solve (mattype, b, info, rcon, sing_handler,
true, transt);
2157 solve_singularity_handler sing_handler,
2168 return solve (b, info, rcon,
nullptr);
2175 return solve (b, info, rcon,
nullptr);
2182 return solve (b, info, rcon,
nullptr);
2188 solve_singularity_handler sing_handler,
2192 return solve (mattype, b, info, rcon, sing_handler, transt);
2233 return lssolve (b, info, rank, rcon);
2241 return lssolve (b, info, rank, rcon);
2249 return lssolve (b, info, rank, rcon);
2266 (*current_liboctave_error_handler)
2267 (
"matrix dimension mismatch solution of linear equations");
2269 if (
m == 0 ||
n == 0 || b_nc == 0)
2281 for (
F77_INT j = 0; j < nrhs; j++)
2302 F77_CONST_CHAR_ARG2 (
" ", 1),
2304 F77_CHAR_ARG_LEN (6)
2305 F77_CHAR_ARG_LEN (1));
2309 F77_CONST_CHAR_ARG2 (
" ", 1),
2310 m,
n, nrhs, -1, mnthr
2311 F77_CHAR_ARG_LEN (6)
2312 F77_CHAR_ARG_LEN (1));
2317 double dminmn =
static_cast<double> (minmn);
2318 double dsmlsizp1 =
static_cast<double> (smlsiz+1);
2325 F77_INT lrwork = minmn*(10 + 2*smlsiz + 8*nlvl)
2328 n*(1+nrhs) + 2*nrhs);
2334 F77_INT liwork = 3 * minmn * nlvl + 11 * minmn;
2346 lwork, prwork, piwork, tmp_info));
2355 if (
n >
m &&
n >= mnthr)
2368 const F77_INT lworkaround = 4*
m +
m*
m + addend;
2371 work(0) = lworkaround;
2378 work(0) = lworkaround;
2384 double anorm =
norm1 (*
this);
2401 maxmn, ps, rcon, tmp_rank,
2403 lwork, prwork, piwork, tmp_info));
2408 if (s.
elem (0) == 0.0)
2411 rcon = s.
elem (minmn - 1) / s.
elem (0);
2458 return lssolve (b, info, rank, rcon);
2467 return lssolve (b, info, rank, rcon);
2475 return lssolve (b, info, rank, rcon);
2493 (*current_liboctave_error_handler)
2494 (
"matrix dimension mismatch solution of linear equations");
2496 if (
m == 0 ||
n == 0)
2528 F77_CONST_CHAR_ARG2 (
" ", 1),
2530 F77_CHAR_ARG_LEN (6)
2531 F77_CHAR_ARG_LEN (1));
2536 double dminmn =
static_cast<double> (minmn);
2537 double dsmlsizp1 =
static_cast<double> (smlsiz+1);
2544 F77_INT lrwork = minmn*(10 + 2*smlsiz + 8*nlvl)
2545 + 3*smlsiz*nrhs + (smlsiz+1)*(smlsiz+1);
2551 F77_INT liwork = 3 * minmn * nlvl + 11 * minmn;
2563 lwork, prwork, piwork, tmp_info));
2575 maxmn, ps, rcon, tmp_rank,
2577 prwork, piwork, tmp_info));
2584 if (s.
elem (0) == 0.0)
2587 rcon = s.
elem (minmn - 1) / s.
elem (0);
2626 F77_XFCN (zgemm, ZGEMM, (F77_CONST_CHAR_ARG2 (
"N", 1),
2627 F77_CONST_CHAR_ARG2 (
"N", 1),
2630 F77_CHAR_ARG_LEN (1)
2631 F77_CHAR_ARG_LEN (1)));
2648 if (nr != a_nr || nc != a_nc)
2666 if (nr != a_nr || nc != a_nc)
2684 if (nr != a_nr || nc != a_nc)
2702 if (nr != a_nr || nc != a_nc)
2722 if (nr != a_nr || nc != a_nc)
2725 if (nr == 0 || nc == 0)
2743 if (nr != a_nr || nc != a_nc)
2746 if (nr == 0 || nc == 0)
2817 if (nr != 1 && nc != 1)
2818 (*current_liboctave_error_handler) (
"diag: expecting vector argument");
2876 if (nr > 0 && nc > 0)
2891 for (idx_j = 0; idx_j < nc; idx_j++)
2893 tmp_min =
elem (i, idx_j);
2897 abs_min = (real_only ? tmp_min.real ()
2910 double abs_tmp = (real_only ? tmp.real () :
std::abs (tmp));
2912 if (abs_tmp < abs_min)
2923 idx_arg.
elem (i) = 0;
2927 result.
elem (i) = tmp_min;
2928 idx_arg.
elem (i) = idx_j;
2951 if (nr > 0 && nc > 0)
2966 for (idx_j = 0; idx_j < nc; idx_j++)
2968 tmp_max =
elem (i, idx_j);
2972 abs_max = (real_only ? tmp_max.real ()
2985 double abs_tmp = (real_only ? tmp.real () :
std::abs (tmp));
2987 if (abs_tmp > abs_max)
2998 idx_arg.
elem (i) = 0;
3002 result.
elem (i) = tmp_max;
3003 idx_arg.
elem (i) = idx_j;
3026 if (nr > 0 && nc > 0)
3041 for (idx_i = 0; idx_i < nr; idx_i++)
3043 tmp_min =
elem (idx_i, j);
3047 abs_min = (real_only ? tmp_min.real ()
3060 double abs_tmp = (real_only ? tmp.real () :
std::abs (tmp));
3062 if (abs_tmp < abs_min)
3073 idx_arg.
elem (j) = 0;
3077 result.
elem (j) = tmp_min;
3078 idx_arg.
elem (j) = idx_i;
3101 if (nr > 0 && nc > 0)
3116 for (idx_i = 0; idx_i < nr; idx_i++)
3118 tmp_max =
elem (idx_i, j);
3122 abs_max = (real_only ? tmp_max.real ()
3135 double abs_tmp = (real_only ? tmp.real () :
std::abs (tmp));
3137 if (abs_tmp > abs_max)
3148 idx_arg.
elem (j) = 0;
3152 result.
elem (j) = tmp_max;
3153 idx_arg.
elem (j) = idx_i;
3184 if (nr > 0 && nc > 0)
3190 tmp = octave_read_value<Complex> (is);
3192 a.
elem (i, j) = tmp;
3258 F77_XFCN (ztrsyl, ZTRSYL, (F77_CONST_CHAR_ARG2 (
"N", 1),
3259 F77_CONST_CHAR_ARG2 (
"N", 1),
3262 F77_CHAR_ARG_LEN (1)
3263 F77_CHAR_ARG_LEN (1)));
3316 return trans ? (
conj ?
'C' :
'T') :
'N';
3341 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
3343 else if (a.
data () == b.
data () && a_nr == b_nc && tra != trb)
3358 F77_XFCN (zherk, ZHERK, (F77_CONST_CHAR_ARG2 (
"U", 1),
3359 F77_CONST_CHAR_ARG2 (&ctra, 1),
3362 F77_CHAR_ARG_LEN (1)
3363 F77_CHAR_ARG_LEN (1)));
3364 for (
F77_INT j = 0; j < a_nr; j++)
3365 for (
F77_INT i = 0; i < j; i++)
3370 F77_XFCN (zsyrk, ZSYRK, (F77_CONST_CHAR_ARG2 (
"U", 1),
3371 F77_CONST_CHAR_ARG2 (&ctra, 1),
3374 F77_CHAR_ARG_LEN (1)
3375 F77_CHAR_ARG_LEN (1)));
3376 for (
F77_INT j = 0; j < a_nr; j++)
3377 for (
F77_INT i = 0; i < j; i++)
3393 if (b_nc == 1 && a_nr == 1)
3411 else if (b_nc == 1 && ! cjb)
3414 F77_XFCN (zgemv, ZGEMV, (F77_CONST_CHAR_ARG2 (&ctra, 1),
3417 F77_CHAR_ARG_LEN (1)));
3419 else if (a_nr == 1 && ! cja && ! cjb)
3422 F77_XFCN (zgemv, ZGEMV, (F77_CONST_CHAR_ARG2 (&crevtrb, 1),
3425 F77_CHAR_ARG_LEN (1)));
3431 F77_XFCN (zgemm, ZGEMM, (F77_CONST_CHAR_ARG2 (&ctra, 1),
3432 F77_CONST_CHAR_ARG2 (&ctrb, 1),
3436 F77_CHAR_ARG_LEN (1)
3437 F77_CHAR_ARG_LEN (1)));
3447 return xgemm (a, b);
3452 #define EMPTY_RETURN_CHECK(T) \
3453 if (nr == 0 || nc == 0) \
3489 (*current_liboctave_error_handler)
3490 (
"two-arg min requires same size arguments");
3498 bool columns_are_real_only =
true;
3504 columns_are_real_only =
false;
3509 if (columns_are_real_only)
3561 (*current_liboctave_error_handler)
3562 (
"two-arg max requires same size arguments");
3570 bool columns_are_real_only =
true;
3576 columns_are_real_only =
false;
3582 if (columns_are_real_only)
3611 (*current_liboctave_error_handler)
3612 (
"linspace: vectors must be of equal length");
3629 delta[i] = (x1(i) == x2(i)) ? 0 : (x2(i) - x1(i)) / (
n - 1.0);
3633 retval.
xelem (i, j) = x1(i) +
static_cast<double> (j)*delta[i];
static double norm1(const ComplexMatrix &a)
std::ostream & operator<<(std::ostream &os, const ComplexMatrix &a)
ComplexMatrix max(const Complex &c, const ComplexMatrix &m)
ComplexMatrix Givens(const Complex &x, const Complex &y)
static const Complex Complex_NaN_result(octave::numeric_limits< double >::NaN(), octave::numeric_limits< double >::NaN())
ComplexMatrix conj(const ComplexMatrix &a)
static char get_blas_trans_arg(bool trans, bool conj)
ComplexMatrix linspace(const ComplexColumnVector &x1, const ComplexColumnVector &x2, octave_idx_type n)
ComplexMatrix Sylvester(const ComplexMatrix &a, const ComplexMatrix &b, const ComplexMatrix &c)
ComplexMatrix min(const Complex &c, const ComplexMatrix &m)
#define EMPTY_RETURN_CHECK(T)
std::istream & operator>>(std::istream &is, ComplexMatrix &a)
ComplexMatrix operator*(const ColumnVector &v, const ComplexRowVector &a)
ComplexMatrix xgemm(const ComplexMatrix &a, const ComplexMatrix &b, blas_trans_type transa, blas_trans_type transb)
base_det< Complex > ComplexDET
N Dimensional Array with copy-on-write semantics.
Array< T > & insert(const Array< T > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
octave_idx_type columns(void) const
T & xelem(octave_idx_type n)
Size of the specified dimension.
octave_idx_type numel(void) const
Number of elements in the array.
T & elem(octave_idx_type n)
Size of the specified dimension.
bool issquare(void) const
Size of the specified dimension.
const T * data(void) const
Size of the specified dimension.
octave_idx_type cols(void) const
octave_idx_type rows(void) const
Array< T > index(const idx_vector &i) const
Indexing without resizing.
const T * fortran_vec(void) const
Size of the specified dimension.
ColumnVector extract(octave_idx_type r1, octave_idx_type r2) const
void resize(octave_idx_type n, const Complex &rfv=Complex(0))
ComplexMatrix(void)=default
ComplexMatrix fsolve(MatrixType &mattype, const ComplexMatrix &b, octave_idx_type &info, double &rcon, solve_singularity_handler sing_handler, bool calc_cond=false) const
ComplexMatrix & operator+=(const DiagMatrix &a)
ComplexMatrix & operator-=(const DiagMatrix &a)
ComplexMatrix lssolve(const Matrix &b) const
ComplexMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
ComplexColumnVector row_max(void) const
boolMatrix all(int dim=-1) const
ComplexMatrix & fill(double val)
ComplexMatrix fourier2d(void) const
ComplexRowVector column_min(void) const
ComplexColumnVector row_min(void) const
ComplexMatrix finverse(MatrixType &mattype, octave_idx_type &info, double &rcon, bool force, bool calc_cond) const
ComplexMatrix append(const Matrix &a) const
ComplexMatrix diag(octave_idx_type k=0) const
ComplexMatrix transpose(void) const
ComplexMatrix hermitian(void) const
ComplexMatrix pseudo_inverse(double tol=0.0) const
bool operator==(const ComplexMatrix &a) const
ComplexMatrix inverse(void) const
bool ishermitian(void) const
ComplexDET determinant(void) const
ComplexMatrix ifourier(void) const
ComplexMatrix ifourier2d(void) const
ComplexRowVector row(octave_idx_type i) const
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
ComplexMatrix & insert(const Matrix &a, octave_idx_type r, octave_idx_type c)
ComplexMatrix solve(MatrixType &mattype, const Matrix &b) const
ComplexRowVector column_max(void) const
friend OCTAVE_API ComplexMatrix conj(const ComplexMatrix &a)
bool row_is_real_only(octave_idx_type) const
ComplexMatrix sumsq(int dim=-1) const
ComplexMatrix extract_n(octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const
ComplexMatrix stack(const Matrix &a) const
ComplexMatrix cumprod(int dim=-1) const
ComplexMatrix fourier(void) const
ComplexMatrix prod(int dim=-1) const
ComplexMatrix cumsum(int dim=-1) const
ComplexMatrix tinverse(MatrixType &mattype, octave_idx_type &info, double &rcon, bool force, bool calc_cond) const
boolMatrix any(int dim=-1) const
bool operator!=(const ComplexMatrix &a) const
bool column_is_real_only(octave_idx_type) const
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 sum(int dim=-1) const
ComplexColumnVector column(octave_idx_type i) const
boolNDArray any(int dim=-1) const
ComplexNDArray prod(int dim=-1) const
ComplexNDArray sumsq(int dim=-1) const
ComplexNDArray diag(octave_idx_type k=0) const
ComplexNDArray cumsum(int dim=-1) const
ComplexNDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
ComplexNDArray cumprod(int dim=-1) const
boolNDArray all(int dim=-1) const
ComplexNDArray sum(int dim=-1) const
void resize(octave_idx_type n, const Complex &rfv=Complex(0))
T elem(octave_idx_type r, octave_idx_type c) const
octave_idx_type length(void) const
octave_idx_type cols(void) const
octave_idx_type rows(void) const
DiagMatrix inverse(void) const
ColumnVector extract_diag(octave_idx_type k=0) const
bool ishermitian(void) const
void mark_as_rectangular(void)
void mark_as_unsymmetric(void)
int type(bool quiet=true)
Matrix sum(int dim=-1) const
RowVector row(octave_idx_type i) const
Vector representing the dimensions (size) of an Array.
static const idx_vector colon
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)
static int fftNd(const double *, Complex *, const int, const dim_vector &)
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
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)
T unitary_matrix(void) const
T schur_matrix(void) const
DM_T singular_values(void) const
T right_singular_matrix(void) const
T left_singular_matrix(void) const
ColumnVector real(const ComplexColumnVector &a)
ColumnVector imag(const ComplexColumnVector &a)
#define F77_DBLE_CMPLX_ARG(x)
#define F77_XFCN(f, F, args)
octave_f77_int_type F77_INT
#define F77_CONST_DBLE_CMPLX_ARG(x)
double norm(const ColumnVector &v)
void scale(Matrix &m, double x, double y, double z)
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT F77_DBLE * V
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
F77_RET_T const F77_DBLE * x
void octave_write_complex(std::ostream &os, const Complex &c)
char get_blas_char(blas_trans_type transt)
void mx_inline_add2(size_t n, R *r, const X *x)
void mx_inline_sub2(size_t n, R *r, const X *x)
bool mx_inline_equal(size_t n, const T1 *x, const T2 *y)
#define MM_BOOL_OPS(M1, M2)
#define MM_CMP_OPS(M1, M2)
#define SM_BOOL_OPS(S, M)
#define MS_BOOL_OPS(M, S)
Complex log2(const Complex &x)
void warn_singular_matrix(double rcond)
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
std::complex< double > Complex
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
octave_value::octave_value(const Array< char > &chm, char type) return retval
F77_RET_T F77_FUNC(xerbla, XERBLA)(F77_CONST_CHAR_ARG_DEF(s_arg
subroutine xilaenv(ispec, name, opts, n1, n2, n3, n4, retval)
subroutine xzdotc(n, zx, incx, zy, incy, retval)
subroutine xzdotu(n, zx, incx, zy, incy, retval)