File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -1154,14 +1154,10 @@ cdef tuple update(
1154
1154
c = cc[0 ] + cc[1 ] + cc[2 ] - 1 / vv[nbr[0 ], nbr[1 ], nbr[2 ]]** 2
1155
1155
if b** 2 < 4 * a* c:
1156
1156
# This is a hack to solve the quadratic equation
1157
- # when the determinant is negative. If the
1158
- # magnitude of the determinant is very small
1159
- # compared to the solution obtained by setting it
1160
- # to zero, the approximate solution is accepted.
1157
+ # when the discrimnant is negative. This hack
1158
+ # simply sets the discriminant to zero.
1161
1159
new = - b / (2 * a)
1162
- if (4 * a* c - b** 2 ) / new > 1e-4 :
1163
- count_b += 1
1164
- continue
1160
+ count_b += 1
1165
1161
else :
1166
1162
new = (- b + libc.math.sqrt(b** 2 - 4 * a* c)) / (2 * a)
1167
1163
if new < uu[nbr[0 ], nbr[1 ], nbr[2 ]]:
You can’t perform that action at this time.
0 commit comments