tests/test_subproblem.py
def is_local_quad_min(s, B, g):
    """
    make local perturbations to verify s is a local minimum of quad(s, B, g)
    """
    _, ev = linalg.eig(B)
    perturbs = np.array([
        quad(s + eps*ev[:, iv], B, g)
        for iv in range(ev.shape[1])
        for eps in [1e-2, -1e-2]
    ])
    return np.all((perturbs - quad(s, B, g)) > 0)

    make local perturbations to verify s is a local minimum of quad(s, B, g)
    
make local perturbations to verify s is a local minimum of quad(s, B, g)
make local perturbations to verify s is a local minimum of quad ( s B g )
def is_local_quad_min(s, B, g):
    _, ev = linalg.eig(B)
    perturbs = np.array([
        quad(s + eps*ev[:, iv], B, g)
        for iv in range(ev.shape[1])
        for eps in [1e-2, -1e-2]
    ])
    return np.all((perturbs - quad(s, B, g)) > 0)
def is_local_quad_min ( s , B , g ) : _ , ev = linalg . eig ( B ) perturbs = np . array ( [ quad ( s + eps * ev [ : , iv ] , B , g ) for iv in range ( ev . shape [ 1 ] ) for eps in [ 1e-2 , - 1e-2 ] ] ) return np . all ( ( perturbs - quad ( s , B , g ) ) > 0 )
make local perturbations to verify s is a local minimum of quad(s, B, g)
make local perturbations to verify s is a local minimum of quad ( s B g )
"""
    make local perturbations to verify s is a local minimum of quad(s, B, g)
    """
s
B
g