X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fmatrix.cpp;h=65dfd4dc601e9c228f7329d6e5e18f6c471c0718;hp=ca574cc32fd9f7355fe378dded9c9bde50cf9da8;hb=5061cef31b58e90ff57c579d077c9ce625688161;hpb=1b5601580eba6925b0af9408c56d6b2027b56013 diff --git a/ginac/matrix.cpp b/ginac/matrix.cpp index ca574cc3..65dfd4dc 100644 --- a/ginac/matrix.cpp +++ b/ginac/matrix.cpp @@ -599,35 +599,31 @@ matrix matrix::pow(const ex & expn) const // Integer cases are computed by successive multiplication, using the // obvious shortcut of storing temporaries, like A^4 == (A*A)*(A*A). if (expn.info(info_flags::integer)) { - numeric k; - matrix prod(row,col); + numeric b = ex_to(expn); + matrix A(row,col); if (expn.info(info_flags::negative)) { - k = -ex_to(expn); - prod = this->inverse(); + b *= -1; + A = this->inverse(); } else { - k = ex_to(expn); - prod = *this; + A = *this; } - matrix result(row,col); + matrix C(row,col); for (unsigned r=0; r