{"id":16572108,"url":"https://github.com/eddelbuettel/rcppnloptexample","last_synced_at":"2025-08-24T21:16:10.876Z","repository":{"id":49377823,"uuid":"151078601","full_name":"eddelbuettel/rcppnloptexample","owner":"eddelbuettel","description":"Rcpp Example for accessing NLopt ","archived":false,"fork":false,"pushed_at":"2025-05-26T13:35:22.000Z","size":24,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-27T13:39:21.408Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/eddelbuettel.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","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,"zenodo":null}},"created_at":"2018-10-01T11:37:28.000Z","updated_at":"2025-06-18T13:16:09.000Z","dependencies_parsed_at":"2024-07-17T04:28:58.329Z","dependency_job_id":"b040d316-3a47-42d6-b9fa-2a5a7c92bf95","html_url":"https://github.com/eddelbuettel/rcppnloptexample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eddelbuettel/rcppnloptexample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Frcppnloptexample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Frcppnloptexample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Frcppnloptexample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Frcppnloptexample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eddelbuettel","download_url":"https://codeload.github.com/eddelbuettel/rcppnloptexample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Frcppnloptexample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271953135,"owners_count":24849290,"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","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-10-11T21:26:26.046Z","updated_at":"2025-08-24T21:16:10.854Z","avatar_url":"https://github.com/eddelbuettel.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## RcppNLoptExample: Rcpp example of using [NLopt](https://nlopt.readthedocs.io/en/latest/) via [nloptr](https://github.com/astamm/nloptr)\n\n[![CI](https://github.com/eddelbuettel/rcppnloptexample/workflows/ci/badge.svg)](https://github.com/eddelbuettel/rcppnloptexample/actions?query=workflow%3Aci)\n[![License](https://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](https://www.gnu.org/licenses/gpl-2.0.html)\n[![CRAN](https://www.r-pkg.org/badges/version/RcppNLoptExample)](https://cran.r-project.org/package=RcppNLoptExample)\n[![Downloads](https://cranlogs.r-pkg.org/badges/RcppNLoptExample?color=brightgreen)](https://www.r-pkg.org/pkg/RcppNLoptExample)\n[![Last Commit](https://img.shields.io/github/last-commit/eddelbuettel/rcppnloptexample)](https://github.com/eddelbuettel/rcppnloptexample)\n\n### About\n\nStarting with its 1.2.0 release, the [nloptr](https://github.com/astamm/nloptr) package by [Jelmer\nYpma](https://github.com/jyypma) now exports its C symbols in a way that makes it accessible to\nother R packages _without linking_ easing the installation across operating systems.\n\nThis package illustrates this with an example drawn from the [NLopt\ntutorial](https://nlopt.readthedocs.io/en/latest/NLopt_Tutorial/).\n\n### Example\n\nSee the (currently single) file\n[src/nlopt.cpp](https://github.com/eddelbuettel/rcppnloptexample/blob/master/src/nlopt.cpp).\n\n### How / Why ?\n\nR uses C interfaces. These C interfaces can be exported _between packages_.  So when the\nusual `library(nloptr)` happens, we now _also_ get a number of C functions registered.\n\nAnd those are enough to run optimization from C++ as we simply _rely on the C interface\nprovided_. Look careful at the example code: the objective function and the constraint\nfunctions are C functions, and the body of our example invokes C functions from\n[NLopt](https://nlopt.readthedocs.io/en/latest/). _This just works_.\n\nOn the other hand, if we tried to use the [NLopt](https://nlopt.readthedocs.io/en/latest/)\nC++ interface _which brings with it someinterface code_ we would require linking to that\ncode (which R cannot easily export across packages using its C interface). So C it is.\n\n### See Also\n\nThis repo builds on, extends, and simplifies an earlier [repo by Julien\nChiquet](https://github.com/jchiquet/RcppArmadilloNLoptExample) to which I contributed a core part\nof this setup.\n\n### Author\n\nDirk Eddelbuettel\n\n### License\n\nGPL (\u003e= 2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddelbuettel%2Frcppnloptexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddelbuettel%2Frcppnloptexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddelbuettel%2Frcppnloptexample/lists"}