@@ -889,16 +889,18 @@ def horner(self, x, warn_infinite=True):
889
889
x_arr = np .atleast_1d (x ).astype (complex , copy = False )
890
890
891
891
# return fast on systems with 0 or 1 state
892
- if self .nstates == 0 :
893
- return self .D [:, :, np .newaxis ] \
894
- * np .ones_like (x_arr , dtype = complex )
895
- if self .nstates == 1 :
896
- with np .errstate (divide = 'ignore' , invalid = 'ignore' ):
897
- out = (self .C [:, :, np .newaxis ]
898
- * (self .B [:, :, np .newaxis ] / (x_arr - self .A [0 , 0 ]))
899
- + self .D [:, :, np .newaxis ])
900
- out [np .isnan (out )] = complex (np .inf , np .nan )
901
- return out
892
+ if not config .defaults ['statesp.use_numpy_matrix' ]:
893
+ if self .nstates == 0 :
894
+ return self .D [:, :, np .newaxis ] \
895
+ * np .ones_like (x_arr , dtype = complex )
896
+ if self .nstates == 1 :
897
+ with np .errstate (divide = 'ignore' , invalid = 'ignore' ):
898
+ out = self .C [:, :, np .newaxis ] \
899
+ / (x_arr - self .A [0 , 0 ]) \
900
+ * self .B [:, :, np .newaxis ] \
901
+ + self .D [:, :, np .newaxis ]
902
+ out [np .isnan (out )] = complex (np .inf , np .nan )
903
+ return out
902
904
903
905
try :
904
906
out = self .slycot_laub (x_arr )
0 commit comments