{"id":28452687,"url":"https://github.com/juliasmoothoptimizers/adnlpmodels.jl","last_synced_at":"2025-07-02T04:30:46.935Z","repository":{"id":38366000,"uuid":"347637674","full_name":"JuliaSmoothOptimizers/ADNLPModels.jl","owner":"JuliaSmoothOptimizers","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-04T23:19:02.000Z","size":56597,"stargazers_count":40,"open_issues_count":28,"forks_count":17,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-05T03:30:02.647Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaSmoothOptimizers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":".zenodo.json"}},"created_at":"2021-03-14T12:59:50.000Z","updated_at":"2025-06-04T23:02:49.000Z","dependencies_parsed_at":"2023-12-21T21:42:38.133Z","dependency_job_id":"7e2ffe8f-c1c0-4ecb-b03a-a182e337d82c","html_url":"https://github.com/JuliaSmoothOptimizers/ADNLPModels.jl","commit_stats":{"total_commits":570,"total_committers":17,"mean_commits":"33.529411764705884","dds":0.4614035087719298,"last_synced_commit":"4aed7b6f5c1ce416a88e5664e275bfd041c89f9f"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/JuliaSmoothOptimizers/ADNLPModels.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaSmoothOptimizers%2FADNLPModels.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaSmoothOptimizers%2FADNLPModels.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaSmoothOptimizers%2FADNLPModels.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaSmoothOptimizers%2FADNLPModels.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaSmoothOptimizers","download_url":"https://codeload.github.com/JuliaSmoothOptimizers/ADNLPModels.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaSmoothOptimizers%2FADNLPModels.jl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263074267,"owners_count":23409728,"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":[],"created_at":"2025-06-06T18:12:23.482Z","updated_at":"2025-07-02T04:30:46.927Z","avatar_url":"https://github.com/JuliaSmoothOptimizers.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ADNLPModels\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4605982.svg)](https://doi.org/10.5281/zenodo.4605982)\n[![GitHub release](https://img.shields.io/github/release/JuliaSmoothOptimizers/ADNLPModels.jl.svg)](https://github.com/JuliaSmoothOptimizers/ADNLPModels.jl/releases/latest)\n[![](https://img.shields.io/badge/docs-stable-3f51b5.svg)](https://JuliaSmoothOptimizers.github.io/ADNLPModels.jl/stable)\n[![](https://img.shields.io/badge/docs-latest-3f51b5.svg)](https://JuliaSmoothOptimizers.github.io/ADNLPModels.jl/dev)\n[![codecov](https://codecov.io/gh/JuliaSmoothOptimizers/ADNLPModels.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaSmoothOptimizers/ADNLPModels.jl)\n\n![CI](https://github.com/JuliaSmoothOptimizers/ADNLPModels.jl/workflows/CI/badge.svg?branch=main)\n[![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/JuliaSmoothOptimizers/ADNLPModels.jl?logo=Cirrus%20CI)](https://cirrus-ci.com/github/JuliaSmoothOptimizers/ADNLPModels.jl)\n\nThis package provides automatic differentiation (AD)-based model implementations that conform to the [NLPModels](https://github.com/JuliaSmoothOptimizers/ADNLPModels.jl) API.\nThe general form of the optimization problem is\n```math\n\\begin{aligned}\n\\min \\quad \u0026 f(x) \\\\\n\u0026 c_L \\leq c(x) \\leq c_U \\\\\n\u0026 \\ell \\leq x \\leq u,\n\\end{aligned}\n```\n\n## How to Cite\n\nIf you use ADNLPModels.jl in your work, please cite using the format given in [CITATION.bib](https://github.com/JuliaSmoothOptimizers/ADNLPModels.jl/blob/main/CITATION.bib).\n\n## Installation\n\n\u003cp\u003e\nADNLPModels is a \u0026nbsp;\n    \u003ca href=\"https://julialang.org\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/JuliaLang/julia-logo-graphics/master/images/julia.ico\" width=\"16em\"\u003e\n        Julia Language\n    \u003c/a\u003e\n    \u0026nbsp; package. To install ADNLPModels,\n    please \u003ca href=\"https://docs.julialang.org/en/v1/manual/getting-started/\"\u003eopen\n    Julia's interactive session (known as REPL)\u003c/a\u003e and press \u003ckbd\u003e]\u003c/kbd\u003e key in the REPL to use the package mode, then type the following command\n\u003c/p\u003e\n\n```julia\npkg\u003e add ADNLPModels\n```\n\n## Examples\n\nFor optimization in the general form, this package exports two constructors `ADNLPModel` and `ADNLPModel!`.\n\n```julia\nusing ADNLPModels\n\nf(x) = 100 * (x[2] - x[1]^2)^2 + (x[1] - 1)^2\nT = Float64\nx0 = T[-1.2; 1.0]\n# Rosenbrock\nnlp = ADNLPModel(f, x0) # unconstrained\n\nlvar, uvar = zeros(T, 2), ones(T, 2) # must be of same type than `x0`\nnlp = ADNLPModel(f, x0, lvar, uvar) # bound-constrained\n\nc(x) = [x[1] + x[2]]\nlcon, ucon = -T[0.5], T[0.5]\nnlp = ADNLPModel(f, x0, lvar, uvar, c, lcon, ucon) # constrained\n\nc!(cx, x) = begin\n  cx[1] = x[1] + x[2]\n  return cx\nend\nnlp = ADNLPModel!(f, x0, lvar, uvar, c!, lcon, ucon) # in-place constrained\n```\n\nIt is possible to distinguish between linear and nonlinear constraints, see [![](https://img.shields.io/badge/docs-stable-3f51b5.svg)](https://JuliaSmoothOptimizers.github.io/ADNLPModels.jl/stable).\n\nThis package also exports the constructors `ADNLSModel` and `ADNLSModel!` for Nonlinear Least Squares (NLS), i.e. when the objective function is a sum of squared terms.\n\n```julia\nusing ADNLPModels\n\nF(x) = [10 * (x[2] - x[1]^2); x[1] - 1]\nnequ = 2 # length of Fx\nT = Float64\nx0 = T[-1.2; 1.0]\n# Rosenbrock in NLS format\nnlp = ADNLSModel(F, x0, nequ)\n```\n\nThe resulting models, `ADNLPModel` and `ADNLSModel`, are instances of `AbstractNLPModel` and implement the NLPModel API, see [NLPModels.jl](https://github.com/JuliaSmoothOptimizers/NLPModels.jl).\n\nWe refer to the documentation for more details on the resulting models, and you can find tutorials on [jso.dev/tutorials/](https://jso.dev/tutorials/) and select the tag `ADNLPModel.jl`.\n\n## AD backend\n\nThe following AD packages are supported:\n\n- `ForwardDiff.jl`;\n- `ReverseDiff.jl`;\n\nand as optional dependencies (you must load the package before):\n\n- `Enzyme.jl`;\n- `Zygote.jl`.\n\n## Bug reports and discussions\n\nIf you think you found a bug, feel free to open an [issue](https://github.com/JuliaSmoothOptimizers/ADNLPModels.jl/issues).\nFocused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please.\n\nIf you want to ask a question not suited for a bug report, feel free to start a discussion [here](https://github.com/JuliaSmoothOptimizers/Organization/discussions). This forum is for general discussion about this repository and the [JuliaSmoothOptimizers](https://github.com/JuliaSmoothOptimizers), so questions about any of our packages are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliasmoothoptimizers%2Fadnlpmodels.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliasmoothoptimizers%2Fadnlpmodels.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliasmoothoptimizers%2Fadnlpmodels.jl/lists"}