26 #if defined (HAVE_CONFIG_H)
56 #include "mx-fdm-fm.h"
57 #include "mx-fm-fdm.h"
105 elem (ia(i), i) = 1.0;
119 elem (i, j) =
static_cast<unsigned char> (a.
elem (i, j));
134 return !(*
this == a);
167 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
168 (*current_liboctave_error_handler) (
"range error for insert");
187 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
188 (*current_liboctave_error_handler) (
"range error for insert");
208 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
209 (*current_liboctave_error_handler) (
"range error for insert");
211 fill (0.0,
r, c,
r + a_nr - 1, c + a_nc - 1);
232 if (nr > 0 && nc > 0)
251 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
252 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
253 (*current_liboctave_error_handler) (
"range error for fill");
255 if (r1 > r2) { std::swap (r1, r2); }
256 if (c1 > c2) { std::swap (c1, c2); }
258 if (r2 >= r1 && c2 >= c1)
276 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
291 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
305 if (nr != a.
numel ())
306 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
321 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
336 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
350 if (nc != a.
numel ())
351 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
366 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
381 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
406 if (r1 > r2) { std::swap (r1, r2); }
407 if (c1 > c2) { std::swap (c1, c2); }
443 float sum = colsum.
xelem (i);
462 return inverse (mattype, info, rcon, 0, 0);
470 return inverse (mattype, info, rcon, 0, 0);
475 bool calc_cond)
const
478 return inverse (mattype, info, rcon, force, calc_cond);
486 return inverse (mattype, info, rcon, 0, 0);
493 return inverse (mattype, info, rcon, 0, 0);
498 bool force,
bool calc_cond)
const
505 if (nr != nc || nr == 0 || nc == 0)
506 (*current_liboctave_error_handler) (
"inverse requires square matrix");
508 int typ = mattype.
type ();
516 F77_XFCN (strtri, STRTRI, (F77_CONST_CHAR_ARG2 (&uplo, 1),
517 F77_CONST_CHAR_ARG2 (&udiag, 1),
518 nr, tmp_data, nr, tmp_info
520 F77_CHAR_ARG_LEN (1)));
536 F77_XFCN (strcon, STRCON, (F77_CONST_CHAR_ARG2 (&job, 1),
537 F77_CONST_CHAR_ARG2 (&uplo, 1),
538 F77_CONST_CHAR_ARG2 (&udiag, 1),
539 nr, tmp_data, nr, rcon,
540 work, iwork, dtrcon_info
543 F77_CHAR_ARG_LEN (1)));
545 if (dtrcon_info != 0)
549 if (info == -1 && ! force)
557 bool force,
bool calc_cond)
const
564 if (nr != nc || nr == 0 || nc == 0)
565 (*current_liboctave_error_handler) (
"inverse requires square matrix");
568 F77_INT *pipvt = ipvt.fortran_vec ();
579 F77_XFCN (sgetri, SGETRI, (nc, tmp_data, nr, pipvt,
582 lwork =
static_cast<F77_INT> (z(0));
583 lwork = (lwork < 4 * nc ? 4 * nc : lwork);
595 F77_XFCN (sgetrf, SGETRF, (nc, nc, tmp_data, nr, pipvt, tmp_info));
611 F77_XFCN (sgecon, SGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
612 nc, tmp_data, nr, anorm,
613 rcon, pz, piz, sgecon_info
614 F77_CHAR_ARG_LEN (1)));
616 if (sgecon_info != 0)
620 if (info == -1 && ! force)
626 F77_XFCN (sgetri, SGETRI, (nc, tmp_data, nr, pipvt,
627 pz, lwork, dgetri_info));
629 if (dgetri_info != 0)
641 bool force,
bool calc_cond)
const
643 int typ = mattype.
type (
false);
647 typ = mattype.
type (*
this);
650 ret =
tinverse (mattype, info, rcon, force, calc_cond);
659 rcon =
chol.rcond ();
662 ret =
chol.inverse ();
669 ret =
finverse (mattype, info, rcon, force, calc_cond);
671 if ((calc_cond || mattype.
ishermitian ()) && rcon == 0.0
699 * std::numeric_limits<float>::epsilon ();
705 while (
r >= 0 && sigma.
elem (
r) < tol)
719 #if defined (HAVE_FFTW)
729 size_t npts, nsamples;
731 if (nr == 1 || nc == 1)
733 npts = (nr > nc ? nr : nc);
758 size_t npts, nsamples;
760 if (nr == 1 || nc == 1)
762 npts = (nr > nc ? nr : nc);
810 (*current_liboctave_error_handler)
811 (
"support for FFTW was unavailable or disabled when liboctave was built");
819 (*current_liboctave_error_handler)
820 (
"support for FFTW was unavailable or disabled when liboctave was built");
828 (*current_liboctave_error_handler)
829 (
"support for FFTW was unavailable or disabled when liboctave was built");
837 (*current_liboctave_error_handler)
838 (
"support for FFTW was unavailable or disabled when liboctave was built");
862 bool calc_cond)
const
865 return determinant (mattype, info, rcon, calc_cond);
871 bool calc_cond)
const
882 (*current_liboctave_error_handler) (
"matrix must be square");
884 volatile int typ = mattype.
type ();
891 typ = mattype.
type (*
this);
897 for (
F77_INT i = 0; i < nc; i++)
908 anorm =
norm1 (*
this);
913 F77_XFCN (spotrf, SPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
914 tmp_data, nr, tmp_info
915 F77_CHAR_ARG_LEN (1)));
934 F77_XFCN (spocon, SPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
935 nr, tmp_data, nr, anorm,
936 rcon, pz, piz, tmp_info
937 F77_CHAR_ARG_LEN (1)));
945 for (
F77_INT i = 0; i < nc; i++)
952 (*current_liboctave_error_handler) (
"det: invalid dense matrix type");
968 anorm =
norm1 (*
this);
970 F77_XFCN (sgetrf, SGETRF, (nr, nr, tmp_data, nr, pipvt, tmp_info));
992 F77_XFCN (sgecon, SGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
993 nc, tmp_data, nr, anorm,
994 rcon, pz, piz, tmp_info
995 F77_CHAR_ARG_LEN (1)));
1007 for (
F77_INT i = 0; i < nc; i++)
1009 float c = atmp(i,i);
1010 retval *= (ipvt(i) != (i+1)) ? -c : c;
1023 return rcond (mattype);
1034 (*current_liboctave_error_handler) (
"matrix must be square");
1036 if (nr == 0 || nc == 0)
1040 volatile int typ = mattype.
type ();
1043 typ = mattype.
type (*
this);
1059 F77_XFCN (strcon, STRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1060 F77_CONST_CHAR_ARG2 (&uplo, 1),
1061 F77_CONST_CHAR_ARG2 (&dia, 1),
1062 nr, tmp_data, nr, rcon,
1064 F77_CHAR_ARG_LEN (1)
1065 F77_CHAR_ARG_LEN (1)
1066 F77_CHAR_ARG_LEN (1)));
1072 (*current_liboctave_error_handler)
1073 (
"permuted triangular matrix not implemented");
1087 F77_XFCN (strcon, STRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1088 F77_CONST_CHAR_ARG2 (&uplo, 1),
1089 F77_CONST_CHAR_ARG2 (&dia, 1),
1090 nr, tmp_data, nr, rcon,
1092 F77_CHAR_ARG_LEN (1)
1093 F77_CHAR_ARG_LEN (1)
1094 F77_CHAR_ARG_LEN (1)));
1100 (*current_liboctave_error_handler)
1101 (
"permuted triangular matrix not implemented");
1114 anorm =
norm1 (atmp);
1116 F77_XFCN (spotrf, SPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1118 F77_CHAR_ARG_LEN (1)));
1133 F77_XFCN (spocon, SPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1134 nr, tmp_data, nr, anorm,
1136 F77_CHAR_ARG_LEN (1)));
1154 anorm =
norm1 (atmp);
1161 F77_XFCN (sgetrf, SGETRF, (nr, nr, tmp_data, nr, pipvt, info));
1171 F77_XFCN (sgecon, SGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1172 nc, tmp_data, nr, anorm,
1174 F77_CHAR_ARG_LEN (1)));
1191 float& rcon, solve_singularity_handler sing_handler,
1203 (*current_liboctave_error_handler)
1204 (
"matrix dimension mismatch solution of linear equations");
1206 if (nr == 0 || nc == 0 || b_nc == 0)
1210 volatile int typ = mattype.
type ();
1218 (*current_liboctave_error_handler)
1219 (
"permuted triangular matrix not implemented");
1233 F77_XFCN (strtrs, STRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1234 F77_CONST_CHAR_ARG2 (&trans, 1),
1235 F77_CONST_CHAR_ARG2 (&dia, 1),
1236 nr, b_nc, tmp_data, nr,
1237 result, nr, tmp_info
1238 F77_CHAR_ARG_LEN (1)
1239 F77_CHAR_ARG_LEN (1)
1240 F77_CHAR_ARG_LEN (1)));
1255 F77_XFCN (strcon, STRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1256 F77_CONST_CHAR_ARG2 (&uplo, 1),
1257 F77_CONST_CHAR_ARG2 (&dia, 1),
1258 nr, tmp_data, nr, rcon,
1260 F77_CHAR_ARG_LEN (1)
1261 F77_CHAR_ARG_LEN (1)
1262 F77_CHAR_ARG_LEN (1)));
1269 volatile float rcond_plus_one = rcon + 1.0;
1276 sing_handler (rcon);
1294 float& rcon, solve_singularity_handler sing_handler,
1306 (*current_liboctave_error_handler)
1307 (
"matrix dimension mismatch solution of linear equations");
1309 if (nr == 0 || nc == 0 || b_nc == 0)
1313 volatile int typ = mattype.
type ();
1321 (*current_liboctave_error_handler)
1322 (
"permuted triangular matrix not implemented");
1336 F77_XFCN (strtrs, STRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1337 F77_CONST_CHAR_ARG2 (&trans, 1),
1338 F77_CONST_CHAR_ARG2 (&dia, 1),
1339 nr, b_nc, tmp_data, nr,
1340 result, nr, tmp_info
1341 F77_CHAR_ARG_LEN (1)
1342 F77_CHAR_ARG_LEN (1)
1343 F77_CHAR_ARG_LEN (1)));
1358 F77_XFCN (strcon, STRCON, (F77_CONST_CHAR_ARG2 (&
norm, 1),
1359 F77_CONST_CHAR_ARG2 (&uplo, 1),
1360 F77_CONST_CHAR_ARG2 (&dia, 1),
1361 nr, tmp_data, nr, rcon,
1363 F77_CHAR_ARG_LEN (1)
1364 F77_CHAR_ARG_LEN (1)
1365 F77_CHAR_ARG_LEN (1)));
1372 volatile float rcond_plus_one = rcon + 1.0;
1379 sing_handler (rcon);
1396 float& rcon, solve_singularity_handler sing_handler,
1397 bool calc_cond)
const
1407 if (nr != nc || nr != b_nr)
1408 (*current_liboctave_error_handler)
1409 (
"matrix dimension mismatch solution of linear equations");
1411 if (nr == 0 || b_nc == 0)
1415 volatile int typ = mattype.
type ();
1430 anorm =
norm1 (atmp);
1434 F77_XFCN (spotrf, SPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1435 tmp_data, nr, tmp_info
1436 F77_CHAR_ARG_LEN (1)));
1458 F77_XFCN (spocon, SPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1459 nr, tmp_data, nr, anorm,
1460 rcon, pz, piz, tmp_info
1461 F77_CHAR_ARG_LEN (1)));
1468 volatile float rcond_plus_one = rcon + 1.0;
1475 sing_handler (rcon);
1486 F77_XFCN (spotrs, SPOTRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1487 nr, b_nc, tmp_data, nr,
1488 result, b_nr, tmp_info
1489 F77_CHAR_ARG_LEN (1)));
1511 if (calc_cond && anorm < 0.0)
1512 anorm =
norm1 (atmp);
1521 F77_XFCN (sgetrf, SGETRF, (nr, nr, tmp_data, nr, pipvt, tmp_info));
1532 sing_handler (rcon);
1544 F77_XFCN (sgecon, SGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1545 nc, tmp_data, nr, anorm,
1546 rcon, pz, piz, tmp_info
1547 F77_CHAR_ARG_LEN (1)));
1554 volatile float rcond_plus_one = rcon + 1.0;
1561 sing_handler (rcon);
1573 F77_XFCN (sgetrs, SGETRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1574 nr, b_nc, tmp_data, nr,
1575 pipvt, result, b_nr, tmp_info
1576 F77_CHAR_ARG_LEN (1)));
1585 (*current_liboctave_error_handler) (
"incorrect matrix type");
1596 return solve (mattype, b, info, rcon,
nullptr);
1604 return solve (mattype, b, info, rcon,
nullptr);
1611 return solve (mattype, b, info, rcon,
nullptr);
1617 float& rcon, solve_singularity_handler sing_handler,
1621 int typ = mattype.
type ();
1624 typ = mattype.
type (*
this);
1628 retval =
utsolve (mattype, b, info, rcon, sing_handler,
true, transt);
1630 retval =
ltsolve (mattype, b, info, rcon, sing_handler,
true, transt);
1635 retval =
fsolve (mattype, b, info, rcon, sing_handler,
true);
1637 (*current_liboctave_error_handler) (
"unknown matrix type");
1654 return solve (mattype, b, info, rcon,
nullptr);
1662 return solve (mattype, b, info, rcon,
nullptr);
1670 return solve (mattype, b, info, rcon,
nullptr);
1697 const float *smd = sm.
data ();
1707 float& rcon, solve_singularity_handler sing_handler,
1711 tmp =
solve (mattype, tmp, info, rcon, sing_handler, singular_fallback,
1721 return solve (mattype, b, info, rcon);
1729 return solve (mattype, b, info, rcon);
1737 return solve (mattype, b, info, rcon,
nullptr);
1743 float& rcon, solve_singularity_handler sing_handler,
1747 tmp =
solve (mattype, tmp, info, rcon, sing_handler,
true, transt);
1756 return tmp.
solve (mattype, b);
1764 return tmp.
solve (mattype, b, info);
1772 return tmp.
solve (mattype, b, info, rcon);
1778 solve_singularity_handler sing_handler,
1782 return tmp.
solve (mattype, b, info, rcon, sing_handler, transt);
1790 return solve (b, info, rcon,
nullptr);
1797 return solve (b, info, rcon,
nullptr);
1804 return solve (b, info, rcon,
nullptr);
1809 float& rcon, solve_singularity_handler sing_handler,
1813 return solve (mattype, b, info, rcon, sing_handler,
true, transt);
1820 return tmp.
solve (b);
1827 return tmp.
solve (b, info);
1835 return tmp.
solve (b, info, rcon);
1841 solve_singularity_handler sing_handler,
1845 return tmp.
solve (b, info, rcon, sing_handler, transt);
1852 return solve (b, info, rcon);
1859 return solve (b, info, rcon);
1866 return solve (b, info, rcon,
nullptr);
1871 float& rcon, solve_singularity_handler sing_handler,
1875 return solve (mattype, b, info, rcon, sing_handler, transt);
1882 return tmp.
solve (b);
1890 return tmp.
solve (b, info);
1898 return tmp.
solve (b, info, rcon);
1903 float& rcon, solve_singularity_handler sing_handler,
1907 return tmp.
solve (b, info, rcon, sing_handler, transt);
1916 return lssolve (b, info, rank, rcon);
1924 return lssolve (b, info, rank, rcon);
1932 return lssolve (b, info, rank, rcon);
1950 (*current_liboctave_error_handler)
1951 (
"matrix dimension mismatch solution of linear equations");
1953 if (
m == 0 ||
n == 0 || b_nc == 0)
1964 for (
F77_INT j = 0; j < nrhs; j++)
1985 F77_CONST_CHAR_ARG2 (
" ", 1),
1987 F77_CHAR_ARG_LEN (6)
1988 F77_CHAR_ARG_LEN (1));
1992 F77_CONST_CHAR_ARG2 (
" ", 1),
1993 m,
n, nrhs, -1, mnthr
1994 F77_CHAR_ARG_LEN (6)
1995 F77_CHAR_ARG_LEN (1));
1999 float dminmn =
static_cast<float> (minmn);
2000 float dsmlsizp1 =
static_cast<float> (smlsiz+1);
2007 F77_INT liwork = 3 * minmn * nlvl + 11 * minmn;
2016 F77_XFCN (sgelsd, SGELSD, (
m,
n, nrhs, tmp_data,
m, pretval, maxmn,
2018 lwork, piwork, tmp_info));
2027 if (
n >
m &&
n >= mnthr)
2030 = 9*
m + 2*
m*smlsiz + 8*
m*nlvl +
m*nrhs + (smlsiz+1)*(smlsiz+1);
2043 if (wlalsd > addend)
2046 const F77_INT lworkaround = 4*
m +
m*
m + addend;
2048 if (work(0) < lworkaround)
2049 work(0) = lworkaround;
2054 = 12*
n + 2*
n*smlsiz + 8*
n*nlvl +
n*nrhs + (smlsiz+1)*(smlsiz+1);
2056 if (work(0) < lworkaround)
2057 work(0) = lworkaround;
2060 lwork =
static_cast<F77_INT> (work(0));
2063 float anorm =
norm1 (*
this);
2078 F77_XFCN (sgelsd, SGELSD, (
m,
n, nrhs, tmp_data,
m, pretval,
2079 maxmn, ps, rcon, tmp_rank,
2086 if (s.
elem (0) == 0.0)
2089 rcon = s.
elem (minmn - 1) / s.
elem (0);
2105 return tmp.
lssolve (b, info, rank, rcon);
2114 return tmp.
lssolve (b, info, rank, rcon);
2123 return tmp.
lssolve (b, info, rank, rcon);
2131 return tmp.
lssolve (b, info, rank, rcon);
2140 return lssolve (b, info, rank, rcon);
2148 return lssolve (b, info, rank, rcon);
2156 return lssolve (b, info, rank, rcon);
2171 (*current_liboctave_error_handler)
2172 (
"matrix dimension mismatch solution of linear equations");
2174 if (
m == 0 ||
n == 0)
2206 F77_CONST_CHAR_ARG2 (
" ", 1),
2208 F77_CHAR_ARG_LEN (6)
2209 F77_CHAR_ARG_LEN (1));
2213 float dminmn =
static_cast<float> (minmn);
2214 float dsmlsizp1 =
static_cast<float> (smlsiz+1);
2221 F77_INT liwork = 3 * minmn * nlvl + 11 * minmn;
2230 F77_XFCN (sgelsd, SGELSD, (
m,
n, nrhs, tmp_data,
m, pretval, maxmn,
2232 lwork, piwork, tmp_info));
2237 lwork =
static_cast<F77_INT> (work(0));
2240 F77_XFCN (sgelsd, SGELSD, (
m,
n, nrhs, tmp_data,
m, pretval,
2241 maxmn, ps, rcon, tmp_rank,
2250 if (s.
elem (0) == 0.0)
2253 rcon = s.
elem (minmn - 1) / s.
elem (0);
2269 return tmp.
lssolve (b, info, rank, rcon);
2279 return tmp.
lssolve (b, info, rank, rcon);
2288 return tmp.
lssolve (b, info, rank, rcon);
2296 return tmp.
lssolve (b, info, rank, rcon);
2308 if (nr != a_nr || nc != a_nc)
2326 if (nr != a_nr || nc != a_nc)
2351 F77_XFCN (sgemm, SGEMM, (F77_CONST_CHAR_ARG2 (
"N", 1),
2352 F77_CONST_CHAR_ARG2 (
"N", 1),
2355 F77_CHAR_ARG_LEN (1)
2356 F77_CHAR_ARG_LEN (1)));
2414 if (nr == 1 || nc == 1)
2437 if (nr > 0 && nc > 0)
2448 for (idx_j = 0; idx_j < nc; idx_j++)
2450 tmp_min =
elem (i, idx_j);
2458 float tmp =
elem (i, j);
2462 else if (tmp < tmp_min)
2469 result.
elem (i) = tmp_min;
2492 if (nr > 0 && nc > 0)
2503 for (idx_j = 0; idx_j < nc; idx_j++)
2505 tmp_max =
elem (i, idx_j);
2513 float tmp =
elem (i, j);
2517 else if (tmp > tmp_max)
2524 result.
elem (i) = tmp_max;
2547 if (nr > 0 && nc > 0)
2558 for (idx_i = 0; idx_i < nr; idx_i++)
2560 tmp_min =
elem (idx_i, j);
2568 float tmp =
elem (i, j);
2572 else if (tmp < tmp_min)
2579 result.
elem (j) = tmp_min;
2602 if (nr > 0 && nc > 0)
2613 for (idx_i = 0; idx_i < nr; idx_i++)
2615 tmp_max =
elem (idx_i, j);
2623 float tmp =
elem (i, j);
2627 else if (tmp > tmp_max)
2634 result.
elem (j) = tmp_max;
2663 if (nr > 0 && nc > 0)
2669 tmp = octave_read_value<float> (is);
2671 a.
elem (i, j) = tmp;
2683 float cc, s, temp_r;
2685 F77_FUNC (slartg, SLARTG) (
x, y, cc, s, temp_r);
2732 F77_XFCN (strsyl, STRSYL, (F77_CONST_CHAR_ARG2 (
"N", 1),
2733 F77_CONST_CHAR_ARG2 (
"N", 1),
2734 1, a_nr, b_nr, pa, a_nr, pb,
2735 b_nr, px, a_nr,
scale, info
2736 F77_CHAR_ARG_LEN (1)
2737 F77_CHAR_ARG_LEN (1)));
2770 return trans ?
'T' :
'N';
2793 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
2795 else if (a.
data () == b.
data () && a_nr == b_nc && tra != trb)
2803 F77_XFCN (ssyrk, SSYRK, (F77_CONST_CHAR_ARG2 (
"U", 1),
2804 F77_CONST_CHAR_ARG2 (&ctra, 1),
2806 a.
data (), lda, 0.0, c, a_nr
2807 F77_CHAR_ARG_LEN (1)
2808 F77_CHAR_ARG_LEN (1)));
2809 for (
int j = 0; j < a_nr; j++)
2810 for (
int i = 0; i < j; i++)
2831 F77_XFCN (sgemv, SGEMV, (F77_CONST_CHAR_ARG2 (&ctra, 1),
2832 lda, tda, 1.0, a.
data (), lda,
2833 b.
data (), 1, 0.0, c, 1
2834 F77_CHAR_ARG_LEN (1)));
2840 F77_XFCN (sgemv, SGEMV, (F77_CONST_CHAR_ARG2 (&crevtrb, 1),
2841 ldb, tdb, 1.0, b.
data (), ldb,
2842 a.
data (), 1, 0.0, c, 1
2843 F77_CHAR_ARG_LEN (1)));
2849 F77_XFCN (sgemm, SGEMM, (F77_CONST_CHAR_ARG2 (&ctra, 1),
2850 F77_CONST_CHAR_ARG2 (&ctrb, 1),
2851 a_nr, b_nc, a_nc, 1.0, a.
data (),
2852 lda, b.
data (), ldb, 0.0, c, a_nr
2853 F77_CHAR_ARG_LEN (1)
2854 F77_CHAR_ARG_LEN (1)));
2864 return xgemm (a, b);
2869 #define EMPTY_RETURN_CHECK(T) \
2870 if (nr == 0 || nc == 0) \
2920 (*current_liboctave_error_handler)
2921 (
"two-arg min requires same size arguments");
2984 (*current_liboctave_error_handler)
2985 (
"two-arg max requires same size arguments");
3009 (*current_liboctave_error_handler)
3010 (
"linspace: vectors must be of equal length");
3027 delta[i] = (x1(i) == x2(i)) ? 0 : (x2(i) - x1(i)) / (
n - 1);
base_det< float > FloatDET
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
void resize(octave_idx_type n, const float &rfv=0)
FloatColumnVector extract(octave_idx_type r1, octave_idx_type r2) const
FloatComplexMatrix lssolve(const FloatMatrix &b) const
FloatComplexMatrix solve(MatrixType &mattype, const FloatMatrix &b) const
FloatDiagMatrix inverse(void) const
FloatColumnVector extract_diag(octave_idx_type k=0) const
FloatDET determinant(void) const
FloatMatrix fsolve(MatrixType &mattype, const FloatMatrix &b, octave_idx_type &info, float &rcon, solve_singularity_handler sing_handler, bool calc_cond=false) const
FloatComplexMatrix ifourier(void) const
FloatComplexMatrix ifourier2d(void) const
bool issymmetric(void) const
FloatMatrix abs(void) const
FloatMatrix transpose(void) const
FloatMatrix sumsq(int dim=-1) const
FloatMatrix sum(int dim=-1) const
bool operator==(const FloatMatrix &a) const
FloatMatrix lssolve(const FloatMatrix &b) const
FloatMatrix utsolve(MatrixType &mattype, const FloatMatrix &b, octave_idx_type &info, float &rcon, solve_singularity_handler sing_handler, bool calc_cond=false, blas_trans_type transt=blas_no_trans) const
friend class FloatComplexMatrix
FloatMatrix & fill(float val)
FloatColumnVector row_max(void) const
FloatMatrix(void)=default
FloatComplexMatrix fourier2d(void) const
FloatMatrix prod(int dim=-1) const
FloatMatrix & insert(const FloatMatrix &a, octave_idx_type r, octave_idx_type c)
FloatRowVector row(octave_idx_type i) const
FloatColumnVector row_min(void) const
FloatMatrix & operator-=(const FloatDiagMatrix &a)
FloatMatrix ltsolve(MatrixType &mattype, const FloatMatrix &b, octave_idx_type &info, float &rcon, solve_singularity_handler sing_handler, bool calc_cond=false, blas_trans_type transt=blas_no_trans) const
FloatMatrix & operator+=(const FloatDiagMatrix &a)
FloatMatrix inverse(void) const
FloatRowVector column_max(void) const
FloatMatrix tinverse(MatrixType &mattype, octave_idx_type &info, float &rcon, bool force, bool calc_cond) const
FloatRowVector column_min(void) const
FloatMatrix solve(MatrixType &mattype, const FloatMatrix &b) const
FloatMatrix cumsum(int dim=-1) const
FloatMatrix append(const FloatMatrix &a) const
FloatMatrix diag(octave_idx_type k=0) const
bool operator!=(const FloatMatrix &a) const
FloatMatrix finverse(MatrixType &mattype, octave_idx_type &info, float &rcon, bool force, bool calc_cond) const
FloatMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
FloatMatrix cumprod(int dim=-1) const
FloatMatrix extract_n(octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const
FloatComplexMatrix fourier(void) const
FloatColumnVector column(octave_idx_type i) const
FloatMatrix stack(const FloatMatrix &a) const
FloatMatrix pseudo_inverse(float tol=0.0) const
FloatNDArray sum(int dim=-1) const
FloatNDArray prod(int dim=-1) const
FloatNDArray cumprod(int dim=-1) const
FloatNDArray & insert(const FloatNDArray &a, octave_idx_type r, octave_idx_type c)
FloatNDArray cumsum(int dim=-1) const
FloatNDArray sumsq(int dim=-1) const
FloatNDArray abs(void) const
FloatNDArray diag(octave_idx_type k=0) const
void resize(octave_idx_type n, const float &rfv=0)
bool ishermitian(void) const
void mark_as_rectangular(void)
void mark_as_unsymmetric(void)
int type(bool quiet=true)
const Array< octave_idx_type > & col_perm_vec(void) const
octave_idx_type rows(void) 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
#define F77_XFCN(f, F, args)
octave_f77_int_type F77_INT
std::ostream & operator<<(std::ostream &os, const FloatMatrix &a)
FloatMatrix operator*(const FloatColumnVector &v, const FloatRowVector &a)
static FloatComplexMatrix unstack_complex_matrix(const FloatMatrix &sm)
static FloatMatrix stack_complex_matrix(const FloatComplexMatrix &cm)
FloatMatrix linspace(const FloatColumnVector &x1, const FloatColumnVector &x2, octave_idx_type n)
FloatMatrix min(float d, const FloatMatrix &m)
#define EMPTY_RETURN_CHECK(T)
FloatMatrix real(const FloatComplexMatrix &a)
FloatMatrix imag(const FloatComplexMatrix &a)
static char get_blas_trans_arg(bool trans)
FloatMatrix max(float d, const FloatMatrix &m)
std::istream & operator>>(std::istream &is, FloatMatrix &a)
static float norm1(const FloatMatrix &a)
FloatMatrix Givens(float x, float y)
FloatMatrix Sylvester(const FloatMatrix &a, const FloatMatrix &b, const FloatMatrix &c)
FloatMatrix xgemm(const FloatMatrix &a, const FloatMatrix &b, blas_trans_type transa, blas_trans_type transb)
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_float(std::ostream &os, float d)
char get_blas_char(blas_trans_type transt)
void mx_inline_imag(size_t n, T *r, const std::complex< T > *x)
void mx_inline_real(size_t n, T *r, const std::complex< T > *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
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 xsdot(n, dx, incx, dy, incy, retval)