How to use the pyswarms.utils.functions.single_obj.beale function in pyswarms

To help you get started, weโ€™ve selected a few pyswarms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ljvmiranda921 / pyswarms / tests / utils / functions / test_singleobj_bounds.py View on Github external
def test_beale_bound_fail(outbound):
    """Test beale bound exception"""
    with pytest.raises(ValueError):
        x = outbound(b["beale"].low, b["beale"].high, size=(3, 2))
        fx.beale(x)
github ljvmiranda921 / pyswarms / tests / utils / functions / test_singleobj_dims.py View on Github external
def test_beale_dim_fail(outdim):
    """Test beale dim exception"""
    with pytest.raises(IndexError):
        fx.beale(outdim)
github ljvmiranda921 / pyswarms / tests / utils / functions / test_singleobj_return.py View on Github external
def test_beale_output(common_minima2):
    """Tests beale function output."""
    assert np.isclose(fx.beale([3, 0.5] * common_minima2), np.zeros(3)).all()
github ljvmiranda921 / pyswarms / tests / utils / functions / test_singleobj_returndims.py View on Github external
def test_beale_output_size(common_minima, targetdim):
    """Tests beale output size."""
    assert fx.beale(common_minima).shape == targetdim