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
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
  deterministic=False : bool, # if True, the generation of the function is deterministic
)

Metadata

Release files for gkls 1.0.0

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.0
File Size Uploaded Provenance Actions
gkls-1.0.0.tar.gz 52.5 kB Without provenance Details for gkls-1.0.0.tar.gz

Built distributions (wheels)

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

Total release size: 1.4 MB

Release files / gkls-1.0.0.tar.gz

Download URL gkls-1.0.0.tar.gz
Size 52.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1da1acf72335f2e5c935367522bd2682cb5732d1aaf5965c19821baf52400e98
BLAKE2b-256 checksum
How to use checksums
3260fdc5af22bb75364cf2dc39d50f37d6f4f59d61e9765e215331fc1185027d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp313-cp313-win_amd64.whl
Size 64.4 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
f1c45d13d1438f3ee18ccbaa954e7ad9ffa89bd7b6aeba85519edffd8974bc80
BLAKE2b-256 checksum
How to use checksums
85658a0cf46fe7dbb13bd3f1d2e1f0fb9b1aec6aaa50b0dabb560f1ff584b97e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 75.2 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b64b5a0281a147f77f67be02226f46a0ce10ca2e5c17c860e67eb0f98a0e9913
BLAKE2b-256 checksum
How to use checksums
03ab3107c818928c4cb4b652bf0022a804e8b3c89c0f86c29e1c1d8df1ba7d09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Size 66.2 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ced1652aa18f9cf4399451fbeaa038aef6d227e73fd8ca1ecc58deb8c92cdcf8
BLAKE2b-256 checksum
How to use checksums
2ff6d2fd08762a05dd154ec7a4dd1b0d8226e80631bb475112459a9e72bbbfb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp313-cp313-macosx_10_13_x86_64.whl
Size 68.6 kB
Tags CPython 3.13 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
e1c4601044653837d9f7e3e7e8af686b36a050941903f351fcb0ba0188dcc190
BLAKE2b-256 checksum
How to use checksums
422dd48da0fb7f67f3c6143888f355f80dc30622d6dea29a19752467fadc30f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp312-cp312-win_amd64.whl
Size 65.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
1b806aded1f5af7c8becc25dfd2fc32dd5ec5701310f01bbde925f8aa01eff57
BLAKE2b-256 checksum
How to use checksums
e558f479cff028c910d277efebad85291ca2ac290ccf03d5ad7b21ac9c0fa419
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 76.2 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
6c5dd47ddac7816f66a8c69758e9590d97783071a974cb9302cc4644f9739c46
BLAKE2b-256 checksum
How to use checksums
314d6183e14978973ab561cd702ef9c51b909cb7acf8e4a80f9ebe9eccec0f67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Size 66.7 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
63900481b76505fe0f5c2658005bccc525821a63d7f4a9258694fec08cb68efb
BLAKE2b-256 checksum
How to use checksums
653abe56a49db871d700aff717b854f2ca2f75539bf90ca218ef721d47597c76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp312-cp312-macosx_10_13_x86_64.whl
Size 69.2 kB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
040582db1f9f903ae657641af59fc52a2812beec390517f9038ab1b549253275
BLAKE2b-256 checksum
How to use checksums
5821613895749a9d7232e16a34bcb212470978554750876d926df4d6c7e6bc3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp311-cp311-win_amd64.whl
Size 64.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
0d314acd93bd8ab10e0b73f58f1403d32a3435d0e1689b748f9a10d272460734
BLAKE2b-256 checksum
How to use checksums
47eec551625c94928e8133c1498bda1a49e8c6b451dd3cb951af6eab70f2e28f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 74.7 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a6b5987090895af127e34e80d146e7e4fe9a52308514d51fa689458264e5e9b7
BLAKE2b-256 checksum
How to use checksums
3d0a1ef1b3174f57cc63d830616e020fb15071ee5aea0599db2393dffcc365f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Size 65.4 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bb79b83eee8ced4acdf8ec9fa0a38bb16c539ccbb4ff9f5637af85189775e345
BLAKE2b-256 checksum
How to use checksums
45dd0268f0255a2c43159e2914d69b418aae896f504ed91d1a946dd55382987e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl
Size 67.4 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
b2956d9568423af021c7a70078b10f06858e9a52655ff9afc8c9c65b14d3f0ab
BLAKE2b-256 checksum
How to use checksums
adb8f5de8f4d7c4c3d45b6db13c05a58b58c8ad7f2b6a47fb6eb55f400c956bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp310-cp310-win_amd64.whl
Size 64.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1c0f66416e1caa150f92982468a10e8f3e25a165b6cee0f67e2473a3585bfd22
BLAKE2b-256 checksum
How to use checksums
da5363538f2efc5bb91a3ff552a2c8587e861673e797a36c5b2d098b455ff66e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 76.4 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
c5d6241ceb87799ebfc3eac873039f99dd767fbffdcc17a7cec0c589b982480b
BLAKE2b-256 checksum
How to use checksums
25001b7962930fcf27c39127f1deb65e9455809c48c56ede94c053680a426247
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Size 65.6 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
42d733fc0000999edbfdf3f5acb649c1889ef599ee988d2c34d663ad2e255568
BLAKE2b-256 checksum
How to use checksums
c8473065899898bcf9966446b25617c8b69384966fd705b1f56cd466f3df884e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Size 67.4 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
b9eb315b3f7d41c0d6eee86eb4f86b05de9a12b2ab5be682127c04f2344f7260
BLAKE2b-256 checksum
How to use checksums
9d3dac05c02bedd9724a5a1922a4a9e352606880d19d86d84a238550817a25f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp39-cp39-win_amd64.whl
Size 53.1 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
0e32b82cfabb7375a7de73ec4403765c2ce62fbaa58320aa772dcfc9072ecb16
BLAKE2b-256 checksum
How to use checksums
9499dda582a14c314d12f74f4fbdd97e27966c053318e39dda82a6cabfc250f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 77.9 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
786a2b9c4e4baaa42d0a5eb49b0c1b6eaeea40322c0e6718bd67f7bd048b7711
BLAKE2b-256 checksum
How to use checksums
8d6ede10c855b114efd6c9a6a03b9631a3b8618c6730cff957d438ee3791d039
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
Size 67.1 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4cf642a720add5fa06c98ec0e6234a842f9e1b529a3d0833306ce81ca75deef7
BLAKE2b-256 checksum
How to use checksums
1b2cc3ffc23c74ad9731ebfc63e928acb9e3deb4eecef0e6b71b072b13461a8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

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

Download URL gkls-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Size 68.9 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
c51011d4e0d4453753e69640691469928e249bb98b34c6daa4cb327228986d50
BLAKE2b-256 checksum
How to use checksums
64a5352908653c4d2c0813056da3fb949d8d7f3cf7db324d332cad4422ae75c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for gkls 1.0.0

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