rcppnloptexample

Rcpp Example for accessing NLopt

https://github.com/eddelbuettel/rcppnloptexample

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Rcpp Example for accessing NLopt

Basic Info
  • Host: GitHub
  • Owner: eddelbuettel
  • Language: C++
  • Default Branch: master
  • Size: 23.4 KB
Statistics
  • Stars: 14
  • Watchers: 6
  • Forks: 3
  • Open Issues: 0
  • Releases: 0
Created over 7 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog

README.md

RcppNLoptExample: Rcpp example of using NLopt via nloptr

CI License CRAN Downloads Last Commit

About

Starting with its 1.2.0 release, the nloptr package by Jelmer Ypma now exports its C symbols in a way that makes it accessible to other R packages without linking easing the installation across operating systems.

This package illustrates this with an example drawn from the NLopt tutorial.

Example

See the (currently single) file src/nlopt.cpp.

How / Why ?

R uses C interfaces. These C interfaces can be exported between packages. So when the usual library(nloptr) happens, we now also get a number of C functions registered.

And those are enough to run optimization from C++ as we simply rely on the C interface provided. Look careful at the example code: the objective function and the constraint functions are C functions, and the body of our example invokes C functions from NLopt. This just works.

On the other hand, if we tried to use the NLopt C++ interface which brings with it someinterface code we would require linking to that code (which R cannot easily export across packages using its C interface). So C it is.

See Also

This repo builds on, extends, and simplifies an earlier repo by Julien Chiquet to which I contributed a core part of this setup.

Author

Dirk Eddelbuettel

License

GPL (>= 2)

Owner

  • Name: Dirk Eddelbuettel
  • Login: eddelbuettel
  • Kind: user
  • Location: Chicago, IL, USA

GitHub Events

Total
  • Push event: 4
Last Year
  • Push event: 4

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: about 4 hours
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • adamlei (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 474 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: RcppNLoptExample

'Rcpp' Package Illustrating Header-Only Access to 'NLopt'

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 474 Last month
Rankings
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 50.2%
Downloads: 85.4%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.0.2 depends
  • Rcpp * imports
  • nloptr >= 1.2.0 imports
.github/workflows/ci.yaml actions
  • actions/checkout v3 composite