Coverage for sympy/matrices/expressions/matpow.py : 95%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
raise TypeError("Function parameter should be a matrix")
def base(self):
def exp(self):
def shape(self):
# We still have a MatPow, make an explicit MatMul out of it. #elif A.exp.is_Integer and self.exp.is_negative: # Note: possible future improvement: in principle we can take # positive powers of the inverse, but carefully avoid recursion, # perhaps by adding `_entry` to Inverse (as it is our subclass). # T = A.base.as_explicit().inverse() # A = MatMul(*[T for k in range(-A.exp)]) else: raise NotImplementedError(("(%d, %d) entry" % (int(i), int(j))) + " of matrix power either not defined or not implemented")
else: args = self.args # Note: just evaluate cases we know, return unevaluated on others. # E.g., MatrixSymbol('x', n, m) to power 0 is not an error.
|