Skip to main content

pyGKLS

pyGKLS is a Python wrapper for the GKLS generator of global optimization test functions (Giavano et al., 2003). It uses the original C implementation of the generator and provides a Python interface using Cython to generate the test functions. pyGKLS encompass a C++ class that wraps the original C implementation to provide a more user-friendly interface that can be used in C++ projects (see src/example.cc) or Python projects (see test.py).

Random number generator

The original GKLS generator uses a random number generator based introduced by Knuth in his book "The Art of Computer Programming". pyGKLS uses the Mersenne Twister random number generator from the C++ standard library to generate random numbers.

Installation

To install pyGKLS, one needs to have Python 3.12 or later.

Run the following command:

pip install gkls

Usage

The Python interface is simple and easy to use. Here is an example of how to generate a GKLS function:

from gkls import GKLS

# Create an instance of the GKLS class with random generation (default)
gkls = GKLS(2, 2, [-1, 1], -1)

x = [0.5, 0.5]

print(f"D_f = {gkls.get_d_f(x)}")
print(f"D2_f = {gkls.get_d2_f(x)}")
print(f"ND_f = {gkls.get_nd_f(x)}")

print(f"D_grad = {gkls.get_d_grad(x)}")
print(f"D2_grad = {gkls.get_d2_grad(x)}")

print(f"D2_hessian = {gkls.get_d2_hess(x)}")

One output of the above code (stochastic) could be:

D_f = 2.0314828290164897
D2_f = 2.0314828290164897
ND_f = 2.0314828290164897
D_grad = [1.7408628759925895, 2.2572832704507357]
D2_grad = [1.7408628759925895, 2.2572832704507357]
D2_hessian = [[2.0, 0.0], [0.0, 2.0]]

Arguments can be passed to the GKLS constructor function to control the properties of the generated function. The constructor has the following signature:

GKLS(
  dim : int, # dimension of the function
  num_minima : int, # number of local minima
  domain : List[float], # domain of the function (i.e. [domain_low, domain_high])
  global_min : float # global minimum value
  global_dist=None : float, # distance from the paraboloid minimizer to the global minimizer
  global_radius=None : float, # radius of the global minimizer attraction region
  gen=None : None | "geometry" | int, # generator type. None for random, "geometry" for geometry-based, or an integer for a specific seed
)

See test.py for more examples of how to use the GKLS class.

Metadata

Release files for gkls 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gkls 1.0.1
File Size Uploaded Provenance Actions
gkls-1.0.1.tar.gz 53.0 kB Without provenance Details for gkls-1.0.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for gkls 1.0.1
File Actions
gkls-1.0.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for gkls-1.0.1-cp313-cp313-win_amd64.whl
gkls-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for gkls-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
gkls-1.0.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for gkls-1.0.1-cp313-cp313-macosx_11_0_arm64.whl
gkls-1.0.1-cp313-cp313-macosx_10_13_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.13+ x86-64 Details for gkls-1.0.1-cp313-cp313-macosx_10_13_x86_64.whl
gkls-1.0.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for gkls-1.0.1-cp312-cp312-win_amd64.whl
gkls-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for gkls-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
gkls-1.0.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for gkls-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
gkls-1.0.1-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details for gkls-1.0.1-cp312-cp312-macosx_10_13_x86_64.whl
gkls-1.0.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for gkls-1.0.1-cp311-cp311-win_amd64.whl
gkls-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for gkls-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
gkls-1.0.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for gkls-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
gkls-1.0.1-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details for gkls-1.0.1-cp311-cp311-macosx_10_9_x86_64.whl
gkls-1.0.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for gkls-1.0.1-cp310-cp310-win_amd64.whl
gkls-1.0.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for gkls-1.0.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
gkls-1.0.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for gkls-1.0.1-cp310-cp310-macosx_11_0_arm64.whl
gkls-1.0.1-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details for gkls-1.0.1-cp310-cp310-macosx_10_9_x86_64.whl
gkls-1.0.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for gkls-1.0.1-cp39-cp39-win_amd64.whl
gkls-1.0.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for gkls-1.0.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
gkls-1.0.1-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details for gkls-1.0.1-cp39-cp39-macosx_11_0_arm64.whl
gkls-1.0.1-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details for gkls-1.0.1-cp39-cp39-macosx_10_9_x86_64.whl

Total release size: 1.6 MB

Release files / gkls-1.0.1.tar.gz

Download URL gkls-1.0.1.tar.gz
Size 53.0 kB
Tags Source
SHA-256 checksum
How to use checksums
09f20f8ff7ee70eafa4ff8d94a053ea02ef058fbcbf4a83ab832ab9d70487936
BLAKE2b-256 checksum
How to use checksums
a3287c593de8de0a1a6e93f44807b69004433332841ea9ddcaa4acd2ee4e08bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp313-cp313-win_amd64.whl

Download URL gkls-1.0.1-cp313-cp313-win_amd64.whl
Size 70.6 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
ebb770263624f59c873725bad49355ad1a5db524b2a56f1f16a2bdc84dad309c
BLAKE2b-256 checksum
How to use checksums
5be51b8be8f88ee03d9ba49c8eb1251fd5f2885a130d15dd55efd8e1c7beaa77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL gkls-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 105.0 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
25c34f662415bd8cad063ccbb7d73c3adfb15d736f17252b29027445403df498
BLAKE2b-256 checksum
How to use checksums
7c7a15126db528a20143c49e1dfdbcbe29e2bc24c9662c25f2436af0b02b0ebb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL gkls-1.0.1-cp313-cp313-macosx_11_0_arm64.whl
Size 70.5 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
11be970f55ec67bea062f58de5c1fd6a70f0a89b8fd2d64250bb14e3433bff92
BLAKE2b-256 checksum
How to use checksums
db0809e129814bdbca4efa3efe219196af7f8a5337b820e607b389753522aad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp313-cp313-macosx_10_13_x86_64.whl

Download URL gkls-1.0.1-cp313-cp313-macosx_10_13_x86_64.whl
Size 73.1 kB
Tags CPython 3.13 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
f8dcbbcac150651e6020652de83bd179eb5e737f78750a5d96ea0bcfecd77c25
BLAKE2b-256 checksum
How to use checksums
ba75be4f778dd6a578e544570dd45f2873c26f8f16a604e28404ed67a0c9a0a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp312-cp312-win_amd64.whl

Download URL gkls-1.0.1-cp312-cp312-win_amd64.whl
Size 71.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
fc28cdc32e35c1112eb7db72d85c39ab50af18bcbb7b5dfe613179bf0d28dd02
BLAKE2b-256 checksum
How to use checksums
c2b25c8e9edb27eaea5818dd9d4018e4a257532c50e18f069145ba241809856c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL gkls-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 106.0 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
755c1e0c8c9e853df12be3c2c7d6c1313000fa2b0dd079d9174a6cec8952db14
BLAKE2b-256 checksum
How to use checksums
f9e595e4750fe6859eef108b6ca50e6e98d7fc32b07d3d8e0f7f11240838c1e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL gkls-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
Size 71.1 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7260ba785a4897023c128a65e8151f7e48d34654e256399886d3f6cd0803f34a
BLAKE2b-256 checksum
How to use checksums
45caffdfa8fef7661132aadc5c4e5fb3d0d1cdbf9cffc3b7f931ff54d3c60453
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp312-cp312-macosx_10_13_x86_64.whl

Download URL gkls-1.0.1-cp312-cp312-macosx_10_13_x86_64.whl
Size 73.8 kB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
fd8a193a141f657d70eaa0f6aa5935141b564a65c7b3ce0731bfeceb1843760f
BLAKE2b-256 checksum
How to use checksums
fff6a06604f32d1beb999ad35f40214a680d43f8fbf2d3928160e39c287efc3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp311-cp311-win_amd64.whl

Download URL gkls-1.0.1-cp311-cp311-win_amd64.whl
Size 70.5 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
889b1b4a1c8791589fe6516a40724eb30e9b0f0f40bf6640d85d588dfef087c1
BLAKE2b-256 checksum
How to use checksums
943a8ec668251c99be445e138d857bdc3c1be7cb8edcf93927906fcce23a5d6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL gkls-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 105.6 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1cbfa9a7f63d2c50acd8485c0b41a93ea4d4247bdeb8282627c28443a5d2f1c4
BLAKE2b-256 checksum
How to use checksums
23a0586b450f0c67b64c67044b208ef8a3755a47894bdc432a8bd86d19bb2ec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL gkls-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Size 69.7 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cd7514bf94f46dafd8b1a1d334f4a3a7eea3bedb8b3a377d30619a780042369a
BLAKE2b-256 checksum
How to use checksums
fb8c638453c14ad8b204ebdac43d6d6d4728612f10c76a9eabb6678aca717ed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp311-cp311-macosx_10_9_x86_64.whl

Download URL gkls-1.0.1-cp311-cp311-macosx_10_9_x86_64.whl
Size 71.6 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
7ee50dc192654442a51f725cdf2d6a5419986107946d7ce09e9c22dd48da1f45
BLAKE2b-256 checksum
How to use checksums
e9213d3d5610055c24fa9770463882bd7db78b011a472a862f1635d23bebb49e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp310-cp310-win_amd64.whl

Download URL gkls-1.0.1-cp310-cp310-win_amd64.whl
Size 70.6 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
051db65adae9dff12e6f9e1ad486faf5419b5f6b3e29530d9631dafff21878f0
BLAKE2b-256 checksum
How to use checksums
1fe01afb234dbf1f4e1ac2d5ef793d631f24b034cf600b47ecf895b6170ecf8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL gkls-1.0.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 107.3 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
203817b222fa33be2eccea25196ce3bd492c6b3bafc02c860f426de414fa0962
BLAKE2b-256 checksum
How to use checksums
17aabc8e94b7ea002d9539d5b4bbc597981e912df268b3af20c97e9e645076a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL gkls-1.0.1-cp310-cp310-macosx_11_0_arm64.whl
Size 70.1 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
05a0542cfe0df474c284037f68b7c5cbbc462c1d7a032df8bd9ab5c794f91957
BLAKE2b-256 checksum
How to use checksums
a9fa26e5fb25df60e19b8c5739ec5ad54bdf5d38379c162e27d456dcb4b95cc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp310-cp310-macosx_10_9_x86_64.whl

Download URL gkls-1.0.1-cp310-cp310-macosx_10_9_x86_64.whl
Size 71.9 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
b60a5816198da732fa1bc57d1b8ec32405f914f5e83a1af7e1d526ddf703e070
BLAKE2b-256 checksum
How to use checksums
99938b4c3fce171ff70b0aa9df78c2b3ae77d88d50bbe19645bb412326c7bfe7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp39-cp39-win_amd64.whl

Download URL gkls-1.0.1-cp39-cp39-win_amd64.whl
Size 58.7 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
0022f7a1a93610e566c92e57f4804cf414bc75ebd5af6e526ce113b37a5a1b3b
BLAKE2b-256 checksum
How to use checksums
d3eb4c8839d6aed35ca79f13b9139fc443bbb5f3ea321d6404b20cf041e58390
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL gkls-1.0.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 108.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
03d406f5835fcf7d51c5fc45eb5ccc2bf226e8c6781a45be4b816bc44a319f8b
BLAKE2b-256 checksum
How to use checksums
91bd95a67c4bad3ebe49fd0ac0370b4335ddcc331404e75319aa5d0e809ef212
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp39-cp39-macosx_11_0_arm64.whl

Download URL gkls-1.0.1-cp39-cp39-macosx_11_0_arm64.whl
Size 70.9 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
833e9ec6bdb10fb9ab963c9271f54002a7f62b8883b3d6a2097beae22577e502
BLAKE2b-256 checksum
How to use checksums
f8ce5867ad951fa65e16f00a2f7640dd346c0ef16ba3c47c972e3d27ff442f2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gkls-1.0.1-cp39-cp39-macosx_10_9_x86_64.whl

Download URL gkls-1.0.1-cp39-cp39-macosx_10_9_x86_64.whl
Size 72.7 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
4d8a722453a14bc798b6dac8fa75f2f5bb5db11587cc2951371e78f1937d4e4c
BLAKE2b-256 checksum
How to use checksums
c1579e5fef81cc2eab88e2915f4f74e2d5dec6ecac6965c2006325aaaaa1f9cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for gkls 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page