68 const octave_idx_type&,
const octave_idx_type&,
69 const octave_idx_type&,
const octave_idx_type&,
76 const octave_idx_type&,
double*,
77 const octave_idx_type&, octave_idx_type&,
78 octave_idx_type&,
double*, octave_idx_type&
84 const octave_idx_type&,
const octave_idx_type&,
85 const octave_idx_type&,
double*,
86 const octave_idx_type&,
double*,
87 const octave_idx_type&, octave_idx_type&
95 const octave_idx_type&,
const octave_idx_type&,
96 const octave_idx_type&,
const double&,
97 const double*,
const octave_idx_type&,
98 const double*,
const octave_idx_type&,
99 const double&,
double*,
const octave_idx_type&
105 const octave_idx_type&,
const octave_idx_type&,
106 const double&,
const double*,
107 const octave_idx_type&,
const double*,
108 const octave_idx_type&,
const double&,
double*,
109 const octave_idx_type&
113 F77_FUNC (
xddot, XDDOT) (
const octave_idx_type&,
const double*,
114 const octave_idx_type&,
const double*,
115 const octave_idx_type&,
double&);
120 const octave_idx_type&,
const octave_idx_type&,
121 const double&,
const double*,
const octave_idx_type&,
122 const double&,
double*,
const octave_idx_type&
127 F77_FUNC (dgetrf, DGETRF) (
const octave_idx_type&,
const octave_idx_type&,
128 double*,
const octave_idx_type&,
129 octave_idx_type*, octave_idx_type&);
133 const octave_idx_type&,
const octave_idx_type&,
134 const double*,
const octave_idx_type&,
135 const octave_idx_type*,
double*,
136 const octave_idx_type&, octave_idx_type&
140 F77_FUNC (dgetri, DGETRI) (
const octave_idx_type&,
double*,
141 const octave_idx_type&,
const octave_idx_type*,
142 double*,
const octave_idx_type&,
147 const octave_idx_type&,
double*,
148 const octave_idx_type&,
const double&,
double&,
149 double*, octave_idx_type*, octave_idx_type&
153 F77_FUNC (dgelsy, DGELSY) (
const octave_idx_type&,
const octave_idx_type&,
154 const octave_idx_type&,
double*,
155 const octave_idx_type&,
double*,
156 const octave_idx_type&, octave_idx_type*,
157 double&, octave_idx_type&,
double*,
158 const octave_idx_type&, octave_idx_type&);
161 F77_FUNC (dgelsd, DGELSD) (
const octave_idx_type&,
const octave_idx_type&,
162 const octave_idx_type&,
double*,
163 const octave_idx_type&,
double*,
164 const octave_idx_type&,
double*,
double&,
165 octave_idx_type&,
double*,
166 const octave_idx_type&, octave_idx_type*,
171 const octave_idx_type&,
double *,
172 const octave_idx_type&, octave_idx_type&
177 const octave_idx_type&,
double*,
178 const octave_idx_type&,
const double&,
179 double&,
double*, octave_idx_type*,
184 const octave_idx_type&,
const octave_idx_type&,
185 const double*,
const octave_idx_type&,
double*,
186 const octave_idx_type&, octave_idx_type&
192 const octave_idx_type&,
const double*,
193 const octave_idx_type&, octave_idx_type&
200 const octave_idx_type&,
const double*,
201 const octave_idx_type&,
double&,
202 double*, octave_idx_type*, octave_idx_type&
210 const octave_idx_type&,
const octave_idx_type&,
211 const double*,
const octave_idx_type&,
double*,
212 const octave_idx_type&, octave_idx_type&
218 F77_FUNC (dlartg, DLARTG) (
const double&,
const double&,
double&,
224 const octave_idx_type&,
const octave_idx_type&,
225 const octave_idx_type&,
const double*,
226 const octave_idx_type&,
const double*,
227 const octave_idx_type&,
const double*,
228 const octave_idx_type&,
double&, octave_idx_type&
234 const octave_idx_type&,
const octave_idx_type&,
235 const double*,
const octave_idx_type&,
266 elem (ia(i), i) = 1.0;
269 elem (i, ia(i)) = 1.0;
284 elem (i, j) =
static_cast<unsigned char> (a.
elem (i, j));
299 return !(*
this == a);
330 if (r < 0 || r >=
rows () || c < 0 || c + a_len >
cols ())
332 (*current_liboctave_error_handler) (
"range error for insert");
352 if (r < 0 || r + a_len >
rows () || c < 0 || c >=
cols ())
354 (*current_liboctave_error_handler) (
"range error for insert");
375 if (r < 0 || r + a_nr >
rows () || c < 0 || c + a_nc >
cols ())
377 (*current_liboctave_error_handler) (
"range error for insert");
381 fill (0.0, r, c, r + a_nr - 1, c + a_nc - 1);
402 if (nr > 0 && nc > 0)
421 if (r1 < 0 || r2 < 0 || c1 < 0 || c2 < 0
422 || r1 >= nr || r2 >= nr || c1 >= nc || c2 >= nc)
424 (*current_liboctave_error_handler) (
"range error for fill");
428 if (r1 > r2) { std::swap (r1, r2); }
429 if (c1 > c2) { std::swap (c1, c2); }
431 if (r2 >= r1 && c2 >= c1)
450 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
456 retval.
insert (*
this, 0, 0);
457 retval.
insert (a, 0, nc_insert);
468 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
474 retval.
insert (*
this, 0, 0);
475 retval.
insert (a, 0, nc_insert);
486 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
491 Matrix retval (nr, nc + 1);
492 retval.
insert (*
this, 0, 0);
493 retval.
insert (a, 0, nc_insert);
504 (*current_liboctave_error_handler) (
"row dimension mismatch for append");
510 retval.
insert (*
this, 0, 0);
511 retval.
insert (a, 0, nc_insert);
522 (*current_liboctave_error_handler)
523 (
"column dimension mismatch for stack");
529 retval.
insert (*
this, 0, 0);
530 retval.
insert (a, nr_insert, 0);
541 (*current_liboctave_error_handler)
542 (
"column dimension mismatch for stack");
547 Matrix retval (nr + 1, nc);
548 retval.
insert (*
this, 0, 0);
549 retval.
insert (a, nr_insert, 0);
560 (*current_liboctave_error_handler)
561 (
"column dimension mismatch for stack");
567 retval.
insert (*
this, 0, 0);
568 retval.
insert (a, nr_insert, 0);
579 (*current_liboctave_error_handler)
580 (
"column dimension mismatch for stack");
586 retval.
insert (*
this, 0, 0);
587 retval.
insert (a, nr_insert, 0);
607 if (r1 > r2) { std::swap (r1, r2); }
608 if (c1 > c2) { std::swap (c1, c2); }
640 return inverse (mattype, info, rcon, 0, 0);
648 return inverse (mattype, info, rcon, 0, 0);
656 return inverse (mattype, info, rcon, force, calc_cond);
664 return inverse (mattype, info, rcon, 0, 0);
671 return inverse (mattype, info, rcon, 0, 0);
676 int force,
int calc_cond)
const
683 if (nr != nc || nr == 0 || nc == 0)
684 (*current_liboctave_error_handler) (
"inverse requires square matrix");
687 int typ = mattype.
type ();
695 nr, tmp_data, nr, info
714 nr, tmp_data, nr, rcon,
715 work, iwork, dtrcon_info
720 if (dtrcon_info != 0)
724 if (info == -1 && ! force)
734 int force,
int calc_cond)
const
741 if (nr != nc || nr == 0 || nc == 0)
742 (*current_liboctave_error_handler) (
"inverse requires square matrix");
755 F77_XFCN (dgetri, DGETRI, (nc, tmp_data, nr, pipvt,
759 lwork = (lwork < 2 *nc ? 2*nc : lwork);
768 anorm = retval.
abs ().
sum ().
row (static_cast<octave_idx_type>(0))
771 F77_XFCN (dgetrf, DGETRF, (nc, nc, tmp_data, nr, pipvt, info));
786 nc, tmp_data, nr, anorm,
787 rcon, pz, piz, dgecon_info
790 if (dgecon_info != 0)
794 if (info == -1 && ! force)
800 F77_XFCN (dgetri, DGETRI, (nc, tmp_data, nr, pipvt,
801 pz, lwork, dgetri_info));
803 if (dgetri_info != 0)
816 int force,
int calc_cond)
const
818 int typ = mattype.
type (
false);
822 typ = mattype.
type (*
this);
825 ret =
tinverse (mattype, info, rcon, force, calc_cond);
830 CHOL chol (*
this, info, calc_cond);
834 rcon = chol.
rcond ();
844 ret =
finverse (mattype, info, rcon, force, calc_cond);
846 if ((mattype.
is_hermitian () || calc_cond) && rcon == 0.)
871 tol = nr * sigma.
elem (0) * std::numeric_limits<double>::epsilon ();
873 tol = nc * sigma.
elem (0) * std::numeric_limits<double>::epsilon ();
876 while (r >= 0 && sigma.
elem (r) < tol)
880 return Matrix (nc, nr, 0.0);
890 #if defined (HAVE_FFTW)
900 size_t npts, nsamples;
902 if (nr == 1 || nc == 1)
904 npts = nr > nc ? nr : nc;
929 size_t npts, nsamples;
931 if (nr == 1 || nc == 1)
933 npts = nr > nc ? nr : nc;
992 F77_FUNC (
zfftb, ZFFTB) (
const octave_idx_type&, Complex*, Complex*);
1005 if (nr == 1 || nc == 1)
1007 npts = nr > nc ? nr : nc;
1019 Complex *pwsave = wsave.fortran_vec ();
1046 if (nr == 1 || nc == 1)
1048 npts = nr > nc ? nr : nc;
1060 Complex *pwsave = wsave.fortran_vec ();
1075 tmp_data[j] = tmp_data[j] / static_cast<double> (npts);
1090 if (nr == 1 || nc == 1)
1092 npts = nr > nc ? nr : nc;
1104 Complex *pwsave = wsave.fortran_vec ();
1123 pwsave = wsave.fortran_vec ();
1126 Complex *prow = tmp.fortran_vec ();
1135 prow[i] = tmp_data[i*nr + j];
1140 tmp_data[i*nr + j] = prow[i];
1156 if (nr == 1 || nc == 1)
1158 npts = nr > nc ? nr : nc;
1170 Complex *pwsave = wsave.fortran_vec ();
1185 tmp_data[j] = tmp_data[j] / static_cast<double> (npts);
1192 pwsave = wsave.fortran_vec ();
1195 Complex *prow = tmp.fortran_vec ();
1204 prow[i] = tmp_data[i*nr + j];
1209 tmp_data[i*nr + j] = prow[i] / static_cast<double> (npts);
1236 return determinant (mattype, info, rcon, calc_cond);
1252 (*current_liboctave_error_handler) (
"matrix must be square");
1255 volatile int typ = mattype.
type ();
1262 typ = mattype.
type (*
this);
1269 retval *=
elem (i,i);
1277 if (calc_cond) anorm =
xnorm (*
this, 1);
1299 nr, tmp_data, nr, anorm,
1307 retval *= atmp (i,i);
1309 retval = retval.
square ();
1313 (*current_liboctave_error_handler) (
"det: invalid dense matrix type");
1327 if (calc_cond) anorm =
xnorm (*
this, 1);
1329 F77_XFCN (dgetrf, DGETRF, (nr, nr, tmp_data, nr, pipvt, info));
1350 nc, tmp_data, nr, anorm,
1364 double c = atmp(i,i);
1365 retval *= (ipvt(i) != (i+1)) ? -c : c;
1379 return rcond (mattype);
1390 (*current_liboctave_error_handler) (
"matrix must be square");
1391 else if (nr == 0 || nc == 0)
1395 volatile int typ = mattype.
type ();
1398 typ = mattype.
type (*
this);
1417 nr, tmp_data, nr, rcon,
1427 (*current_liboctave_error_handler)
1428 (
"permuted triangular matrix not implemented");
1445 nr, tmp_data, nr, rcon,
1455 (*current_liboctave_error_handler)
1456 (
"permuted triangular matrix not implemented");
1459 double anorm = -1.0;
1469 anorm = atmp.
abs().
sum().
1470 row(static_cast<octave_idx_type>(0)).
max();
1490 nr, tmp_data, nr, anorm,
1510 anorm = atmp.
abs ().
sum ().
1511 row(static_cast<octave_idx_type>(0)).
max ();
1518 F77_XFCN (dgetrf, DGETRF, (nr, nr, tmp_data, nr, pipvt, info));
1529 nc, tmp_data, nr, anorm,
1547 double& rcon, solve_singularity_handler sing_handler,
1555 if (nr != b.
rows ())
1557 (
"matrix dimension mismatch solution of linear equations");
1558 else if (nr == 0 || nc == 0 || b.
cols () == 0)
1562 volatile int typ = mattype.
type ();
1573 (*current_liboctave_error_handler)
1574 (
"permuted triangular matrix not implemented");
1594 nr, tmp_data, nr, rcon,
1603 volatile double rcond_plus_one = rcon + 1.0;
1605 if (rcond_plus_one == 1.0 ||
xisnan (rcon))
1610 sing_handler (rcon);
1613 (
"matrix singular to machine precision, rcond = %g",
1630 nr, b_nc, tmp_data, nr,
1647 double& rcon, solve_singularity_handler sing_handler,
1655 if (nr != b.
rows ())
1657 (
"matrix dimension mismatch solution of linear equations");
1658 else if (nr == 0 || nc == 0 || b.
cols () == 0)
1662 volatile int typ = mattype.
type ();
1673 (*current_liboctave_error_handler)
1674 (
"permuted triangular matrix not implemented");
1694 nr, tmp_data, nr, rcon,
1703 volatile double rcond_plus_one = rcon + 1.0;
1705 if (rcond_plus_one == 1.0 ||
xisnan (rcon))
1710 sing_handler (rcon);
1713 (
"matrix singular to machine precision, rcond = %g",
1730 nr, b_nc, tmp_data, nr,
1747 double& rcon, solve_singularity_handler sing_handler,
1748 bool calc_cond)
const
1755 if (nr != nc || nr != b.
rows ())
1757 (
"matrix dimension mismatch solution of linear equations");
1758 else if (nr == 0 || b.
cols () == 0)
1762 volatile int typ = mattype.
type ();
1775 anorm = atmp.
abs().
sum().
row(static_cast<octave_idx_type>(0)).
max();
1800 nr, tmp_data, nr, anorm,
1807 volatile double rcond_plus_one = rcon + 1.0;
1809 if (rcond_plus_one == 1.0 ||
xisnan (rcon))
1814 sing_handler (rcon);
1817 (
"matrix singular to machine precision, rcond = %g",
1830 nr, b_nc, tmp_data, nr,
1831 result, b.
rows (), info
1853 anorm = atmp.
abs().
sum().
row(static_cast<octave_idx_type>(0)).
max();
1860 F77_XFCN (dgetrf, DGETRF, (nr, nr, tmp_data, nr, pipvt, info));
1869 sing_handler (rcon);
1872 (
"matrix singular to machine precision");
1884 nc, tmp_data, nr, anorm,
1891 volatile double rcond_plus_one = rcon + 1.0;
1893 if (rcond_plus_one == 1.0 ||
xisnan (rcon))
1898 sing_handler (rcon);
1901 (
"matrix singular to machine precision, rcond = %g",
1915 nr, b_nc, tmp_data, nr,
1916 pipvt, result, b.
rows (), info
1924 (*current_liboctave_error_handler) (
"incorrect matrix type");
1935 return solve (typ, b, info, rcon, 0);
1942 return solve (typ, b, info, rcon, 0);
1949 return solve (typ, b, info, rcon, 0);
1954 double& rcon, solve_singularity_handler sing_handler,
1958 int typ = mattype.
type ();
1961 typ = mattype.
type (*
this);
1965 retval =
utsolve (mattype, b, info, rcon, sing_handler,
false, transt);
1967 retval =
ltsolve (mattype, b, info, rcon, sing_handler,
false, transt);
1972 retval =
fsolve (mattype, b, info, rcon, sing_handler,
true);
1975 (*current_liboctave_error_handler) (
"unknown matrix type");
1983 retval =
lssolve (b, info, rank, rcon);
1994 return solve (typ, b, info, rcon, 0);
2002 return solve (typ, b, info, rcon, 0);
2009 return solve (typ, b, info, rcon, 0);
2032 const double *smd = sm.
data ();
2035 rd[i] =
Complex (smd[i], smd[nel+i]);
2041 double& rcon, solve_singularity_handler sing_handler,
2045 tmp =
solve (typ, tmp, info, rcon, sing_handler, singular_fallback, transt);
2053 return solve (typ, b, info, rcon);
2061 return solve (typ, b, info, rcon);
2068 return solve (typ, b, info, rcon, 0);
2073 double& rcon, solve_singularity_handler sing_handler,
2077 tmp =
solve (typ, tmp, info, rcon, sing_handler,
true, transt);
2078 return tmp.
column (static_cast<octave_idx_type> (0));
2085 return tmp.
solve (typ, b);
2093 return tmp.
solve (typ, b, info);
2101 return tmp.
solve (typ, b, info, rcon);
2107 solve_singularity_handler sing_handler,
2111 return tmp.
solve (typ, b, info, rcon, sing_handler, transt);
2119 return solve (b, info, rcon, 0);
2126 return solve (b, info, rcon, 0);
2132 return solve (b, info, rcon, 0);
2137 double& rcon, solve_singularity_handler sing_handler,
2141 return solve (mattype, b, info, rcon, sing_handler,
true, transt);
2148 return tmp.
solve (b);
2155 return tmp.
solve (b, info);
2163 return tmp.
solve (b, info, rcon);
2168 solve_singularity_handler sing_handler,
2172 return tmp.
solve (b, info, rcon, sing_handler, transt);
2179 return solve (b, info, rcon);
2186 return solve (b, info, rcon);
2192 return solve (b, info, rcon, 0);
2197 solve_singularity_handler sing_handler,
2201 return solve (mattype, b, info, rcon, sing_handler, transt);
2208 return tmp.
solve (b);
2215 return tmp.
solve (b, info);
2223 return tmp.
solve (b, info, rcon);
2229 solve_singularity_handler sing_handler,
2233 return tmp.
solve (b, info, rcon, sing_handler, transt);
2242 return lssolve (b, info, rank, rcon);
2250 return lssolve (b, info, rank, rcon);
2258 return lssolve (b, info, rank, rcon);
2274 (
"matrix dimension mismatch solution of linear equations");
2275 else if (m == 0 || n == 0 || b.
cols () == 0)
2284 retval =
Matrix (maxmn, nrhs, 0.0);
2288 retval.
elem (i, j) = b.
elem (i, j);
2315 m, n, nrhs, -1, mnthr
2321 double dminmn =
static_cast<double> (minmn);
2322 double dsmlsizp1 =
static_cast<double> (smlsiz+1);
2323 #if defined (HAVE_LOG2)
2324 double tmp = log2 (dminmn / dsmlsizp1);
2326 double tmp = log (dminmn / dsmlsizp1) / log (2.0);
2338 F77_XFCN (dgelsd, DGELSD, (m, n, nrhs, tmp_data, m, pretval, maxmn,
2340 lwork, piwork, info));
2346 if (n > m && n >= mnthr)
2349 = 9*m + 2*m*smlsiz + 8*m*nlvl + m*nrhs + (smlsiz+1)*(smlsiz+1);
2362 if (wlalsd > addend)
2367 if (work(0) < lworkaround)
2368 work(0) = lworkaround;
2373 = 12*n + 2*n*smlsiz + 8*n*nlvl + n*nrhs + (smlsiz+1)*(smlsiz+1);
2375 if (work(0) < lworkaround)
2376 work(0) = lworkaround;
2382 F77_XFCN (dgelsd, DGELSD, (m, n, nrhs, tmp_data, m, pretval,
2383 maxmn, ps, rcon, rank,
2387 if (s.
elem (0) == 0.0)
2390 rcon = s.
elem (minmn - 1) / s.
elem (0);
2405 return tmp.
lssolve (b, info, rank, rcon);
2414 return tmp.
lssolve (b, info, rank, rcon);
2423 return tmp.
lssolve (b, info, rank, rcon);
2431 return tmp.
lssolve (b, info, rank, rcon);
2440 return lssolve (b, info, rank, rcon);
2448 return lssolve (b, info, rank, rcon);
2456 return lssolve (b, info, rank, rcon);
2472 (
"matrix dimension mismatch solution of linear equations");
2473 else if (m == 0 || n == 0)
2512 double dminmn =
static_cast<double> (minmn);
2513 double dsmlsizp1 =
static_cast<double> (smlsiz+1);
2514 #if defined (HAVE_LOG2)
2515 double tmp = log2 (dminmn / dsmlsizp1);
2517 double tmp = log (dminmn / dsmlsizp1) / log (2.0);
2529 F77_XFCN (dgelsd, DGELSD, (m, n, nrhs, tmp_data, m, pretval, maxmn,
2531 lwork, piwork, info));
2536 F77_XFCN (dgelsd, DGELSD, (m, n, nrhs, tmp_data, m, pretval,
2537 maxmn, ps, rcon, rank,
2543 if (s.
elem (0) == 0.0)
2546 rcon = s.
elem (minmn - 1) / s.
elem (0);
2562 return tmp.
lssolve (b, info, rank, rcon);
2571 return tmp.
lssolve (b, info, rank, rcon);
2580 return tmp.
lssolve (b, info, rank, rcon);
2588 return tmp.
lssolve (b, info, rank, rcon);
2600 if (nr != a_nr || nc != a_nc)
2621 if (nr != a_nr || nc != a_nc)
2657 retval =
Matrix (len, a_len);
2662 len, a_len, 1, 1.0, v.
data (), len,
2663 a.
data (), 1, 0.0, c, len
2729 double val =
elem (i);
2755 return do_mx_red_op<bool, double> (*
this, dim,
mx_inline_all);
2761 return do_mx_red_op<bool, double> (*
this, dim,
mx_inline_any);
2779 return do_mx_red_op<double, double> (*
this, dim,
mx_inline_prod);
2785 return do_mx_red_op<double, double> (*
this, dim,
mx_inline_sum);
2797 return do_mx_unary_map<double, double, std::abs> (*this);
2814 if (nr == 1 || nc == 1)
2818 (
"diag: expecting vector argument");
2838 if (nr > 0 && nc > 0)
2849 for (idx_j = 0; idx_j < nc; idx_j++)
2851 tmp_min =
elem (i, idx_j);
2859 double tmp =
elem (i, j);
2863 else if (tmp < tmp_min)
2870 result.
elem (i) = tmp_min;
2871 idx_arg.
elem (i) =
xisnan (tmp_min) ? 0 : idx_j;
2893 if (nr > 0 && nc > 0)
2904 for (idx_j = 0; idx_j < nc; idx_j++)
2906 tmp_max =
elem (i, idx_j);
2914 double tmp =
elem (i, j);
2918 else if (tmp > tmp_max)
2925 result.
elem (i) = tmp_max;
2926 idx_arg.
elem (i) =
xisnan (tmp_max) ? 0 : idx_j;
2948 if (nr > 0 && nc > 0)
2959 for (idx_i = 0; idx_i < nr; idx_i++)
2961 tmp_min =
elem (idx_i, j);
2969 double tmp =
elem (i, j);
2973 else if (tmp < tmp_min)
2980 result.
elem (j) = tmp_min;
2981 idx_arg.
elem (j) =
xisnan (tmp_min) ? 0 : idx_i;
3003 if (nr > 0 && nc > 0)
3014 for (idx_i = 0; idx_i < nr; idx_i++)
3016 tmp_max =
elem (idx_i, j);
3024 double tmp =
elem (i, j);
3028 else if (tmp > tmp_max)
3035 result.
elem (j) = tmp_max;
3036 idx_arg.
elem (j) =
xisnan (tmp_max) ? 0 : idx_i;
3064 if (nr > 0 && nc > 0)
3070 tmp = octave_read_value<double> (is);
3072 a.
elem (i, j) = tmp;
3086 double cc, s, temp_r;
3088 F77_FUNC (dlartg, DLARTG) (
x, y, cc, s, temp_r);
3136 1, a_nr, b_nr, pa, a_nr, pb,
3137 b_nr, px, a_nr, scale, info
3178 return trans ?
'T' :
'N';
3201 if (a_nr == 0 || a_nc == 0 || b_nc == 0)
3202 retval =
Matrix (a_nr, b_nc, 0.0);
3203 else if (a.
data () == b.
data () && a_nr == b_nc && tra != trb)
3207 retval =
Matrix (a_nr, b_nc);
3214 a.
data (), lda, 0.0, c, a_nr
3217 for (
int j = 0; j < a_nr; j++)
3218 for (
int i = 0; i < j; i++)
3227 retval =
Matrix (a_nr, b_nc);
3238 lda, tda, 1.0, a.
data (), lda,
3239 b.
data (), 1, 0.0, c, 1
3247 ldb, tdb, 1.0, b.
data (), ldb,
3248 a.
data (), 1, 0.0, c, 1
3257 a_nr, b_nc, a_nc, 1.0, a.
data (),
3258 lda, b.
data (), ldb, 0.0, c, a_nr
3271 return xgemm (a, b);
3276 #define EMPTY_RETURN_CHECK(T) \
3277 if (nr == 0 || nc == 0) \
3294 result (i, j) =
xmin (d, m (i, j));
3314 result (i, j) =
xmin (m (i, j), d);
3328 (*current_liboctave_error_handler)
3329 (
"two-arg min expecting args of same size");
3341 result (i, j) =
xmin (a (i, j), b (i, j));
3361 result (i, j) =
xmax (d, m (i, j));
3381 result (i, j) =
xmax (m (i, j), d);
3395 (*current_liboctave_error_handler)
3396 (
"two-arg max expecting args of same size");
3408 result (i, j) =
xmax (a (i, j), b (i, j));
3425 (
"linspace: vectors must be of equal length");
3429 retval.clear (m, n);
3431 retval(i, 0) = x1(i);
3434 double *delta = &retval(0, n-1);
3436 delta[i] = (x2(i) - x1(i)) / (n - 1);
3440 retval(i, j) = x1(i) + j*delta[i];
3443 retval(i, n-1) = x2(i);