-
Notifications
You must be signed in to change notification settings - Fork 180
Open
@elfring
Description
👀 Some source code analysis tools can help to find opportunities for improving software components.
💭 I propose to increase the usage of augmented assignment statements accordingly.
diff --git a/PythonLinearNonlinearControl/controllers/mpc.py b/PythonLinearNonlinearControl/controllers/mpc.py index c1e0db3..7f8c001 100644 --- a/PythonLinearNonlinearControl/controllers/mpc.py +++ b/PythonLinearNonlinearControl/controllers/mpc.py @@ -167,7 +167,7 @@ class LinearMPC(Controller): H = np.matmul(self.theta_mat.T, np.matmul(self.Qs, self.theta_mat)) \ + self.Rs - H = H * 0.5 + H *= 0.5 # constraints A = [] diff --git a/PythonLinearNonlinearControl/controllers/nmpc_cgmres.py b/PythonLinearNonlinearControl/controllers/nmpc_cgmres.py index 70e722b..74432af 100644 --- a/PythonLinearNonlinearControl/controllers/nmpc_cgmres.py +++ b/PythonLinearNonlinearControl/controllers/nmpc_cgmres.py @@ -126,7 +126,7 @@ class NMPCCGMRES(Controller): for j in range(i + 1): hs[j, i] = np.dot(Av, vs[:, j]) - sum_Av = sum_Av + hs[j, i] * vs[:, j] + sum_Av += hs[j, i] * vs[:, j] v_est = Av - sum_Av
Metadata
Metadata
Assignees
Labels
No labels