26 #if defined (HAVE_CONFIG_H)
120 elem (
i, j) =
static_cast<unsigned char> (a.
elem (
i, j));
135 return !(*
this ==
a);
168 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
169 (*current_liboctave_error_handler) (
"range error for insert");
188 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
189 (*current_liboctave_error_handler) (
"range error for insert");
209 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
210 (*current_liboctave_error_handler) (
"range error for insert");
212 fill (0.0, r, c, r + a_nr - 1, c + a_nc - 1);
233 if (nr > 0 && nc > 0)
252 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
253 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
254 (*current_liboctave_error_handler) (
"range error for fill");
259 if (r2 >= r1 && c2 >= c1)
281 retval.insert (*
this, 0, 0);
282 retval.insert (a, 0, nc_insert);
292 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
296 retval.insert (*
this, 0, 0);
297 retval.insert (a, 0, nc_insert);
306 if (nr != a.
numel ())
311 retval.
insert (*
this, 0, 0);
312 retval.
insert (a, 0, nc_insert);
326 retval.insert (*
this, 0, 0);
327 retval.insert (a, 0, nc_insert);
341 retval.insert (*
this, 0, 0);
342 retval.insert (a, nr_insert, 0);
351 if (nc != a.
numel ())
356 retval.
insert (*
this, 0, 0);
357 retval.
insert (a, nr_insert, 0);
367 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
371 retval.insert (*
this, 0, 0);
372 retval.insert (a, nr_insert, 0);
386 retval.insert (*
this, 0, 0);
387 retval.insert (a, nr_insert, 0);
440 return inverse (mattype, info, rcon, 0, 0);
448 return inverse (mattype, info, rcon, 0, 0);
453 bool calc_cond)
const
456 return inverse (mattype, info, rcon, force, calc_cond);
464 return inverse (mattype, info, rcon, 0, 0);
471 return inverse (mattype, info, rcon, 0, 0);
476 bool force,
bool calc_cond)
const
483 if (nr != nc || nr == 0 || nc == 0)
484 (*current_liboctave_error_handler) (
"inverse requires square matrix");
486 int typ = mattype.
type ();
492 F77_XFCN (strtri, STRTRI, (F77_CONST_CHAR_ARG2 (&uplo, 1),
493 F77_CONST_CHAR_ARG2 (&udiag, 1),
494 nr, tmp_data, nr, info
496 F77_CHAR_ARG_LEN (1)));
510 F77_XFCN (strcon, STRCON, (F77_CONST_CHAR_ARG2 (&job, 1),
511 F77_CONST_CHAR_ARG2 (&uplo, 1),
512 F77_CONST_CHAR_ARG2 (&udiag, 1),
513 nr, tmp_data, nr, rcon,
514 work, iwork, dtrcon_info
517 F77_CHAR_ARG_LEN (1)));
519 if (dtrcon_info != 0)
523 if (info == -1 && ! force)
531 bool force,
bool calc_cond)
const
538 if (nr != nc || nr == 0 || nc == 0)
539 (*current_liboctave_error_handler) (
"inverse requires square matrix");
551 F77_XFCN (sgetri, SGETRI, (nc, tmp_data, nr, pipvt,
555 lwork = (lwork < 2 *nc ? 2*nc : lwork);
564 anorm = retval.
abs ().
sum ().
row (static_cast<octave_idx_type>(0))
567 F77_XFCN (sgetrf, SGETRF, (nc, nc, tmp_data, nr, pipvt, info));
581 F77_XFCN (sgecon, SGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
582 nc, tmp_data, nr, anorm,
583 rcon, pz, piz, dgecon_info
584 F77_CHAR_ARG_LEN (1)));
586 if (dgecon_info != 0)
590 if (info == -1 && ! force)
596 F77_XFCN (sgetri, SGETRI, (nc, tmp_data, nr, pipvt,
597 pz, lwork, dgetri_info));
599 if (dgetri_info != 0)
611 bool force,
bool calc_cond)
const
613 int typ = mattype.
type (
false);
617 typ = mattype.
type (*
this);
620 ret =
tinverse (mattype, info, rcon, force, calc_cond);
629 rcon = chol.
rcond ();
639 ret =
finverse (mattype, info, rcon, force, calc_cond);
641 if ((mattype.
is_hermitian () || calc_cond) && rcon == 0.)
667 tol = nr * sigma.
elem (0) * std::numeric_limits<double>::epsilon ();
669 tol = nc * sigma.
elem (0) * std::numeric_limits<double>::epsilon ();
672 while (r >= 0 && sigma.
elem (r) < tol)
686 #if defined (HAVE_FFTW)
696 size_t npts, nsamples;
698 if (nr == 1 || nc == 1)
700 npts = nr > nc ? nr : nc;
725 size_t npts, nsamples;
727 if (nr == 1 || nc == 1)
729 npts = nr > nc ? nr : nc;
786 if (nr == 1 || nc == 1)
788 npts = nr > nc ? nr : nc;
828 if (nr == 1 || nc == 1)
830 npts = nr > nc ? nr : nc;
858 tmp_data[j] = tmp_data[j] / static_cast<float> (npts);
873 if (nr == 1 || nc == 1)
875 npts = nr > nc ? nr : nc;
907 pwsave = wsave.fortran_vec ();
919 prow[
i] = tmp_data[
i*nr + j];
924 tmp_data[
i*nr + j] = prow[
i];
940 if (nr == 1 || nc == 1)
942 npts = nr > nc ? nr : nc;
970 tmp_data[j] = tmp_data[j] / static_cast<float> (npts);
977 pwsave = wsave.fortran_vec ();
989 prow[
i] = tmp_data[
i*nr + j];
994 tmp_data[
i*nr + j] = prow[
i] / static_cast<float> (npts);
1019 bool calc_cond)
const
1022 return determinant (mattype, info, rcon, calc_cond);
1028 bool calc_cond)
const
1039 (*current_liboctave_error_handler) (
"matrix must be square");
1041 volatile int typ = mattype.
type ();
1048 typ = mattype.
type (*
this);
1063 if (calc_cond) anorm =
xnorm (*
this, 1);
1066 F77_XFCN (spotrf, SPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1068 F77_CHAR_ARG_LEN (1)));
1083 F77_XFCN (spocon, SPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1084 nr, tmp_data, nr, anorm,
1086 F77_CHAR_ARG_LEN (1)));
1092 retval *= atmp (
i,
i);
1094 retval = retval.
square ();
1098 (*current_liboctave_error_handler) (
"det: invalid dense matrix type");
1112 if (calc_cond) anorm =
xnorm (*
this, 1);
1114 F77_XFCN (sgetrf, SGETRF, (nr, nr, tmp_data, nr, pipvt, info));
1134 F77_XFCN (sgecon, SGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1135 nc, tmp_data, nr, anorm,
1137 F77_CHAR_ARG_LEN (1)));
1149 float c = atmp(
i,
i);
1150 retval *= (ipvt(
i) != (
i+1)) ? -c :
c;
1163 return rcond (mattype);
1174 (*current_liboctave_error_handler) (
"matrix must be square");
1176 if (nr == 0 || nc == 0)
1180 volatile int typ = mattype.
type ();
1183 typ = mattype.
type (*
this);
1199 F77_XFCN (strcon, STRCON, (F77_CONST_CHAR_ARG2 (&norm, 1),
1200 F77_CONST_CHAR_ARG2 (&uplo, 1),
1201 F77_CONST_CHAR_ARG2 (&dia, 1),
1202 nr, tmp_data, nr, rcon,
1204 F77_CHAR_ARG_LEN (1)
1205 F77_CHAR_ARG_LEN (1)
1206 F77_CHAR_ARG_LEN (1)));
1212 (*current_liboctave_error_handler)
1213 (
"permuted triangular matrix not implemented");
1227 F77_XFCN (strcon, STRCON, (F77_CONST_CHAR_ARG2 (&norm, 1),
1228 F77_CONST_CHAR_ARG2 (&uplo, 1),
1229 F77_CONST_CHAR_ARG2 (&dia, 1),
1230 nr, tmp_data, nr, rcon,
1232 F77_CHAR_ARG_LEN (1)
1233 F77_CHAR_ARG_LEN (1)
1234 F77_CHAR_ARG_LEN (1)));
1240 (*current_liboctave_error_handler)
1241 (
"permuted triangular matrix not implemented");
1254 anorm = atmp.
abs().
sum().
1255 row(static_cast<octave_idx_type>(0)).
max();
1257 F77_XFCN (spotrf, SPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1259 F77_CHAR_ARG_LEN (1)));
1274 F77_XFCN (spocon, SPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1275 nr, tmp_data, nr, anorm,
1277 F77_CHAR_ARG_LEN (1)));
1295 anorm = atmp.
abs ().
sum ().
1296 row(static_cast<octave_idx_type>(0)).
max ();
1303 F77_XFCN (sgetrf, SGETRF, (nr, nr, tmp_data, nr, pipvt, info));
1313 F77_XFCN (sgecon, SGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1314 nc, tmp_data, nr, anorm,
1316 F77_CHAR_ARG_LEN (1)));
1333 float& rcon, solve_singularity_handler sing_handler,
1341 if (nr != b.
rows ())
1343 (
"matrix dimension mismatch solution of linear equations");
1345 if (nr == 0 || nc == 0 || b.
cols () == 0)
1349 volatile int typ = mattype.
type ();
1358 (*current_liboctave_error_handler)
1359 (
"permuted triangular matrix not implemented");
1371 F77_XFCN (strtrs, STRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1372 F77_CONST_CHAR_ARG2 (&trans, 1),
1373 F77_CONST_CHAR_ARG2 (&dia, 1),
1374 nr, b_nc, tmp_data, nr,
1376 F77_CHAR_ARG_LEN (1)
1377 F77_CHAR_ARG_LEN (1)
1378 F77_CHAR_ARG_LEN (1)));
1391 F77_XFCN (strcon, STRCON, (F77_CONST_CHAR_ARG2 (&norm, 1),
1392 F77_CONST_CHAR_ARG2 (&uplo, 1),
1393 F77_CONST_CHAR_ARG2 (&dia, 1),
1394 nr, tmp_data, nr, rcon,
1396 F77_CHAR_ARG_LEN (1)
1397 F77_CHAR_ARG_LEN (1)
1398 F77_CHAR_ARG_LEN (1)));
1403 volatile float rcond_plus_one = rcon + 1.0;
1410 sing_handler (rcon);
1428 float& rcon, solve_singularity_handler sing_handler,
1436 if (nr != b.
rows ())
1438 (
"matrix dimension mismatch solution of linear equations");
1440 if (nr == 0 || nc == 0 || b.
cols () == 0)
1444 volatile int typ = mattype.
type ();
1453 (*current_liboctave_error_handler)
1454 (
"permuted triangular matrix not implemented");
1466 F77_XFCN (strtrs, STRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1467 F77_CONST_CHAR_ARG2 (&trans, 1),
1468 F77_CONST_CHAR_ARG2 (&dia, 1),
1469 nr, b_nc, tmp_data, nr,
1471 F77_CHAR_ARG_LEN (1)
1472 F77_CHAR_ARG_LEN (1)
1473 F77_CHAR_ARG_LEN (1)));
1486 F77_XFCN (strcon, STRCON, (F77_CONST_CHAR_ARG2 (&norm, 1),
1487 F77_CONST_CHAR_ARG2 (&uplo, 1),
1488 F77_CONST_CHAR_ARG2 (&dia, 1),
1489 nr, tmp_data, nr, rcon,
1491 F77_CHAR_ARG_LEN (1)
1492 F77_CHAR_ARG_LEN (1)
1493 F77_CHAR_ARG_LEN (1)));
1498 volatile float rcond_plus_one = rcon + 1.0;
1505 sing_handler (rcon);
1522 float& rcon, solve_singularity_handler sing_handler,
1523 bool calc_cond)
const
1530 if (nr != nc || nr != b.
rows ())
1532 (
"matrix dimension mismatch solution of linear equations");
1534 if (nr == 0 || b.
cols () == 0)
1538 volatile int typ = mattype.
type ();
1551 anorm = atmp.
abs().
sum().
row(static_cast<octave_idx_type>(0)).
max();
1553 F77_XFCN (spotrf, SPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1555 F77_CHAR_ARG_LEN (1)));
1575 F77_XFCN (spocon, SPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1576 nr, tmp_data, nr, anorm,
1578 F77_CHAR_ARG_LEN (1)));
1583 volatile float rcond_plus_one = rcon + 1.0;
1590 sing_handler (rcon);
1603 F77_XFCN (spotrs, SPOTRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1604 nr, b_nc, tmp_data, nr,
1605 result, b.
rows (), info
1606 F77_CHAR_ARG_LEN (1)));
1627 anorm = atmp.
abs().
sum().
row(static_cast<octave_idx_type>(0)).
max();
1634 F77_XFCN (sgetrf, SGETRF, (nr, nr, tmp_data, nr, pipvt, info));
1643 sing_handler (rcon);
1656 F77_XFCN (sgecon, SGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1657 nc, tmp_data, nr, anorm,
1659 F77_CHAR_ARG_LEN (1)));
1664 volatile float rcond_plus_one = rcon + 1.0;
1671 sing_handler (rcon);
1685 F77_XFCN (sgetrs, SGETRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1686 nr, b_nc, tmp_data, nr,
1687 pipvt, result, b.
rows (), info
1688 F77_CHAR_ARG_LEN (1)));
1695 (*current_liboctave_error_handler) (
"incorrect matrix type");
1706 return solve (typ, b, info, rcon, 0);
1714 return solve (typ, b, info, rcon, 0);
1721 return solve (typ, b, info, rcon, 0);
1727 float& rcon, solve_singularity_handler sing_handler,
1731 int typ = mattype.
type ();
1734 typ = mattype.
type (*
this);
1738 retval =
utsolve (mattype, b, info, rcon, sing_handler,
true, transt);
1740 retval =
ltsolve (mattype, b, info, rcon, sing_handler,
true, transt);
1745 retval =
fsolve (mattype, b, info, rcon, sing_handler,
true);
1747 (*current_liboctave_error_handler) (
"unknown matrix type");
1753 retval =
lssolve (b, info, rank, rcon);
1764 return solve (typ, b, info, rcon, 0);
1772 return solve (typ, b, info, rcon, 0);
1780 return solve (typ, b, info, rcon, 0);
1807 const float *smd = sm.
data ();
1817 float& rcon, solve_singularity_handler sing_handler,
1821 tmp =
solve (typ, tmp, info, rcon, sing_handler, singular_fallback, transt);
1829 return solve (typ, b, info, rcon);
1837 return solve (typ, b, info, rcon);
1845 return solve (typ, b, info, rcon, 0);
1851 float& rcon, solve_singularity_handler sing_handler,
1855 tmp =
solve (typ, tmp, info, rcon, sing_handler,
true, transt);
1856 return tmp.
column (static_cast<octave_idx_type> (0));
1863 return tmp.
solve (typ, b);
1871 return tmp.
solve (typ, b, info);
1879 return tmp.
solve (typ, b, info, rcon);
1885 solve_singularity_handler sing_handler,
1889 return tmp.
solve (typ, b, info, rcon, sing_handler, transt);
1897 return solve (b, info, rcon, 0);
1904 return solve (b, info, rcon, 0);
1911 return solve (b, info, rcon, 0);
1916 float& rcon, solve_singularity_handler sing_handler,
1920 return solve (mattype, b, info, rcon, sing_handler,
true, transt);
1927 return tmp.
solve (b);
1934 return tmp.
solve (b, info);
1942 return tmp.
solve (b, info, rcon);
1948 solve_singularity_handler sing_handler,
1952 return tmp.
solve (b, info, rcon, sing_handler, transt);
1959 return solve (b, info, rcon);
1966 return solve (b, info, rcon);
1973 return solve (b, info, rcon, 0);
1978 float& rcon, solve_singularity_handler sing_handler,
1982 return solve (mattype, b, info, rcon, sing_handler, transt);
1989 return tmp.
solve (b);
1997 return tmp.
solve (b, info);
2005 return tmp.
solve (b, info, rcon);
2010 float& rcon, solve_singularity_handler sing_handler,
2014 return tmp.
solve (b, info, rcon, sing_handler, transt);
2023 return lssolve (b, info, rank, rcon);
2031 return lssolve (b, info, rank, rcon);
2039 return lssolve (b, info, rank, rcon);
2055 (
"matrix dimension mismatch solution of linear equations");
2057 if (m == 0 || n == 0 || b.
cols () == 0)
2089 F77_CONST_CHAR_ARG2 (
" ", 1),
2091 F77_CHAR_ARG_LEN (6)
2092 F77_CHAR_ARG_LEN (1));
2096 F77_CONST_CHAR_ARG2 (
" ", 1),
2097 m, n, nrhs, -1, mnthr
2098 F77_CHAR_ARG_LEN (6)
2099 F77_CHAR_ARG_LEN (1));
2103 float dminmn =
static_cast<float> (minmn);
2104 float dsmlsizp1 =
static_cast<float> (smlsiz+1);
2118 F77_XFCN (sgelsd, SGELSD, (m, n, nrhs, tmp_data, m, pretval, maxmn,
2120 lwork, piwork, info));
2126 if (n > m && n >= mnthr)
2129 = 9*m + 2*m*smlsiz + 8*m*nlvl + m*nrhs + (smlsiz+1)*(smlsiz+1);
2142 if (wlalsd > addend)
2147 if (work(0) < lworkaround)
2148 work(0) = lworkaround;
2153 = 12*n + 2*n*smlsiz + 8*n*nlvl + n*nrhs + (smlsiz+1)*(smlsiz+1);
2155 if (work(0) < lworkaround)
2156 work(0) = lworkaround;
2162 anorm =
xnorm (*
this, 1);
2168 retval =
Matrix (n, m, 0.0);
2172 F77_XFCN (sgelsd, SGELSD, (m, n, nrhs, tmp_data, m, pretval,
2173 maxmn, ps, rcon, rank,
2177 if (s.
elem (0) == 0.0)
2180 rcon = s.
elem (minmn - 1) / s.
elem (0);
2196 return tmp.
lssolve (b, info, rank, rcon);
2205 return tmp.
lssolve (b, info, rank, rcon);
2214 return tmp.
lssolve (b, info, rank, rcon);
2222 return tmp.
lssolve (b, info, rank, rcon);
2231 return lssolve (b, info, rank, rcon);
2239 return lssolve (b, info, rank, rcon);
2247 return lssolve (b, info, rank, rcon);
2261 if (m != b.
numel ())
2263 (
"matrix dimension mismatch solution of linear equations");
2265 if (m == 0 || n == 0)
2297 F77_CONST_CHAR_ARG2 (
" ", 1),
2299 F77_CHAR_ARG_LEN (6)
2300 F77_CHAR_ARG_LEN (1));
2304 float dminmn =
static_cast<float> (minmn);
2305 float dsmlsizp1 =
static_cast<float> (smlsiz+1);
2318 F77_XFCN (sgelsd, SGELSD, (m, n, nrhs, tmp_data, m, pretval, maxmn,
2320 lwork, piwork, info));
2325 F77_XFCN (sgelsd, SGELSD, (m, n, nrhs, tmp_data, m, pretval,
2326 maxmn, ps, rcon, rank,
2332 if (s.
elem (0) == 0.0)
2335 rcon = s.
elem (minmn - 1) / s.
elem (0);
2351 return tmp.
lssolve (b, info, rank, rcon);
2361 return tmp.
lssolve (b, info, rank, rcon);
2370 return tmp.
lssolve (b, info, rank, rcon);
2378 return tmp.
lssolve (b, info, rank, rcon);
2390 if (nr != a_nr || nc != a_nc)
2408 if (nr != a_nr || nc != a_nc)
2433 F77_XFCN (sgemm, SGEMM, (F77_CONST_CHAR_ARG2 (
"N", 1),
2434 F77_CONST_CHAR_ARG2 (
"N", 1),
2435 len, a_len, 1, 1.0, v.
data (), len,
2436 a.
data (), 1, 0.0,
c, len
2437 F77_CHAR_ARG_LEN (1)
2438 F77_CHAR_ARG_LEN (1)));
2496 if (nr == 1 || nc == 1)
2519 if (nr > 0 && nc > 0)
2530 for (idx_j = 0; idx_j < nc; idx_j++)
2532 tmp_min =
elem (
i, idx_j);
2544 else if (tmp < tmp_min)
2551 result.
elem (
i) = tmp_min;
2574 if (nr > 0 && nc > 0)
2585 for (idx_j = 0; idx_j < nc; idx_j++)
2587 tmp_max =
elem (
i, idx_j);
2599 else if (tmp > tmp_max)
2606 result.
elem (
i) = tmp_max;
2629 if (nr > 0 && nc > 0)
2640 for (idx_i = 0; idx_i < nr; idx_i++)
2642 tmp_min =
elem (idx_i, j);
2654 else if (tmp < tmp_min)
2661 result.
elem (j) = tmp_min;
2684 if (nr > 0 && nc > 0)
2695 for (idx_i = 0; idx_i < nr; idx_i++)
2697 tmp_max =
elem (idx_i, j);
2709 else if (tmp > tmp_max)
2716 result.
elem (j) = tmp_max;
2745 if (nr > 0 && nc > 0)
2751 tmp = octave_read_value<float> (
is);
2765 float cc,
s, temp_r;
2814 F77_XFCN (strsyl, STRSYL, (F77_CONST_CHAR_ARG2 (
"N", 1),
2815 F77_CONST_CHAR_ARG2 (
"N", 1),
2816 1, a_nr, b_nr, pa, a_nr, pb,
2817 b_nr, px, a_nr, scale, info
2818 F77_CHAR_ARG_LEN (1)
2819 F77_CHAR_ARG_LEN (1)));
2852 return trans ?
'T' :
'N';
2875 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
2877 else if (a.
data () == b.
data () && a_nr == b_nc && tra != trb)
2885 F77_XFCN (ssyrk, SSYRK, (F77_CONST_CHAR_ARG2 (
"U", 1),
2886 F77_CONST_CHAR_ARG2 (&ctra, 1),
2888 a.
data (), lda, 0.0,
c, a_nr
2889 F77_CHAR_ARG_LEN (1)
2890 F77_CHAR_ARG_LEN (1)));
2891 for (
int j = 0; j <
a_nr; j++)
2892 for (
int i = 0;
i < j;
i++)
2913 F77_XFCN (sgemv, SGEMV, (F77_CONST_CHAR_ARG2 (&ctra, 1),
2914 lda, tda, 1.0, a.
data (), lda,
2915 b.
data (), 1, 0.0,
c, 1
2916 F77_CHAR_ARG_LEN (1)));
2922 F77_XFCN (sgemv, SGEMV, (F77_CONST_CHAR_ARG2 (&crevtrb, 1),
2923 ldb, tdb, 1.0, b.
data (), ldb,
2924 a.
data (), 1, 0.0,
c, 1
2925 F77_CHAR_ARG_LEN (1)));
2931 F77_XFCN (sgemm, SGEMM, (F77_CONST_CHAR_ARG2 (&ctra, 1),
2932 F77_CONST_CHAR_ARG2 (&ctrb, 1),
2933 a_nr, b_nc, a_nc, 1.0, a.
data (),
2934 lda, b.
data (), ldb, 0.0,
c, a_nr
2935 F77_CHAR_ARG_LEN (1)
2936 F77_CHAR_ARG_LEN (1)));
2946 return xgemm (a, b);
2951 #define EMPTY_RETURN_CHECK(T) \
2952 if (nr == 0 || nc == 0) \
3003 (
"two-arg min requires same size arguments");
3067 (
"two-arg max requires same size arguments");
3092 (
"linspace: vectors must be of equal length");
3098 retval.clear (m, 0);
3102 retval.clear (m, n);
3107 float *delta = &
retval(0, n-1);
3109 delta[
i] = (x2(
i) - x1(
i)) / (n - 1);
FloatMatrix xgemm(const FloatMatrix &a, const FloatMatrix &b, blas_trans_type transa, blas_trans_type transb)
FloatMatrix extract_n(octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const
FloatMatrix tinverse(MatrixType &mattype, octave_idx_type &info, float &rcon, bool force, bool calc_cond) const
#define EMPTY_RETURN_CHECK(T)
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT F77_DBLE * V
FloatMatrix & operator-=(const FloatDiagMatrix &a)
FloatComplexMatrix solve(MatrixType &typ, const FloatMatrix &b) const
void resize(octave_idx_type nr, octave_idx_type nc, float rfv=0)
FloatMatrix cumprod(int dim=-1) const
FloatMatrix operator*(const FloatColumnVector &v, const FloatRowVector &a)
#define MM_BOOL_OPS(M1, M2)
FloatMatrix abs(void) 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)
T elem(octave_idx_type r, octave_idx_type c) const
std::ostream & operator<<(std::ostream &os, const FloatMatrix &a)
FloatMatrix & insert(const FloatMatrix &a, octave_idx_type r, octave_idx_type c)
FloatMatrix min(float d, const FloatMatrix &m)
FloatMatrix Givens(float x, float y)
octave_idx_type rows(void) const
FloatMatrix sumsq(int dim=-1) const
FloatMatrix & operator+=(const FloatDiagMatrix &a)
static const idx_vector colon
octave_idx_type numel(void) const
Number of elements in the array.
static octave_idx_type nn
identity matrix If supplied two scalar respectively For allows like xample val
FloatNDArray cumsum(int dim=-1) const
FloatMatrix fsolve(MatrixType &typ, const FloatMatrix &b, octave_idx_type &info, float &rcon, solve_singularity_handler sing_handler, bool calc_cond=false) const
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
FloatMatrix transpose(void) const
void mx_inline_real(size_t n, T *r, const std::complex< T > *x)
#define SM_BOOL_OPS(S, M)
T unitary_matrix(void) const
FloatDET determinant(void) const
void resize(octave_idx_type n, const float &rfv=0)
FloatMatrix & fill(float val)
FloatRowVector column_min(void) const
std::istream & operator>>(std::istream &is, FloatMatrix &a)
FloatNDArray diag(octave_idx_type k=0) const
octave_idx_type rows(void) const
FloatMatrix diag(octave_idx_type k=0) const
static char get_blas_trans_arg(bool trans)
FloatColumnVector row_min(void) const
T left_singular_matrix(void) const
FloatMatrix utsolve(MatrixType &typ, 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
FloatNDArray sumsq(int dim=-1) const
subroutine xilaenv(ispec, name, opts, n1, n2, n3, n4, retval)
float & elem(octave_idx_type n)
bool is_hermitian(void) const
FloatMatrix solve(MatrixType &typ, const FloatMatrix &b) const
FloatRowVector row(octave_idx_type i) const
bool is_symmetric(void) const
FloatComplexMatrix lssolve(const FloatMatrix &b) const
subroutine cfftb(n, c, wsave)
FloatComplexMatrix ifourier(void) const
#define F77_XFCN(f, F, args)
octave_idx_type rows(void) const
FloatMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
FloatNDArray abs(void) const
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
FloatNDArray sum(int dim=-1) const
T schur_matrix(void) const
FloatMatrix cumsum(int dim=-1) const
static int fftNd(const double *, Complex *, const int, const dim_vector &)
FloatMatrix stack(const FloatMatrix &a) const
void mx_inline_imag(size_t n, T *r, const std::complex< T > *x)
T right_singular_matrix(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
base_det< float > FloatDET
subroutine cffti(n, wsave)
int type(bool quiet=true)
FloatComplexMatrix fourier(void) const
FloatMatrix imag(const FloatComplexMatrix &a)
const Array< octave_idx_type > & col_perm_vec(void) const
nd deftypefn *octave_map m
FloatMatrix real(const FloatComplexMatrix &a)
FloatComplexMatrix ifourier2d(void) const
FloatColumnVector extract(octave_idx_type r1, octave_idx_type r2) 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)
const float * data(void) const
double norm(const ColumnVector &v)
DM_T singular_values(void) const
void resize(const dim_vector &dv, const T &rfv)
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
subroutine cfftf(n, c, wsave)
F77_RET_T F77_FUNC(xstopx, XSTOPX) const
void mark_as_unsymmetric(void)
bool is_square(void) const
OCTAVE_API double xnorm(const ColumnVector &x, double p)
subroutine xsdot(n, dx, incx, dy, incy, retval)
FloatNDArray prod(int dim=-1) const
FloatColumnVector extract_diag(octave_idx_type k=0) const
FloatColumnVector column(octave_idx_type i) const
FloatColumnVector row_max(void) const
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
void mark_as_rectangular(void)
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
With real return the complex result
friend class FloatComplexMatrix
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
float & xelem(octave_idx_type n)
FloatMatrix sum(int dim=-1) const
octave_idx_type cols(void) const
FloatRowVector column_max(void) const
FloatMatrix inverse(void) const
FloatNDArray cumprod(int dim=-1) const
This is a simple wrapper template that will subclass an Array type or any later type derived from ...
FloatMatrix finverse(MatrixType &mattype, octave_idx_type &info, float &rcon, bool force, bool calc_cond) const
void octave_write_float(std::ostream &os, float d)
void resize(octave_idx_type n, const float &rfv=0)
=val(i)}if ode{val(i)}occurs in table i
static FloatComplexMatrix unstack_complex_matrix(const FloatMatrix &sm)
FloatMatrix lssolve(const FloatMatrix &b) const
the element is set to zero In other the statement xample y
void scale(Matrix &m, double x, double y, double z)
FloatMatrix prod(int dim=-1) const
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol NaN(Not a Number).NaN is the result of operations which do not produce a well defined 0 result.Common operations which produce a NaN are arithmetic with infinity ex($\infty-\infty $)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
#define MS_BOOL_OPS(M, S)
#define MM_CMP_OPS(M1, M2)
char get_blas_char(blas_trans_type transt)
bool operator!=(const FloatMatrix &a) const
FloatNDArray & insert(const FloatNDArray &a, octave_idx_type r, octave_idx_type c)
FloatMatrix ltsolve(MatrixType &typ, 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
std::complex< float > FloatComplex
const T * fortran_vec(void) const
FloatMatrix Sylvester(const FloatMatrix &a, const FloatMatrix &b, const FloatMatrix &c)
bool mx_inline_equal(size_t n, const T1 *x, const T2 *y)
octave_idx_type cols(void) const
write the output to stdout if nargout is
FloatMatrix append(const FloatMatrix &a) const
Vector representing the dimensions (size) of an Array.
void warn_singular_matrix(double rcond)
static FloatMatrix stack_complex_matrix(const FloatComplexMatrix &cm)
FloatComplexMatrix fourier2d(void) const
octave_idx_type columns(void) const
octave_idx_type length(void) const
Array< float > index(const idx_vector &i) const
Indexing without resizing.
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x
FloatMatrix linspace(const FloatColumnVector &x1, const FloatColumnVector &x2, octave_idx_type n)
FloatMatrix max(float d, const FloatMatrix &m)
FloatMatrix pseudo_inverse(float tol=0.0) const
bool operator==(const FloatMatrix &a) const