Commit 1d207bea authored by Marco Selig's avatar Marco Selig

recursion bug in invertible_operator fixed.

parent 6d704d5b
...@@ -189,6 +189,8 @@ class invertible_operator(operator): ...@@ -189,6 +189,8 @@ class invertible_operator(operator):
## apply operator ## apply operator
if(self.imp): if(self.imp):
A = self._inverse_multiply A = self._inverse_multiply
elif(id(self.inverse_times)==id(invertible_operator.inverse_times)): ## avoid infinite recursion
A = super(invertible_operator,self).inverse_times
else: else:
A = self.inverse_times A = self.inverse_times
x_,convergence = conjugate_gradient(A,x_,W=W,spam=spam,reset=reset,note=note)(x0=x0,tol=tol,clevel=clevel,limii=limii) x_,convergence = conjugate_gradient(A,x_,W=W,spam=spam,reset=reset,note=note)(x0=x0,tol=tol,clevel=clevel,limii=limii)
...@@ -255,6 +257,8 @@ class invertible_operator(operator): ...@@ -255,6 +257,8 @@ class invertible_operator(operator):
## apply operator ## apply operator
if(self.imp): if(self.imp):
A = self._multiply A = self._multiply
elif(id(self.times)==id(invertible_operator.times)): ## avoid infinite recursion
A = super(invertible_operator,self).times
else: else:
A = self.times A = self.times
x_,convergence = conjugate_gradient(A,x_,W=W,spam=spam,reset=reset,note=note)(x0=x0,tol=tol,clevel=clevel,limii=limii) x_,convergence = conjugate_gradient(A,x_,W=W,spam=spam,reset=reset,note=note)(x0=x0,tol=tol,clevel=clevel,limii=limii)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment