26 #if defined (HAVE_CONFIG_H)
52 #include "mx-fcm-fdm.h"
53 #include "mx-fcm-fs.h"
54 #include "mx-fdm-fcm.h"
143 elem (i, j) =
static_cast<unsigned char> (a.
elem (i, j));
151 (*current_liboctave_error_handler) (
"complex: internal error");
170 return !(*
this == a);
201 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
202 (*current_liboctave_error_handler) (
"range error for insert");
204 if (a_nr >0 && a_nc > 0)
222 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
223 (*current_liboctave_error_handler) (
"range error for insert");
242 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
243 (*current_liboctave_error_handler) (
"range error for insert");
263 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
264 (*current_liboctave_error_handler) (
"range error for insert");
266 fill (0.0,
r, c,
r + a_nr - 1, c + a_nc - 1);
294 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
295 (*current_liboctave_error_handler) (
"range error for insert");
309 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
310 (*current_liboctave_error_handler) (
"range error for insert");
330 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
331 (*current_liboctave_error_handler) (
"range error for insert");
333 fill (0.0,
r, c,
r + a_nr - 1, c + a_nc - 1);
354 if (nr > 0 && nc > 0)
372 if (nr > 0 && nc > 0)
391 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
392 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
393 (*current_liboctave_error_handler) (
"range error for fill");
395 if (r1 > r2) { std::swap (r1, r2); }
396 if (c1 > c2) { std::swap (c1, c2); }
398 if (r2 >= r1 && c2 >= c1)
418 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
419 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
420 (*current_liboctave_error_handler) (
"range error for fill");
422 if (r1 > r2) { std::swap (r1, r2); }
423 if (c1 > c2) { std::swap (c1, c2); }
425 if (r2 >= r1 && c2 >=c1)
443 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
458 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
472 if (nr != a.
numel ())
473 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
488 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
503 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
518 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
532 if (nr != a.
numel ())
533 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
548 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
563 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
577 if (nc != a.
numel ())
578 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
593 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
608 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
623 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
637 if (nc != a.
numel ())
638 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
653 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
668 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
680 return do_mx_unary_map<FloatComplex, FloatComplex, std::conj<float>> (a);
689 if (r1 > r2) { std::swap (r1, r2); }
690 if (c1 > c2) { std::swap (c1, c2); }
726 float sum = colsum.
xelem (i);
745 return inverse (mattype, info, rcon, 0, 0);
753 return inverse (mattype, info, rcon, 0, 0);
758 bool calc_cond)
const
761 return inverse (mattype, info, rcon, force, calc_cond);
769 return inverse (mattype, info, rcon, 0, 0);
776 return inverse (mattype, info, rcon, 0, 0);
781 float& rcon,
bool force,
bool calc_cond)
const
788 if (nr != nc || nr == 0 || nc == 0)
789 (*current_liboctave_error_handler) (
"inverse requires square matrix");
791 int typ = mattype.
type ();
799 F77_XFCN (ctrtri, CTRTRI, (F77_CONST_CHAR_ARG2 (&uplo, 1),
800 F77_CONST_CHAR_ARG2 (&udiag, 1),
803 F77_CHAR_ARG_LEN (1)));
819 F77_XFCN (ctrcon, CTRCON, (F77_CONST_CHAR_ARG2 (&job, 1),
820 F77_CONST_CHAR_ARG2 (&uplo, 1),
821 F77_CONST_CHAR_ARG2 (&udiag, 1),
826 F77_CHAR_ARG_LEN (1)));
828 if (ztrcon_info != 0)
832 if (info == -1 && ! force)
840 float& rcon,
bool force,
bool calc_cond)
const
848 (*current_liboctave_error_handler) (
"inverse requires square matrix");
851 F77_INT *pipvt = ipvt.fortran_vec ();
868 lwork = (lwork < 2 * nc ? 2 * nc : lwork);
902 F77_XFCN (cgecon, CGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
905 F77_CHAR_ARG_LEN (1)));
907 if (cgecon_info != 0)
911 if ((info == -1 && ! force)
921 if (zgetri_info != 0)
933 float& rcon,
bool force,
bool calc_cond)
const
935 int typ = mattype.
type (
false);
939 typ = mattype.
type (*
this);
942 ret =
tinverse (mattype, info, rcon, force, calc_cond);
951 rcon =
chol.rcond ();
954 ret =
chol.inverse ();
961 ret =
finverse (mattype, info, rcon, force, calc_cond);
963 if ((calc_cond || mattype.
ishermitian ()) && rcon == 0.0)
997 * std::numeric_limits<float>::epsilon ();
1003 while (
r >= 0 && sigma.
elem (
r) < tol)
1019 #if defined (HAVE_FFTW)
1024 size_t nr =
rows ();
1025 size_t nc =
cols ();
1029 size_t npts, nsamples;
1031 if (nr == 1 || nc == 1)
1033 npts = (nr > nc ? nr : nc);
1053 size_t nr =
rows ();
1054 size_t nc =
cols ();
1058 size_t npts, nsamples;
1060 if (nr == 1 || nc == 1)
1062 npts = (nr > nc ? nr : nc);
1112 (*current_liboctave_error_handler)
1113 (
"support for FFTW was unavailable or disabled when liboctave was built");
1121 (*current_liboctave_error_handler)
1122 (
"support for FFTW was unavailable or disabled when liboctave was built");
1130 (*current_liboctave_error_handler)
1131 (
"support for FFTW was unavailable or disabled when liboctave was built");
1139 (*current_liboctave_error_handler)
1140 (
"support for FFTW was unavailable or disabled when liboctave was built");
1164 bool calc_cond)
const
1167 return determinant (mattype, info, rcon, calc_cond);
1173 bool calc_cond)
const
1184 (*current_liboctave_error_handler) (
"matrix must be square");
1186 volatile int typ = mattype.
type ();
1193 typ = mattype.
type (*
this);
1199 for (
F77_INT i = 0; i < nc; i++)
1209 anorm =
norm1 (*
this);
1214 F77_XFCN (cpotrf, CPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1216 F77_CHAR_ARG_LEN (1)));
1235 F77_XFCN (cpocon, CPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1238 F77_CHAR_ARG_LEN (1)));
1246 for (
F77_INT i = 0; i < nc; i++)
1253 (*current_liboctave_error_handler) (
"det: invalid dense matrix type");
1266 float anorm =
norm1 (*
this);
1299 F77_XFCN (cgecon, CGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1302 F77_CHAR_ARG_LEN (1)));
1314 for (
F77_INT i = 0; i < nc; i++)
1317 retval *= (ipvt(i) != (i+1)) ? -c : c;
1330 return rcond (mattype);
1341 (*current_liboctave_error_handler) (
"matrix must be square");
1343 if (nr == 0 || nc == 0)
1347 volatile int typ = mattype.
type ();
1350 typ = mattype.
type (*
this);
1366 F77_XFCN (ctrcon, CTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1367 F77_CONST_CHAR_ARG2 (&uplo, 1),
1368 F77_CONST_CHAR_ARG2 (&dia, 1),
1371 F77_CHAR_ARG_LEN (1)
1372 F77_CHAR_ARG_LEN (1)
1373 F77_CHAR_ARG_LEN (1)));
1379 (*current_liboctave_error_handler)
1380 (
"permuted triangular matrix not implemented");
1394 F77_XFCN (ctrcon, CTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1395 F77_CONST_CHAR_ARG2 (&uplo, 1),
1396 F77_CONST_CHAR_ARG2 (&dia, 1),
1399 F77_CHAR_ARG_LEN (1)
1400 F77_CHAR_ARG_LEN (1)
1401 F77_CHAR_ARG_LEN (1)));
1407 (*current_liboctave_error_handler)
1408 (
"permuted triangular matrix not implemented");
1421 anorm =
norm1 (atmp);
1423 F77_XFCN (cpotrf, CPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1425 F77_CHAR_ARG_LEN (1)));
1441 F77_XFCN (cpocon, CPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1444 F77_CHAR_ARG_LEN (1)));
1462 anorm =
norm1 (atmp);
1484 F77_XFCN (cgecon, CGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1487 F77_CHAR_ARG_LEN (1)));
1504 solve_singularity_handler sing_handler,
1516 (*current_liboctave_error_handler)
1517 (
"matrix dimension mismatch solution of linear equations");
1519 if (nr == 0 || nc == 0 || b_nc == 0)
1523 volatile int typ = mattype.
type ();
1531 (*current_liboctave_error_handler)
1532 (
"permuted triangular matrix not implemented");
1546 F77_XFCN (ctrtrs, CTRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1547 F77_CONST_CHAR_ARG2 (&trans, 1),
1548 F77_CONST_CHAR_ARG2 (&dia, 1),
1551 F77_CHAR_ARG_LEN (1)
1552 F77_CHAR_ARG_LEN (1)
1553 F77_CHAR_ARG_LEN (1)));
1568 F77_XFCN (ctrcon, CTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1569 F77_CONST_CHAR_ARG2 (&uplo, 1),
1570 F77_CONST_CHAR_ARG2 (&dia, 1),
1573 F77_CHAR_ARG_LEN (1)
1574 F77_CHAR_ARG_LEN (1)
1575 F77_CHAR_ARG_LEN (1)));
1582 volatile float rcond_plus_one = rcon + 1.0;
1589 sing_handler (rcon);
1606 solve_singularity_handler sing_handler,
1618 (*current_liboctave_error_handler)
1619 (
"matrix dimension mismatch solution of linear equations");
1621 if (nr == 0 || nc == 0 || b_nc == 0)
1625 volatile int typ = mattype.
type ();
1633 (*current_liboctave_error_handler)
1634 (
"permuted triangular matrix not implemented");
1648 F77_XFCN (ctrtrs, CTRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1649 F77_CONST_CHAR_ARG2 (&trans, 1),
1650 F77_CONST_CHAR_ARG2 (&dia, 1),
1653 F77_CHAR_ARG_LEN (1)
1654 F77_CHAR_ARG_LEN (1)
1655 F77_CHAR_ARG_LEN (1)));
1670 F77_XFCN (ctrcon, CTRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1671 F77_CONST_CHAR_ARG2 (&uplo, 1),
1672 F77_CONST_CHAR_ARG2 (&dia, 1),
1675 F77_CHAR_ARG_LEN (1)
1676 F77_CHAR_ARG_LEN (1)
1677 F77_CHAR_ARG_LEN (1)));
1684 volatile float rcond_plus_one = rcon + 1.0;
1691 sing_handler (rcon);
1708 solve_singularity_handler sing_handler,
1709 bool calc_cond)
const
1719 if (nr != nc || nr != b_nr)
1720 (*current_liboctave_error_handler)
1721 (
"matrix dimension mismatch solution of linear equations");
1723 if (nr == 0 || b_nc == 0)
1727 volatile int typ = mattype.
type ();
1742 anorm =
norm1 (atmp);
1746 F77_XFCN (cpotrf, CPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1748 F77_CHAR_ARG_LEN (1)));
1770 F77_XFCN (cpocon, CPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1773 F77_CHAR_ARG_LEN (1)));
1780 volatile float rcond_plus_one = rcon + 1.0;
1787 sing_handler (rcon);
1798 F77_XFCN (cpotrs, CPOTRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1801 F77_CHAR_ARG_LEN (1)));
1829 if (calc_cond && anorm < 0.0)
1830 anorm =
norm1 (atmp);
1841 nr, pipvt, tmp_info));
1853 sing_handler (rcon);
1865 F77_XFCN (cgecon, CGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1868 F77_CHAR_ARG_LEN (1)));
1875 volatile float rcond_plus_one = rcon + 1.0;
1882 sing_handler (rcon);
1894 F77_XFCN (cgetrs, CGETRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1897 F77_CHAR_ARG_LEN (1)));
1922 return solve (mattype, b, info, rcon,
nullptr);
1930 return solve (mattype, b, info, rcon,
nullptr);
1937 return solve (mattype, b, info, rcon,
nullptr);
1943 solve_singularity_handler sing_handler,
1947 return solve (mattype, tmp, info, rcon, sing_handler, singular_fallback,
1957 return solve (mattype, b, info, rcon,
nullptr);
1965 return solve (mattype, b, info, rcon,
nullptr);
1972 return solve (mattype, b, info, rcon,
nullptr);
1978 solve_singularity_handler sing_handler,
1979 bool singular_fallback,
1983 int typ = mattype.
type ();
1986 typ = mattype.
type (*
this);
1990 retval =
utsolve (mattype, b, info, rcon, sing_handler,
true, transt);
1993 retval =
ltsolve (mattype, b, info, rcon, sing_handler,
true, transt);
2001 retval =
fsolve (mattype, b, info, rcon, sing_handler,
true);
2003 (*current_liboctave_error_handler) (
"unknown matrix type");
2042 solve_singularity_handler sing_handler,
2046 sing_handler, transt);
2055 return solve (mattype, b, info, rcon,
nullptr);
2064 return solve (mattype, b, info, rcon,
nullptr);
2072 return solve (mattype, b, info, rcon,
nullptr);
2079 solve_singularity_handler sing_handler,
2084 tmp =
solve (mattype, tmp, info, rcon, sing_handler,
true, transt);
2093 return solve (b, info, rcon,
nullptr);
2100 return solve (b, info, rcon,
nullptr);
2107 return solve (b, info, rcon,
nullptr);
2113 solve_singularity_handler sing_handler,
2117 return solve (tmp, info, rcon, sing_handler, transt);
2125 return solve (b, info, rcon,
nullptr);
2133 return solve (b, info, rcon,
nullptr);
2140 return solve (b, info, rcon,
nullptr);
2146 solve_singularity_handler sing_handler,
2150 return solve (mattype, b, info, rcon, sing_handler,
true, transt);
2179 solve_singularity_handler sing_handler,
2190 return solve (b, info, rcon,
nullptr);
2198 return solve (b, info, rcon,
nullptr);
2206 return solve (b, info, rcon,
nullptr);
2213 solve_singularity_handler sing_handler,
2217 return solve (mattype, b, info, rcon, sing_handler, transt);
2258 return lssolve (b, info, rank, rcon);
2267 return lssolve (b, info, rank, rcon);
2275 return lssolve (b, info, rank, rcon);
2292 (*current_liboctave_error_handler)
2293 (
"matrix dimension mismatch solution of linear equations");
2295 if (
m == 0 ||
n == 0 || b_nc == 0)
2307 for (
F77_INT j = 0; j < nrhs; j++)
2328 F77_CONST_CHAR_ARG2 (
" ", 1),
2330 F77_CHAR_ARG_LEN (6)
2331 F77_CHAR_ARG_LEN (1));
2335 F77_CONST_CHAR_ARG2 (
" ", 1),
2336 m,
n, nrhs, -1, mnthr
2337 F77_CHAR_ARG_LEN (6)
2338 F77_CHAR_ARG_LEN (1));
2343 float dminmn =
static_cast<float> (minmn);
2344 float dsmlsizp1 =
static_cast<float> (smlsiz+1);
2351 F77_INT lrwork = minmn*(10 + 2*smlsiz + 8*nlvl)
2354 n*(1+nrhs) + 2*nrhs);
2360 F77_INT liwork = 3 * minmn * nlvl + 11 * minmn;
2372 lwork, prwork, piwork, tmp_info));
2381 if (
n >
m &&
n >= mnthr)
2394 const F77_INT lworkaround = 4*
m +
m*
m + addend;
2397 work(0) = lworkaround;
2404 work(0) = lworkaround;
2410 float anorm =
norm1 (*
this);
2427 maxmn, ps, rcon, tmp_rank,
2429 lwork, prwork, piwork, tmp_info));
2434 if (s.
elem (0) == 0.0)
2437 rcon = s.
elem (minmn - 1) / s.
elem (0);
2485 return lssolve (b, info, rank, rcon);
2494 return lssolve (b, info, rank, rcon);
2503 return lssolve (b, info, rank, rcon);
2522 (*current_liboctave_error_handler)
2523 (
"matrix dimension mismatch solution of linear equations");
2525 if (
m == 0 ||
n == 0)
2557 F77_CONST_CHAR_ARG2 (
" ", 1),
2559 F77_CHAR_ARG_LEN (6)
2560 F77_CHAR_ARG_LEN (1));
2565 float dminmn =
static_cast<float> (minmn);
2566 float dsmlsizp1 =
static_cast<float> (smlsiz+1);
2573 F77_INT lrwork = minmn*(10 + 2*smlsiz + 8*nlvl)
2574 + 3*smlsiz*nrhs + (smlsiz+1)*(smlsiz+1);
2580 F77_INT liwork = 3 * minmn * nlvl + 11 * minmn;
2592 lwork, prwork, piwork, tmp_info));
2604 maxmn, ps, rcon, tmp_rank,
2606 prwork, piwork, tmp_info));
2613 if (s.
elem (0) == 0.0)
2616 rcon = s.
elem (minmn - 1) / s.
elem (0);
2655 F77_XFCN (cgemm, CGEMM, (F77_CONST_CHAR_ARG2 (
"N", 1),
2656 F77_CONST_CHAR_ARG2 (
"N", 1),
2659 F77_CHAR_ARG_LEN (1)
2660 F77_CHAR_ARG_LEN (1)));
2677 if (nr != a_nr || nc != a_nc)
2695 if (nr != a_nr || nc != a_nc)
2713 if (nr != a_nr || nc != a_nc)
2731 if (nr != a_nr || nc != a_nc)
2751 if (nr != a_nr || nc != a_nc)
2754 if (nr == 0 || nc == 0)
2772 if (nr != a_nr || nc != a_nc)
2775 if (nr == 0 || nc == 0)
2847 if (nr == 1 || nc == 1)
2908 if (nr > 0 && nc > 0)
2923 for (idx_j = 0; idx_j < nc; idx_j++)
2925 tmp_min =
elem (i, idx_j);
2929 abs_min = (real_only ? tmp_min.real ()
2942 float abs_tmp = (real_only ? tmp.real () :
std::abs (tmp));
2944 if (abs_tmp < abs_min)
2955 idx_arg.
elem (i) = 0;
2959 result.
elem (i) = tmp_min;
2960 idx_arg.
elem (i) = idx_j;
2983 if (nr > 0 && nc > 0)
2998 for (idx_j = 0; idx_j < nc; idx_j++)
3000 tmp_max =
elem (i, idx_j);
3004 abs_max = (real_only ? tmp_max.real ()
3017 float abs_tmp = (real_only ? tmp.real () :
std::abs (tmp));
3019 if (abs_tmp > abs_max)
3030 idx_arg.
elem (i) = 0;
3034 result.
elem (i) = tmp_max;
3035 idx_arg.
elem (i) = idx_j;
3058 if (nr > 0 && nc > 0)
3073 for (idx_i = 0; idx_i < nr; idx_i++)
3075 tmp_min =
elem (idx_i, j);
3079 abs_min = (real_only ? tmp_min.real ()
3092 float abs_tmp = (real_only ? tmp.real () :
std::abs (tmp));
3094 if (abs_tmp < abs_min)
3105 idx_arg.
elem (j) = 0;
3109 result.
elem (j) = tmp_min;
3110 idx_arg.
elem (j) = idx_i;
3133 if (nr > 0 && nc > 0)
3148 for (idx_i = 0; idx_i < nr; idx_i++)
3150 tmp_max =
elem (idx_i, j);
3154 abs_max = (real_only ? tmp_max.real ()
3167 float abs_tmp = (real_only ? tmp.real () :
std::abs (tmp));
3169 if (abs_tmp > abs_max)
3180 idx_arg.
elem (j) = 0;
3184 result.
elem (j) = tmp_max;
3185 idx_arg.
elem (j) = idx_i;
3216 if (nr > 0 && nc > 0)
3222 tmp = octave_read_value<FloatComplex> (is);
3224 a.
elem (i, j) = tmp;
3289 F77_XFCN (ctrsyl, CTRSYL, (F77_CONST_CHAR_ARG2 (
"N", 1),
3290 F77_CONST_CHAR_ARG2 (
"N", 1),
3293 F77_CHAR_ARG_LEN (1)
3294 F77_CHAR_ARG_LEN (1)));
3347 return trans ? (
conj ?
'C' :
'T') :
'N';
3372 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
3374 else if (a.
data () == b.
data () && a_nr == b_nc && tra != trb)
3389 F77_XFCN (cherk, CHERK, (F77_CONST_CHAR_ARG2 (
"U", 1),
3390 F77_CONST_CHAR_ARG2 (&ctra, 1),
3393 F77_CHAR_ARG_LEN (1)
3394 F77_CHAR_ARG_LEN (1)));
3395 for (
F77_INT j = 0; j < a_nr; j++)
3396 for (
F77_INT i = 0; i < j; i++)
3401 F77_XFCN (csyrk, CSYRK, (F77_CONST_CHAR_ARG2 (
"U", 1),
3402 F77_CONST_CHAR_ARG2 (&ctra, 1),
3405 F77_CHAR_ARG_LEN (1)
3406 F77_CHAR_ARG_LEN (1)));
3407 for (
F77_INT j = 0; j < a_nr; j++)
3408 for (
F77_INT i = 0; i < j; i++)
3424 if (b_nc == 1 && a_nr == 1)
3442 else if (b_nc == 1 && ! cjb)
3445 F77_XFCN (cgemv, CGEMV, (F77_CONST_CHAR_ARG2 (&ctra, 1),
3448 F77_CHAR_ARG_LEN (1)));
3450 else if (a_nr == 1 && ! cja && ! cjb)
3453 F77_XFCN (cgemv, CGEMV, (F77_CONST_CHAR_ARG2 (&crevtrb, 1),
3456 F77_CHAR_ARG_LEN (1)));
3462 F77_XFCN (cgemm, CGEMM, (F77_CONST_CHAR_ARG2 (&ctra, 1),
3463 F77_CONST_CHAR_ARG2 (&ctrb, 1),
3466 F77_CHAR_ARG_LEN (1)
3467 F77_CHAR_ARG_LEN (1)));
3477 return xgemm (a, b);
3483 #define EMPTY_RETURN_CHECK(T) \
3484 if (nr == 0 || nc == 0) \
3520 (*current_liboctave_error_handler)
3521 (
"two-arg min requires same size arguments");
3529 bool columns_are_real_only =
true;
3535 columns_are_real_only =
false;
3540 if (columns_are_real_only)
3592 (*current_liboctave_error_handler)
3593 (
"two-arg max requires same size arguments");
3601 bool columns_are_real_only =
true;
3607 columns_are_real_only =
false;
3612 if (columns_are_real_only)
3642 (*current_liboctave_error_handler)
3643 (
"linspace: vectors must be of equal length");
3660 delta[i] = (x1(i) == x2(i)) ? 0 : (x2(i) - x1(i)) / (
n - 1.0f);
3664 retval.
xelem (i, j) = x1(i) +
static_cast<float> (j)*delta[i];
base_det< FloatComplex > FloatComplexDET
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.
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
FloatColumnVector extract(octave_idx_type r1, octave_idx_type r2) const
void resize(octave_idx_type n, const FloatComplex &rfv=FloatComplex(0))
bool ishermitian(void) const
bool row_is_real_only(octave_idx_type) const
boolMatrix all(int dim=-1) const
FloatComplexMatrix sumsq(int dim=-1) const
FloatComplexMatrix pseudo_inverse(float tol=0.0) const
FloatComplexMatrix fourier2d(void) const
FloatComplexMatrix(void)=default
FloatComplexMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
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
FloatComplexMatrix hermitian(void) const
FloatComplexMatrix lssolve(const FloatMatrix &b) const
FloatMatrix abs(void) const
FloatComplexMatrix & operator+=(const FloatDiagMatrix &a)
FloatComplexRowVector row(octave_idx_type i) const
bool operator!=(const FloatComplexMatrix &a) const
FloatComplexMatrix fourier(void) const
FloatComplexColumnVector column(octave_idx_type i) const
FloatComplexMatrix ifourier2d(void) const
FloatComplexDET determinant(void) const
FloatComplexMatrix transpose(void) const
FloatComplexMatrix stack(const FloatMatrix &a) const
FloatComplexMatrix cumsum(int dim=-1) const
FloatComplexMatrix & insert(const FloatMatrix &a, octave_idx_type r, octave_idx_type c)
bool operator==(const FloatComplexMatrix &a) const
FloatComplexMatrix diag(octave_idx_type k=0) const
FloatComplexMatrix sum(int dim=-1) const
FloatComplexRowVector column_min(void) const
FloatComplexMatrix ifourier(void) const
FloatComplexColumnVector row_max(void) const
FloatComplexMatrix solve(MatrixType &mattype, const FloatMatrix &b) const
FloatComplexMatrix & operator-=(const FloatDiagMatrix &a)
boolMatrix any(int dim=-1) const
FloatComplexMatrix & fill(float val)
FloatComplexMatrix inverse(void) const
bool column_is_real_only(octave_idx_type) const
FloatComplexRowVector column_max(void) const
FloatComplexColumnVector row_min(void) const
FloatComplexMatrix append(const FloatMatrix &a) const
FloatComplexMatrix tinverse(MatrixType &mattype, octave_idx_type &info, float &rcon, bool force, bool calc_cond) 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
FloatComplexMatrix cumprod(int dim=-1) const
friend OCTAVE_API FloatComplexMatrix conj(const FloatComplexMatrix &a)
FloatComplexMatrix prod(int dim=-1) const
FloatComplexMatrix fsolve(MatrixType &mattype, const FloatComplexMatrix &b, octave_idx_type &info, float &rcon, solve_singularity_handler sing_handler, bool calc_cond=false) const
FloatComplexMatrix extract_n(octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const
FloatComplexMatrix finverse(MatrixType &mattype, octave_idx_type &info, float &rcon, bool force, bool calc_cond) const
FloatNDArray abs(void) const
FloatComplexNDArray sum(int dim=-1) const
FloatComplexNDArray cumprod(int dim=-1) const
FloatComplexNDArray sumsq(int dim=-1) const
FloatComplexNDArray prod(int dim=-1) const
FloatComplexNDArray cumsum(int dim=-1) const
boolNDArray all(int dim=-1) const
boolNDArray any(int dim=-1) const
FloatComplexNDArray diag(octave_idx_type k=0) const
void resize(octave_idx_type n, const FloatComplex &rfv=FloatComplex(0))
FloatDiagMatrix inverse(void) const
FloatColumnVector extract_diag(octave_idx_type k=0) const
FloatMatrix sum(int dim=-1) const
FloatRowVector row(octave_idx_type i) const
bool ishermitian(void) const
void mark_as_rectangular(void)
void mark_as_unsymmetric(void)
int type(bool quiet=true)
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_CONST_CMPLX_ARG(x)
#define F77_XFCN(f, F, args)
octave_f77_int_type F77_INT
FloatComplexMatrix Sylvester(const FloatComplexMatrix &a, const FloatComplexMatrix &b, const FloatComplexMatrix &c)
FloatComplexMatrix xgemm(const FloatComplexMatrix &a, const FloatComplexMatrix &b, blas_trans_type transa, blas_trans_type transb)
FloatComplexMatrix operator*(const FloatColumnVector &v, const FloatComplexRowVector &a)
FloatComplexMatrix max(const FloatComplex &c, const FloatComplexMatrix &m)
static char get_blas_trans_arg(bool trans, bool conj)
static const FloatComplex FloatComplex_NaN_result(octave::numeric_limits< float >::NaN(), octave::numeric_limits< float >::NaN())
static float norm1(const FloatComplexMatrix &a)
FloatComplexMatrix linspace(const FloatComplexColumnVector &x1, const FloatComplexColumnVector &x2, octave_idx_type n)
#define EMPTY_RETURN_CHECK(T)
std::ostream & operator<<(std::ostream &os, const FloatComplexMatrix &a)
FloatComplexMatrix min(const FloatComplex &c, const FloatComplexMatrix &m)
FloatComplexMatrix conj(const FloatComplexMatrix &a)
std::istream & operator>>(std::istream &is, FloatComplexMatrix &a)
FloatComplexMatrix Givens(const FloatComplex &x, const FloatComplex &y)
double norm(const ColumnVector &v)
void scale(Matrix &m, double x, double y, double z)
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
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< float > FloatComplex
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
octave_value::octave_value(const Array< char > &chm, char type) return retval
subroutine xcdotc(n, zx, incx, zy, incy, retval)
subroutine xcdotu(n, zx, incx, zy, incy, 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)