26 #if defined (HAVE_CONFIG_H)
36 #include <sys/types.h>
147 elem (
i, j) =
static_cast<unsigned char> (a.
elem (
i, j));
173 return !(*
this ==
a);
203 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
204 (*current_liboctave_error_handler) (
"range error for insert");
206 if (a_nr >0 && a_nc > 0)
223 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
224 (*current_liboctave_error_handler) (
"range error for insert");
243 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
244 (*current_liboctave_error_handler) (
"range error for insert");
264 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
265 (*current_liboctave_error_handler) (
"range error for insert");
267 fill (0.0, r, c, r + a_nr - 1, c + a_nc - 1);
295 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
296 (*current_liboctave_error_handler) (
"range error for insert");
310 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
311 (*current_liboctave_error_handler) (
"range error for insert");
331 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
332 (*current_liboctave_error_handler) (
"range error for insert");
334 fill (0.0, r, c, r + a_nr - 1, c + a_nc - 1);
355 if (nr > 0 && nc > 0)
373 if (nr > 0 && nc > 0)
392 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
393 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
394 (*current_liboctave_error_handler) (
"range error for fill");
399 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");
425 if (r2 >= r1 && c2 >=c1)
447 retval.insert (*
this, 0, 0);
448 retval.insert (a, 0, nc_insert);
458 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
462 retval.insert (*
this, 0, 0);
463 retval.insert (a, 0, nc_insert);
472 if (nr != a.
numel ())
477 retval.
insert (*
this, 0, 0);
478 retval.
insert (a, 0, nc_insert);
492 retval.insert (*
this, 0, 0);
493 retval.insert (a, 0, nc_insert);
507 retval.insert (*
this, 0, 0);
508 retval.insert (a, 0, nc_insert);
518 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
522 retval.insert (*
this, 0, 0);
523 retval.insert (a, 0, nc_insert);
532 if (nr != a.
numel ())
537 retval.
insert (*
this, 0, 0);
538 retval.
insert (a, 0, nc_insert);
552 retval.insert (*
this, 0, 0);
553 retval.insert (a, 0, nc_insert);
567 retval.insert (*
this, 0, 0);
568 retval.insert (a, nr_insert, 0);
577 if (nc != a.
numel ())
582 retval.
insert (*
this, 0, 0);
583 retval.
insert (a, nr_insert, 0);
593 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
597 retval.insert (*
this, 0, 0);
598 retval.insert (a, nr_insert, 0);
612 retval.insert (*
this, 0, 0);
613 retval.insert (a, nr_insert, 0);
627 retval.insert (*
this, 0, 0);
628 retval.insert (a, nr_insert, 0);
637 if (nc != a.
numel ())
642 retval.
insert (*
this, 0, 0);
643 retval.
insert (a, nr_insert, 0);
653 (*current_liboctave_error_handler) (
"column dimension mismatch for stack");
657 retval.insert (*
this, 0, 0);
658 retval.insert (a, nr_insert, 0);
672 retval.insert (*
this, 0, 0);
673 retval.insert (a, nr_insert, 0);
680 return do_mx_unary_map<Complex, Complex, std::conj<double> > (
a);
722 return inverse (mattype, info, rcon, 0, 0);
730 return inverse (mattype, info, rcon, 0, 0);
735 bool calc_cond)
const
738 return inverse (mattype, info, rcon, force, calc_cond);
746 return inverse (mattype, info, rcon, 0, 0);
753 return inverse (mattype, info, rcon, 0, 0);
758 double& rcon,
bool force,
bool calc_cond)
const
765 if (nr != nc || nr == 0 || nc == 0)
766 (*current_liboctave_error_handler) (
"inverse requires square matrix");
768 int typ = mattype.
type ();
774 F77_XFCN (ztrtri, ZTRTRI,(F77_CONST_CHAR_ARG2 (&uplo, 1),
775 F77_CONST_CHAR_ARG2 (&udiag, 1),
778 F77_CHAR_ARG_LEN (1)));
792 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&job, 1),
793 F77_CONST_CHAR_ARG2 (&uplo, 1),
794 F77_CONST_CHAR_ARG2 (&udiag, 1),
799 F77_CHAR_ARG_LEN (1)));
801 if (ztrcon_info != 0)
805 if (info == -1 && ! force)
813 double& rcon,
bool force,
bool calc_cond)
const
821 (*current_liboctave_error_handler) (
"inverse requires square matrix");
838 lwork = (lwork < 2 *nc ? 2*nc : lwork);
846 retval.
abs ().
sum ().
row (static_cast<octave_idx_type>(0)).
max ();
867 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
870 F77_CHAR_ARG_LEN (1)));
872 if (zgecon_info != 0)
885 if (zgetri_info != 0)
897 double& rcon,
bool force,
bool calc_cond)
const
899 int typ = mattype.
type (
false);
903 typ = mattype.
type (*
this);
906 ret =
tinverse (mattype, info, rcon, force, calc_cond);
915 rcon = chol.
rcond ();
925 ret =
finverse (mattype, info, rcon, force, calc_cond);
927 if ((mattype.
is_hermitian () || calc_cond) && rcon == 0.)
956 tol = nr * sigma.
elem (0) * std::numeric_limits<double>::epsilon ();
958 tol = nc * sigma.
elem (0) * std::numeric_limits<double>::epsilon ();
961 while (r >= 0 && sigma.
elem (r) < tol)
977 #if defined (HAVE_FFTW)
987 size_t npts, nsamples;
989 if (nr == 1 || nc == 1)
991 npts = nr > nc ? nr : nc;
1011 size_t nr =
rows ();
1012 size_t nc =
cols ();
1016 size_t npts, nsamples;
1018 if (nr == 1 || nc == 1)
1020 npts = nr > nc ? nr : nc;
1079 if (nr == 1 || nc == 1)
1081 npts = nr > nc ? nr : nc;
1093 Complex *pwsave = wsave.fortran_vec ();
1121 if (nr == 1 || nc == 1)
1123 npts = nr > nc ? nr : nc;
1135 Complex *pwsave = wsave.fortran_vec ();
1151 tmp_data[j] = tmp_data[j] / static_cast<double> (npts);
1166 if (nr == 1 || nc == 1)
1168 npts = nr > nc ? nr : nc;
1180 Complex *pwsave = wsave.fortran_vec ();
1200 pwsave = wsave.fortran_vec ();
1212 prow[
i] = tmp_data[
i*nr + j];
1218 tmp_data[
i*nr + j] = prow[
i];
1234 if (nr == 1 || nc == 1)
1236 npts = nr > nc ? nr : nc;
1248 Complex *pwsave = wsave.fortran_vec ();
1264 tmp_data[j] = tmp_data[j] / static_cast<double> (npts);
1271 pwsave = wsave.fortran_vec ();
1283 prow[
i] = tmp_data[
i*nr + j];
1289 tmp_data[
i*nr + j] = prow[
i] / static_cast<double> (npts);
1314 bool calc_cond)
const
1317 return determinant (mattype, info, rcon, calc_cond);
1323 bool calc_cond)
const
1334 (*current_liboctave_error_handler) (
"matrix must be square");
1336 volatile int typ = mattype.
type ();
1343 typ = mattype.
type (*
this);
1358 if (calc_cond) anorm =
xnorm (*
this, 1);
1361 F77_XFCN (zpotrf, ZPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1363 F77_CHAR_ARG_LEN (1)));
1378 F77_XFCN (zpocon, ZPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1381 F77_CHAR_ARG_LEN (1)));
1387 retval *= atmp (
i,
i);
1389 retval = retval.
square ();
1393 (*current_liboctave_error_handler) (
"det: invalid dense matrix type");
1406 double anorm =
xnorm (*
this, 1);
1433 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1436 F77_CHAR_ARG_LEN (1)));
1449 retval *= (ipvt(
i) != (
i+1)) ? -c :
c;
1462 return rcond (mattype);
1473 (*current_liboctave_error_handler) (
"matrix must be square");
1475 if (nr == 0 || nc == 0)
1479 volatile int typ = mattype.
type ();
1482 typ = mattype.
type (*
this);
1498 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&norm, 1),
1499 F77_CONST_CHAR_ARG2 (&uplo, 1),
1500 F77_CONST_CHAR_ARG2 (&dia, 1),
1503 F77_CHAR_ARG_LEN (1)
1504 F77_CHAR_ARG_LEN (1)
1505 F77_CHAR_ARG_LEN (1)));
1511 (*current_liboctave_error_handler)
1512 (
"permuted triangular matrix not implemented");
1526 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&norm, 1),
1527 F77_CONST_CHAR_ARG2 (&uplo, 1),
1528 F77_CONST_CHAR_ARG2 (&dia, 1),
1531 F77_CHAR_ARG_LEN (1)
1532 F77_CHAR_ARG_LEN (1)
1533 F77_CHAR_ARG_LEN (1)));
1539 (*current_liboctave_error_handler)
1540 (
"permuted triangular matrix not implemented");
1543 double anorm = -1.0;
1553 anorm = atmp.
abs().
sum().
1554 row(static_cast<octave_idx_type>(0)).
max();
1556 F77_XFCN (zpotrf, ZPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1558 F77_CHAR_ARG_LEN (1)));
1574 F77_XFCN (zpocon, ZPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1577 F77_CHAR_ARG_LEN (1)));
1595 anorm = atmp.
abs ().
sum ().
1596 row(static_cast<octave_idx_type>(0)).
max ();
1618 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1621 F77_CHAR_ARG_LEN (1)));
1646 if (nr != b.
rows ())
1648 (
"matrix dimension mismatch solution of linear equations");
1650 if (nr == 0 || nc == 0 || b.
cols () == 0)
1654 volatile int typ = mattype.
type ();
1657 (*current_liboctave_error_handler) (
"incorrect matrix type");
1664 (*current_liboctave_error_handler)
1665 (
"permuted triangular matrix not implemented");
1676 F77_XFCN (ztrtrs, ZTRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1677 F77_CONST_CHAR_ARG2 (&trans, 1),
1678 F77_CONST_CHAR_ARG2 (&dia, 1),
1681 F77_CHAR_ARG_LEN (1)
1682 F77_CHAR_ARG_LEN (1)
1683 F77_CHAR_ARG_LEN (1)));
1696 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&norm, 1),
1697 F77_CONST_CHAR_ARG2 (&uplo, 1),
1698 F77_CONST_CHAR_ARG2 (&dia, 1),
1701 F77_CHAR_ARG_LEN (1)
1702 F77_CHAR_ARG_LEN (1)
1703 F77_CHAR_ARG_LEN (1)));
1708 volatile double rcond_plus_one = rcon + 1.0;
1715 sing_handler (rcon);
1736 if (nr != b.
rows ())
1738 (
"matrix dimension mismatch solution of linear equations");
1740 if (nr == 0 || nc == 0 || b.
cols () == 0)
1744 volatile int typ = mattype.
type ();
1747 (*current_liboctave_error_handler) (
"incorrect matrix type");
1754 (*current_liboctave_error_handler)
1755 (
"permuted triangular matrix not implemented");
1766 F77_XFCN (ztrtrs, ZTRTRS, (F77_CONST_CHAR_ARG2 (&uplo, 1),
1767 F77_CONST_CHAR_ARG2 (&trans, 1),
1768 F77_CONST_CHAR_ARG2 (&dia, 1),
1771 F77_CHAR_ARG_LEN (1)
1772 F77_CHAR_ARG_LEN (1)
1773 F77_CHAR_ARG_LEN (1)));
1786 F77_XFCN (ztrcon, ZTRCON, (F77_CONST_CHAR_ARG2 (&norm, 1),
1787 F77_CONST_CHAR_ARG2 (&uplo, 1),
1788 F77_CONST_CHAR_ARG2 (&dia, 1),
1791 F77_CHAR_ARG_LEN (1)
1792 F77_CHAR_ARG_LEN (1)
1793 F77_CHAR_ARG_LEN (1)));
1798 volatile double rcond_plus_one = rcon + 1.0;
1805 sing_handler (rcon);
1819 bool calc_cond)
const
1826 if (nr != nc || nr != b.
rows ())
1828 (
"matrix dimension mismatch solution of linear equations");
1830 if (nr == 0 || b.
cols () == 0)
1834 volatile int typ = mattype.
type ();
1847 anorm = atmp.
abs().
sum().
row(static_cast<octave_idx_type>(0)).
max();
1849 F77_XFCN (zpotrf, ZPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
1851 F77_CHAR_ARG_LEN (1)));
1871 F77_XFCN (zpocon, ZPOCON, (F77_CONST_CHAR_ARG2 (&job, 1),
1874 F77_CHAR_ARG_LEN (1)));
1879 volatile double rcond_plus_one = rcon + 1.0;
1886 sing_handler (rcon);
1899 F77_XFCN (zpotrs, ZPOTRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1902 F77_CHAR_ARG_LEN (1)));
1929 anorm = atmp.
abs ().
sum ().
row (static_cast<octave_idx_type>(0))
1947 sing_handler (rcon);
1960 F77_XFCN (zgecon, ZGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
1963 F77_CHAR_ARG_LEN (1)));
1968 volatile double rcond_plus_one = rcon + 1.0;
1975 sing_handler (rcon);
1989 F77_XFCN (zgetrs, ZGETRS, (F77_CONST_CHAR_ARG2 (&job, 1),
1992 F77_CHAR_ARG_LEN (1)));
2014 return solve (typ, b, info, rcon, 0);
2022 return solve (typ, b, info, rcon, 0);
2029 return solve (typ, b, info, rcon, 0);
2038 return solve (typ, tmp, info, rcon, sing_handler, singular_fallback, transt);
2046 return solve (typ, b, info, rcon, 0);
2054 return solve (typ, b, info, rcon, 0);
2061 return solve (typ, b, info, rcon, 0);
2071 int typ = mattype.
type ();
2074 typ = mattype.
type (*
this);
2078 retval =
utsolve (mattype, b, info, rcon, sing_handler,
true, transt);
2080 retval =
ltsolve (mattype, b, info, rcon, sing_handler,
true, transt);
2085 retval =
hermitian ().
solve (mattype, b, info, rcon, sing_handler,
2088 retval =
fsolve (mattype, b, info, rcon, sing_handler,
true);
2090 (*current_liboctave_error_handler) (
"unknown matrix type");
2096 retval =
lssolve (b, info, rank, rcon);
2139 return solve (typ, b, info, rcon, 0);
2147 return solve (typ, b, info, rcon, 0);
2154 return solve (typ, b, info, rcon, 0);
2165 tmp =
solve (typ, tmp, info, rcon, sing_handler,
true, transt);
2166 return tmp.
column (static_cast<octave_idx_type> (0));
2174 return solve (b, info, rcon, 0);
2181 return solve (b, info, rcon, 0);
2188 return solve (b, info, rcon, 0);
2197 return solve (tmp, info, rcon, sing_handler, transt);
2205 return solve (b, info, rcon, 0);
2212 return solve (b, info, rcon, 0);
2219 return solve (b, info, rcon, 0);
2229 return solve (mattype, b, info, rcon, sing_handler,
true, transt);
2268 return solve (b, info, rcon, 0);
2275 return solve (b, info, rcon, 0);
2282 return solve (b, info, rcon, 0);
2292 return solve (mattype, b, info, rcon, sing_handler, transt);
2333 return lssolve (b, info, rank, rcon);
2341 return lssolve (b, info, rank, rcon);
2349 return lssolve (b, info, rank, rcon);
2365 (
"matrix dimension mismatch solution of linear equations");
2367 if (m == 0 || n == 0 || b.
cols () == 0)
2400 F77_CONST_CHAR_ARG2 (
" ", 1),
2402 F77_CHAR_ARG_LEN (6)
2403 F77_CHAR_ARG_LEN (1));
2407 F77_CONST_CHAR_ARG2 (
" ", 1),
2408 m, n, nrhs, -1, mnthr
2409 F77_CHAR_ARG_LEN (6)
2410 F77_CHAR_ARG_LEN (1));
2415 double dminmn =
static_cast<double> (minmn);
2416 double dsmlsizp1 =
static_cast<double> (smlsiz+1);
2427 n*(1+nrhs) + 2*nrhs);
2442 lwork, prwork, piwork, info));
2448 if (n > m && n >= mnthr)
2464 work(0) = lworkaround;
2471 work(0) = lworkaround;
2477 anorm =
xnorm (*
this, 1);
2483 retval =
Matrix (n, m, 0.0);
2489 maxmn, ps, rcon, rank,
2491 lwork, prwork, piwork, info));
2493 if (s.
elem (0) == 0.0)
2496 rcon = s.
elem (minmn - 1) / s.
elem (0);
2543 return lssolve (b, info, rank, rcon);
2552 return lssolve (b, info, rank, rcon);
2560 return lssolve (b, info, rank, rcon);
2575 if (m != b.
numel ())
2577 (
"matrix dimension mismatch solution of linear equations");
2579 if (m == 0 || n == 0 || b.
cols () == 0)
2611 F77_CONST_CHAR_ARG2 (
" ", 1),
2613 F77_CHAR_ARG_LEN (6)
2614 F77_CHAR_ARG_LEN (1));
2619 double dminmn =
static_cast<double> (minmn);
2620 double dsmlsizp1 =
static_cast<double> (smlsiz+1);
2628 + 3*smlsiz*nrhs + (smlsiz+1)*(smlsiz+1);
2643 lwork, prwork, piwork, info));
2652 maxmn, ps, rcon, rank,
2654 prwork, piwork, info));
2658 if (s.
elem (0) == 0.0)
2661 rcon = s.
elem (minmn - 1) / s.
elem (0);
2700 F77_XFCN (zgemm, ZGEMM, (F77_CONST_CHAR_ARG2 (
"N", 1),
2701 F77_CONST_CHAR_ARG2 (
"N", 1),
2704 F77_CHAR_ARG_LEN (1)
2705 F77_CHAR_ARG_LEN (1)));
2722 if (nr != a_nr || nc != a_nc)
2740 if (nr != a_nr || nc != a_nc)
2758 if (nr != a_nr || nc != a_nc)
2776 if (nr != a_nr || nc != a_nc)
2796 if (nr != a_nr || nc != a_nc)
2799 if (nr == 0 || nc == 0)
2817 if (nr != a_nr || nc != a_nc)
2820 if (nr == 0 || nc == 0)
2891 if (nr != 1 && nc != 1)
2892 (*current_liboctave_error_handler) (
"diag: expecting vector argument");
2950 if (nr > 0 && nc > 0)
2965 for (idx_j = 0; idx_j < nc; idx_j++)
2967 tmp_min =
elem (
i, idx_j);
2971 abs_min = real_only ? tmp_min.real ()
2984 double abs_tmp = real_only ? tmp.real () :
std::abs (tmp);
2986 if (abs_tmp < abs_min)
2997 idx_arg.
elem (
i) = 0;
3001 result.
elem (
i) = tmp_min;
3002 idx_arg.
elem (
i) = idx_j;
3025 if (nr > 0 && nc > 0)
3040 for (idx_j = 0; idx_j < nc; idx_j++)
3042 tmp_max =
elem (
i, idx_j);
3046 abs_max = real_only ? tmp_max.real ()
3059 double abs_tmp = real_only ? tmp.real () :
std::abs (tmp);
3061 if (abs_tmp > abs_max)
3072 idx_arg.
elem (
i) = 0;
3076 result.
elem (
i) = tmp_max;
3077 idx_arg.
elem (
i) = idx_j;
3100 if (nr > 0 && nc > 0)
3115 for (idx_i = 0; idx_i < nr; idx_i++)
3117 tmp_min =
elem (idx_i, j);
3121 abs_min = real_only ? tmp_min.real ()
3134 double abs_tmp = real_only ? tmp.real () :
std::abs (tmp);
3136 if (abs_tmp < abs_min)
3147 idx_arg.
elem (j) = 0;
3151 result.
elem (j) = tmp_min;
3152 idx_arg.
elem (j) = idx_i;
3175 if (nr > 0 && nc > 0)
3190 for (idx_i = 0; idx_i < nr; idx_i++)
3192 tmp_max =
elem (idx_i, j);
3196 abs_max = real_only ? tmp_max.real ()
3209 double abs_tmp = real_only ? tmp.real () :
std::abs (tmp);
3211 if (abs_tmp > abs_max)
3222 idx_arg.
elem (j) = 0;
3226 result.
elem (j) = tmp_max;
3227 idx_arg.
elem (j) = idx_i;
3258 if (nr > 0 && nc > 0)
3264 tmp = octave_read_value<Complex> (
is);
3332 F77_XFCN (ztrsyl, ZTRSYL, (F77_CONST_CHAR_ARG2 (
"N", 1),
3333 F77_CONST_CHAR_ARG2 (
"N", 1),
3336 F77_CHAR_ARG_LEN (1)
3337 F77_CHAR_ARG_LEN (1)));
3390 return trans ? (conj ?
'C' :
'T') :
'N';
3415 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
3417 else if (a.
data () == b.
data () && a_nr == b_nc && tra != trb)
3432 F77_XFCN (zherk, ZHERK, (F77_CONST_CHAR_ARG2 (
"U", 1),
3433 F77_CONST_CHAR_ARG2 (&ctra, 1),
3436 F77_CHAR_ARG_LEN (1)
3437 F77_CHAR_ARG_LEN (1)));
3444 F77_XFCN (zsyrk, ZSYRK, (F77_CONST_CHAR_ARG2 (
"U", 1),
3445 F77_CONST_CHAR_ARG2 (&ctra, 1),
3448 F77_CHAR_ARG_LEN (1)
3449 F77_CHAR_ARG_LEN (1)));
3467 if (b_nc == 1 && a_nr == 1)
3485 else if (b_nc == 1 && ! cjb)
3488 F77_XFCN (zgemv, ZGEMV, (F77_CONST_CHAR_ARG2 (&ctra, 1),
3491 F77_CHAR_ARG_LEN (1)));
3493 else if (a_nr == 1 && ! cja && ! cjb)
3496 F77_XFCN (zgemv, ZGEMV, (F77_CONST_CHAR_ARG2 (&crevtrb, 1),
3499 F77_CHAR_ARG_LEN (1)));
3505 F77_XFCN (zgemm, ZGEMM, (F77_CONST_CHAR_ARG2 (&ctra, 1),
3506 F77_CONST_CHAR_ARG2 (&ctrb, 1),
3510 F77_CHAR_ARG_LEN (1)
3511 F77_CHAR_ARG_LEN (1)));
3521 return xgemm (a, b);
3526 #define EMPTY_RETURN_CHECK(T) \
3527 if (nr == 0 || nc == 0) \
3564 (
"two-arg min requires same size arguments");
3572 bool columns_are_real_only =
true;
3578 columns_are_real_only =
false;
3583 if (columns_are_real_only)
3636 (
"two-arg max requires same size arguments");
3644 bool columns_are_real_only =
true;
3650 columns_are_real_only =
false;
3656 if (columns_are_real_only)
3686 (
"linspace: vectors must be of equal length");
3692 retval.clear (m, 0);
3696 retval.clear (m, n);
3703 delta[
i] = (x2(
i) - x1(
i)) / (n - 1.0);
3707 retval(
i, j) = x1(
i) +
static_cast<double> (j)*delta[
i];
ComplexMatrix stack(const Matrix &a) const
void mx_inline_add2(size_t n, R *r, const X *x)
ComplexMatrix ifourier(void) const
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT F77_DBLE * V
void resize(octave_idx_type n, const Complex &rfv=Complex(0))
ComplexMatrix utsolve(MatrixType &typ, 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
void mx_inline_sub2(size_t n, R *r, const X *x)
#define MM_BOOL_OPS(M1, M2)
ComplexDET determinant(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
ComplexMatrix inverse(void) const
ComplexNDArray diag(octave_idx_type k=0) const
static const idx_vector colon
octave_idx_type numel(void) const
Number of elements in the array.
subroutine zffti(n, wsave)
static octave_idx_type nn
identity matrix If supplied two scalar respectively For allows like xample val
ComplexMatrix finverse(MatrixType &mattype, octave_idx_type &info, double &rcon, bool force, bool calc_cond) const
ComplexMatrix Sylvester(const ComplexMatrix &a, const ComplexMatrix &b, const ComplexMatrix &c)
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
#define F77_DBLE_CMPLX_ARG(x)
#define SM_BOOL_OPS(S, M)
T unitary_matrix(void) const
void octave_write_complex(std::ostream &os, const Complex &c)
octave_idx_type rows(void) const
RowVector row(octave_idx_type i) const
T left_singular_matrix(void) const
bool column_is_real_only(octave_idx_type) const
ComplexMatrix conj(const ComplexMatrix &a)
subroutine xilaenv(ispec, name, opts, n1, n2, n3, n4, retval)
ComplexRowVector row(octave_idx_type i) const
Complex & elem(octave_idx_type n)
bool is_hermitian(void) const
ComplexMatrix operator*(const ColumnVector &v, const ComplexRowVector &a)
void(* solve_singularity_handler)(double rcon)
ComplexMatrix tinverse(MatrixType &mattype, octave_idx_type &info, double &rcon, bool force, bool calc_cond) const
#define F77_XFCN(f, F, args)
ColumnVector extract_diag(octave_idx_type k=0) const
octave_idx_type rows(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
subroutine zfftb(n, c, wsave)
T schur_matrix(void) const
ComplexMatrix prod(int dim=-1) const
static int fftNd(const double *, Complex *, const int, const dim_vector &)
ComplexRowVector column_min(void) const
T right_singular_matrix(void) const
ComplexMatrix fsolve(MatrixType &typ, const ComplexMatrix &b, octave_idx_type &info, double &rcon, solve_singularity_handler sing_handler, bool calc_cond=false) 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
ComplexNDArray sumsq(int dim=-1) const
ComplexNDArray cumprod(int dim=-1) const
ComplexMatrix cumprod(int dim=-1) const
subroutine xzdotu(n, zx, incx, zy, incy, retval)
int type(bool quiet=true)
ComplexNDArray prod(int dim=-1) const
ComplexMatrix hermitian(void) const
ComplexNDArray sum(int dim=-1) const
ComplexNDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
ComplexMatrix cumsum(int dim=-1) const
bool is_hermitian(void) const
static const Complex Complex_NaN_result(octave::numeric_limits< double >::NaN(), octave::numeric_limits< double >::NaN())
nd deftypefn *octave_map m
boolMatrix all(int dim=-1) const
ComplexMatrix & operator-=(const DiagMatrix &a)
std::istream & operator>>(std::istream &is, ComplexMatrix &a)
bool row_is_real_only(octave_idx_type) 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 Complex * data(void) const
double norm(const ColumnVector &v)
DM_T singular_values(void) const
ComplexMatrix min(const Complex &c, const ComplexMatrix &m)
void resize(const dim_vector &dv, const T &rfv)
ComplexColumnVector row_min(void) const
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
boolMatrix any(int dim=-1) const
boolNDArray all(int dim=-1) const
F77_RET_T F77_FUNC(xstopx, XSTOPX) const
void mark_as_unsymmetric(void)
ComplexMatrix solve(MatrixType &typ, const Matrix &b) const
bool is_square(void) const
ComplexMatrix ltsolve(MatrixType &typ, 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
OCTAVE_API double xnorm(const ColumnVector &x, double p)
ComplexMatrix fourier(void) const
ComplexMatrix sumsq(int dim=-1) const
ComplexColumnVector row_max(void) const
ComplexMatrix transpose(void) const
ComplexMatrix max(const Complex &c, const ComplexMatrix &m)
static char get_blas_trans_arg(bool trans, bool conj)
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)
ComplexMatrix & insert(const Matrix &a, octave_idx_type r, octave_idx_type c)
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
ComplexMatrix & operator+=(const DiagMatrix &a)
friend OCTAVE_API ComplexMatrix conj(const ComplexMatrix &a)
With real return the complex result
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
void resize(octave_idx_type n, const Complex &rfv=Complex(0))
Complex & xelem(octave_idx_type n)
ComplexMatrix linspace(const ComplexColumnVector &x1, const ComplexColumnVector &x2, octave_idx_type n)
ComplexNDArray cumsum(int dim=-1) const
ComplexMatrix xgemm(const ComplexMatrix &a, const ComplexMatrix &b, blas_trans_type transa, blas_trans_type transb)
bool operator!=(const ComplexMatrix &a) const
subroutine xzdotc(n, zx, incx, zy, incy, retval)
ComplexMatrix pseudo_inverse(double tol=0.0) const
octave_idx_type cols(void) const
#define F77_CONST_DBLE_CMPLX_ARG(x)
This is a simple wrapper template that will subclass an Array type or any later type derived from ...
ComplexRowVector column_max(void) const
void resize(octave_idx_type nr, octave_idx_type nc, const Complex &rfv=Complex(0))
=val(i)}if ode{val(i)}occurs in table i
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
ComplexMatrix Givens(const Complex &x, const Complex &y)
the element is set to zero In other the statement xample y
void scale(Matrix &m, double x, double y, double z)
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol NaN(Not a Number).NaN is the result of operations which do not produce a well defined 0 result.Common operations which produce a NaN are arithmetic with infinity ex($\infty-\infty $)
ComplexMatrix sum(int dim=-1) const
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
ComplexMatrix & fill(double val)
#define MS_BOOL_OPS(M, S)
#define MM_CMP_OPS(M1, M2)
char get_blas_char(blas_trans_type transt)
std::ostream & operator<<(std::ostream &os, const ComplexMatrix &a)
ComplexMatrix ifourier2d(void) const
ColumnVector imag(const ComplexColumnVector &a)
base_det< Complex > ComplexDET
ComplexMatrix diag(octave_idx_type k=0) const
Matrix sum(int dim=-1) const
std::complex< double > Complex
const T * fortran_vec(void) const
ColumnVector real(const ComplexColumnVector &a)
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
Vector representing the dimensions (size) of an Array.
ComplexMatrix lssolve(const Matrix &b) const
void warn_singular_matrix(double rcond)
ComplexColumnVector column(octave_idx_type i) const
ComplexMatrix extract_n(octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const
ComplexMatrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
bool operator==(const ComplexMatrix &a) const
octave_idx_type columns(void) const
ComplexMatrix append(const Matrix &a) const
octave_idx_type length(void) const
boolNDArray any(int dim=-1) const
Array< Complex > 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
subroutine zfftf(n, c, wsave)
ComplexMatrix fourier2d(void) const
#define EMPTY_RETURN_CHECK(T)
ColumnVector extract(octave_idx_type r1, octave_idx_type r2) const