Skip to content

Commit

Permalink
BUG: use the operator ~ for logical negation
Browse files Browse the repository at this point in the history
close #46
  • Loading branch information
johnyf committed Jul 8, 2017
1 parent 17e8722 commit fecd694
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion polytope/polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ def reduce(poly, nonEmptyBounded=1, abs_tol=ABS_TOL):
lb, ub = Polytope(A_arr, b_arr).bounding_box
#cand = -(np.dot((A_arr>0)*A_arr,ub-lb)
#-(b_arr-np.dot(A_arr,lb).T).T<-1e-4)
cand = -(np.dot((A_arr > 0)*A_arr, ub-lb) -
cand = ~ (np.dot((A_arr > 0)*A_arr, ub-lb) -
(np.array([b_arr]).T-np.dot(A_arr, lb)) < -1e-4)
A_arr = A_arr[cand.squeeze()]
b_arr = b_arr[cand.squeeze()]
Expand Down

0 comments on commit fecd694

Please sign in to comment.