86 if (a < 0.0 && !
xisint (b))
107 if (nr == 0 || nc == 0 || nr != nc)
108 error (
"for x^A, A must be a square matrix. Use .^ for elementwise power.");
135 error (
"xpow: matrix diagonalization failed");
158 if (nr == 0 || nc == 0 || nr != nc)
159 error (
"for x^A, A must be a square matrix. Use .^ for elementwise power.");
182 error (
"xpow: matrix diagonalization failed");
197 if (nr == 0 || nc == 0 || nr != nc)
198 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
201 if (static_cast<int> (b) == b)
203 int btmp =
static_cast<int> (b);
222 atmp = a.
inverse (mattype, info, rcond, 1);
225 warning (
"inverse: matrix singular to machine\
226 precision, rcond = %g", rcond);
238 result = result * atmp;
259 lambda(i) =
std::pow (lambda(i), b);
266 error (
"xpow: matrix diagonalization failed");
282 if (nr == 0 || nc == 0 || nr != nc)
283 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
286 if (static_cast<int> (b) == b)
310 int btmp =
static_cast<int> (b);
312 return a.
power (btmp);
326 if (nr == 0 || nc == 0 || nr != nc)
327 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
338 lambda(i) =
std::pow (lambda(i), b);
345 error (
"xpow: matrix diagonalization failed");
358 result =
std::pow (a, static_cast<int> (b));
374 if (nr == 0 || nc == 0 || nr != nc)
375 error (
"for x^A, A must be a square matrix. Use .^ for elementwise power.");
398 error (
"xpow: matrix diagonalization failed");
422 if (nr == 0 || nc == 0 || nr != nc)
423 error (
"for x^A, A must be a square matrix. Use .^ for elementwise power.");
446 error (
"xpow: matrix diagonalization failed");
461 if (nr == 0 || nc == 0 || nr != nc)
462 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
465 if (static_cast<int> (b) == b)
467 int btmp =
static_cast<int> (b);
486 atmp = a.
inverse (mattype, info, rcond, 1);
489 warning (
"inverse: matrix singular to machine\
490 precision, rcond = %g", rcond);
502 result = result * atmp;
523 lambda(i) =
std::pow (lambda(i), b);
530 error (
"xpow: matrix diagonalization failed");
546 if (nr == 0 || nc == 0 || nr != nc)
547 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
558 lambda(i) =
std::pow (lambda(i), b);
565 error (
"xpow: matrix diagonalization failed");
580 if (nr == 0 || nc == 0 || nr != nc)
581 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
597 return xpow (a, static_cast<Complex> (b));
655 result (i, j) =
std::pow (atmp, b (i, j));
668 result (i, j) =
std::pow (a, b (i, j));
691 result (i, j) =
std::pow (atmp, b (i, j));
700 return (a >= 0 && b >= 0) || (a <= 0 && b <= 0);
721 result(i) = (base *= inc);
730 result(i) = (limit *= inc);
774 result (i, j) =
std::pow (a (i, j), b);
795 if (nr != b_nr || nc != b_nc)
801 int convert_to_complex = 0;
806 double atmp = a (i, j);
807 double btmp = b (i, j);
808 if (atmp < 0.0 && static_cast<int> (btmp) != btmp)
810 convert_to_complex = 1;
817 if (convert_to_complex)
827 complex_result (i, j) =
std::pow (atmp, btmp);
830 retval = complex_result;
840 result (i, j) =
std::pow (a (i, j), b (i, j));
878 if (nr != b_nr || nc != b_nc)
909 double btmp = b (i, j);
911 result (i, j) =
std::pow (a, static_cast<int> (btmp));
932 result (i, j) =
std::pow (a, b (i, j));
957 result(i) = (base *= inc);
966 result(i) = (limit *= inc);
993 result (i, j) =
std::pow (a (i, j), static_cast<int> (b));
1002 result (i, j) =
std::pow (a (i, j), b);
1019 if (nr != b_nr || nc != b_nc)
1031 double btmp = b (i, j);
1033 result (i, j) =
std::pow (a (i, j), static_cast<int> (btmp));
1035 result (i, j) =
std::pow (a (i, j), btmp);
1054 result (i, j) =
std::pow (a (i, j), b);
1070 if (nr != b_nr || nc != b_nc)
1082 result (i, j) =
std::pow (a (i, j), b (i, j));
1203 int ib =
static_cast<int> (b);
1207 result(i) = a(i) * a(i);
1212 result(i) = a(i) * a(i) * a(i);
1217 result(i) = 1.0 / a(i);
1243 if (a_dims != b_dims)
1264 bool convert_to_complex =
false;
1271 if (atmp < 0.0 && static_cast<int> (btmp) != btmp)
1273 convert_to_complex =
true;
1280 if (convert_to_complex)
1288 complex_result(i) =
std::pow (atmp, b(i));
1291 retval = complex_result;
1331 if (a_dims != b_dims)
1335 return bsxfun_pow (a, b);
1366 result(i) =
std::pow (a, static_cast<int> (btmp));
1400 result.
xelem (i) = 1.0 / a(i);
1407 result(i) =
std::pow (a(i), static_cast<int> (b));
1430 if (a_dims != b_dims)
1434 return bsxfun_pow (a, b);
1450 result(i) =
std::pow (a(i), static_cast<int> (btmp));
1480 if (a_dims != b_dims)
1484 return bsxfun_pow (a, b);
1531 if (a < 0.0 && !
xisint (b))
1552 if (nr == 0 || nc == 0 || nr != nc)
1553 error (
"for x^A, A must be a square matrix. Use .^ for elementwise power.");
1581 error (
"xpow: matrix diagonalization failed");
1604 if (nr == 0 || nc == 0 || nr != nc)
1605 error (
"for x^A, A must be a square matrix. Use .^ for elementwise power.");
1628 error (
"xpow: matrix diagonalization failed");
1643 if (nr == 0 || nc == 0 || nr != nc)
1644 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
1647 if (static_cast<int> (b) == b)
1649 int btmp =
static_cast<int> (b);
1668 atmp = a.
inverse (mattype, info, rcond, 1);
1671 warning (
"inverse: matrix singular to machine\
1672 precision, rcond = %g", rcond);
1684 result = result * atmp;
1705 lambda(i) =
std::pow (lambda(i), b);
1712 error (
"xpow: matrix diagonalization failed");
1728 if (nr == 0 || nc == 0 || nr != nc)
1729 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
1732 if (static_cast<int> (b) == b)
1761 if (nr == 0 || nc == 0 || nr != nc)
1762 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
1773 lambda(i) =
std::pow (lambda(i), b);
1780 error (
"xpow: matrix diagonalization failed");
1793 result =
std::pow (a, static_cast<int> (b));
1809 if (nr == 0 || nc == 0 || nr != nc)
1810 error (
"for x^A, A must be a square matrix. Use .^ for elementwise power.");
1833 error (
"xpow: matrix diagonalization failed");
1857 if (nr == 0 || nc == 0 || nr != nc)
1858 error (
"for x^A, A must be a square matrix. Use .^ for elementwise power.");
1881 error (
"xpow: matrix diagonalization failed");
1896 if (nr == 0 || nc == 0 || nr != nc)
1897 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
1900 if (static_cast<int> (b) == b)
1902 int btmp =
static_cast<int> (b);
1921 atmp = a.
inverse (mattype, info, rcond, 1);
1924 warning (
"inverse: matrix singular to machine\
1925 precision, rcond = %g", rcond);
1937 result = result * atmp;
1958 lambda(i) =
std::pow (lambda(i), b);
1965 error (
"xpow: matrix diagonalization failed");
1981 if (nr == 0 || nc == 0 || nr != nc)
1982 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
1993 lambda(i) =
std::pow (lambda(i), b);
2000 error (
"xpow: matrix diagonalization failed");
2015 if (nr == 0 || nc == 0 || nr != nc)
2016 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
2032 return xpow (a, static_cast<FloatComplex> (b));
2089 result (i, j) =
std::pow (atmp, b (i, j));
2102 result (i, j) =
std::pow (a, b (i, j));
2125 result (i, j) =
std::pow (atmp, b (i, j));
2151 result (i, j) =
std::pow (atmp, b);
2164 result (i, j) =
std::pow (a (i, j), b);
2185 if (nr != b_nr || nc != b_nc)
2191 int convert_to_complex = 0;
2196 float atmp = a (i, j);
2197 float btmp = b (i, j);
2198 if (atmp < 0.0 && static_cast<int> (btmp) != btmp)
2200 convert_to_complex = 1;
2207 if (convert_to_complex)
2217 complex_result (i, j) =
std::pow (atmp, btmp);
2220 retval = complex_result;
2230 result (i, j) =
std::pow (a (i, j), b (i, j));
2268 if (nr != b_nr || nc != b_nc)
2299 float btmp = b (i, j);
2301 result (i, j) =
std::pow (a, static_cast<int> (btmp));
2303 result (i, j) =
std::pow (a, btmp);
2322 result (i, j) =
std::pow (a, b (i, j));
2343 result (i, j) =
std::pow (a (i, j), static_cast<int> (b));
2352 result (i, j) =
std::pow (a (i, j), b);
2369 if (nr != b_nr || nc != b_nc)
2381 float btmp = b (i, j);
2383 result (i, j) =
std::pow (a (i, j), static_cast<int> (btmp));
2385 result (i, j) =
std::pow (a (i, j), btmp);
2404 result (i, j) =
std::pow (a (i, j), b);
2420 if (nr != b_nr || nc != b_nc)
2432 result (i, j) =
std::pow (a (i, j), b (i, j));
2553 int ib =
static_cast<int> (b);
2557 result(i) = a(i) * a(i);
2562 result(i) = a(i) * a(i) * a(i);
2567 result(i) = 1.0f / a(i);
2593 if (a_dims != b_dims)
2614 bool convert_to_complex =
false;
2621 if (atmp < 0.0 && static_cast<int> (btmp) != btmp)
2623 convert_to_complex =
true;
2630 if (convert_to_complex)
2638 complex_result(i) =
std::pow (atmp, b(i));
2641 retval = complex_result;
2681 if (a_dims != b_dims)
2685 return bsxfun_pow (a, b);
2716 result(i) =
std::pow (a, static_cast<int> (btmp));
2750 result.
xelem (i) = 1.0f / a(i);
2757 result(i) =
std::pow (a(i), static_cast<int> (b));
2780 if (a_dims != b_dims)
2784 return bsxfun_pow (a, b);
2800 result(i) =
std::pow (a(i), static_cast<int> (btmp));
2830 if (a_dims != b_dims)
2834 return bsxfun_pow (a, b);