66 if (nr == 0 || nc == 0 || nr != nc)
67 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
70 if (static_cast<int> (b) == b)
72 int btmp =
static_cast<int> (b);
97 atmp = a.
inverse (mattyp, info, rcond, 1);
100 warning (
"inverse: matrix singular to machine\
101 precision, rcond = %g", rcond);
113 result = result * atmp;
125 error (
"use full(a) ^ full(b)");
139 if (nr == 0 || nc == 0 || nr != nc)
140 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
143 if (static_cast<int> (b) == b)
145 int btmp =
static_cast<int> (b);
170 atmp = a.
inverse (mattyp, info, rcond, 1);
173 warning (
"inverse: matrix singular to machine\
174 precision, rcond = %g", rcond);
186 result = result * atmp;
198 error (
"use full(a) ^ full(b)");
239 template <
class S,
class SM>
277 result(i, j) =
std::pow (atmp, b(i,j));
292 result(i, j) =
std::pow (a, b(i,j));
317 result(i, j) =
std::pow (atmp, b(i,j));
429 if (nr != b_nr || nc != b_nc)
435 int convert_to_complex = 0;
441 double btmp = b (a.
ridx (i), j);
442 if (static_cast<int> (btmp) != btmp)
444 convert_to_complex = 1;
457 if (convert_to_complex)
471 retval = complex_result;
534 if (nr != b_nr || nc != b_nc)
569 double btmp = b (i, j);
571 result (i, j) =
std::pow (a, static_cast<int> (btmp));
592 result (i, j) =
std::pow (a, b (i, j));
617 result (a.
ridx (i), j) =
677 if (nr != b_nr || nc != b_nc)
689 double btmp = b(a.
ridx (i), j);
694 static_cast<int> (btmp));
748 if (nr != b_nr || nc != b_nc)