Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
smichr committed May 15, 2024
1 parent 62e9a21 commit d4f7b7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ Elias Basler <e.e.basler@protonmail.com>
Elisha Hollander <just4now666666@gmail.com> donno2048 <just4now666666@gmail.com>
Elliot Marshall <Marshall2389@gmail.com> <marshall2389@gmail.com>
Elrond der Elbenfuerst <elrond+sympy.org@samba-tng.org>
Emile <emile.fourcin1@gmail.com>
Emile Fourcini <emile.fourcin1@gmail.com> Emile <emile.fourcin1@gmail.com>
Emma Hogan <ehogan@gemini.edu>
Enric Florit <efz1005@gmail.com>
Eric Demer <demer@mailbox.org>
Expand Down
8 changes: 4 additions & 4 deletions sympy/calculus/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ def test_is_convex():
assert is_convex(x**2, x, domain=Interval(0, oo)) == True
assert is_convex(1/x**3, x, domain=Interval.Lopen(0, oo)) == True
assert is_convex(-1/x**3, x, domain=Interval.Ropen(-oo, 0)) == True
assert is_convex(log(x),x) == False
assert is_convex(x**2+y**2,x,y)==True
assert is_convex(cos(x)+cos(y),x)==False
assert is_convex(8*x**2-2*y**2,x,y)==False
assert is_convex(log(x) ,x) == False
assert is_convex(x**2+y**2, x, y) == True
assert is_convex(cos(x) + cos(y), x) == False
assert is_convex(8*x**2 - 2*y**2, x, y) == False


def test_stationary_points():
Expand Down
3 changes: 1 addition & 2 deletions sympy/calculus/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,7 @@ def is_convex(f, *syms, domain=S.Reals):
"""
if len(syms) > 1 :
a = hessian(f,syms)
return a.is_positive_semidefinite
return hessian(f, syms).is_positive_semidefinite
from sympy.solvers.inequalities import solve_univariate_inequality
f = _sympify(f)
var = syms[0]
Expand Down

0 comments on commit d4f7b7c

Please sign in to comment.