{"id":20472041,"url":"https://github.com/jonboh/gkls-rs","last_synced_at":"2025-04-13T11:10:25.064Z","repository":{"id":208131329,"uuid":"654936862","full_name":"jonboh/gkls-rs","owner":"jonboh","description":"A Rust implementation of the GKLS function generator. GKLS allows to generate parametrized optimization problems with known local and global minima.","archived":false,"fork":false,"pushed_at":"2024-02-24T12:36:21.000Z","size":326,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-24T23:41:48.364Z","etag":null,"topics":["math","optimization"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonboh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-17T11:38:20.000Z","updated_at":"2024-03-15T00:56:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b9df586-0f77-4776-84d0-09af4b781d4f","html_url":"https://github.com/jonboh/gkls-rs","commit_stats":null,"previous_names":["jonboh/gkls-rs"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonboh%2Fgkls-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonboh%2Fgkls-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonboh%2Fgkls-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonboh%2Fgkls-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonboh","download_url":"https://codeload.github.com/jonboh/gkls-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703199,"owners_count":21148118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["math","optimization"],"created_at":"2024-11-15T14:18:16.953Z","updated_at":"2025-04-13T11:10:25.037Z","avatar_url":"https://github.com/jonboh.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gkls-rs\n`gkls-rs` is a pure Rust implementation of the algorithm described in\n[Software for Generation of Classes of Test Functions with Known Local and Global Minima for Global Optimization](https://arxiv.org/abs/1103.2695).\n\nAlthough much of the code is mostly translated from the original C implementation, in this implementation\nit is possible to define independent problems without the need to modify any global state. That particular\npoint made the usage of the original quite unwieldy when trying to run parallel code in benchmarks.\n\nThe original implementation is located at the [ACM Collected Algorithms repository](https://netlib.org/toms/) on entry number 829.\nThe folder `gkls` is a copy of those contents, it is used to test the Rust implementation.\n\nWith the feature `test_cbinding` the original C implementation and test suite is built.\nThe test-suite compares the output of the Rust and C implementations. The output must be equivalent.\nThus, the function numbers from the original paper and subsequent studies on each function are still valid.\n\nHere is the function from the original paper reproduced with `gkls-rs`:\n![Function 9 of the D-type](./assets/nf9.svg \"Function 9 of the D-type\")\n\nThe figure is generated with the binary in `examples/plot_function`.\n```bash\ncargo run --example plot_function --features examples\n```\n\nSee `examples/single_evaluation.rs` for a simple usage example:\n```rust\n// Generate a problem\nlet problem = Problem::new(9, Options::default(), 2, 10, -1.0, 1. / 3., 2. / 3.)\n    .expect(\"Problem has to be valid\");\n// Evaluate the proble with the appropiate function\nlet x = [0.23, 0.44];\nlet y = problem.d_func(\u0026x);\nlet dy = problem.d_gradient(\u0026x);\nprintln!(\"f({x:?})={y}\");\nprintln!(\"f'({x:?})={dy:?}\");\n```\nRun the example with:\n```bash\ncargo run --example single_evaluation --features examples\n```\nYou should get something like:\n```\nf([0.23, 0.44])=0.8938503184432863\nf'([0.23, 0.44])=Some([1.8828658375478264, 0.17383184854469846])\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonboh%2Fgkls-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonboh%2Fgkls-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonboh%2Fgkls-rs/lists"}