Skip to content

Commit be53eb7

Browse files
author
Andrew D. McGuire
committed
Replace np.concatenate with np.union1d in statesp._remove_useless_states method
This ensures that all elements in the array of state indices to be removed are unique.
1 parent de2fc39 commit be53eb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

control/statesp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def _remove_useless_states(self):
202202
ax0_C = np.where(~self.C.any(axis=0))[1]
203203
useless_1 = np.intersect1d(ax1_A, ax1_B, assume_unique=True)
204204
useless_2 = np.intersect1d(ax0_A, ax0_C, assume_unique=True)
205-
useless = np.concatenate((useless_1, useless_2))
205+
useless = np.union1d(useless_1, useless_2)
206206

207207
# Remove the useless states.
208208
self.A = delete(self.A, useless, 0)

0 commit comments

Comments
 (0)