Coder Social home page Coder Social logo

coatless-rpkg / rcppensmallen Goto Github PK

View Code? Open in Web Editor NEW
31.0 2.0 4.0 4.87 MB

Rcpp integration for the Ensmallen templated C++ mathematical optimization library

Home Page: http://r-pkg.thecoatlessprofessor.com/rcppensmallen/

R 0.15% C 0.04% C++ 34.05% R 0.15% C 0.04% C++ 65.57%
rcpp rcpparmadillo r ensmallen armadillo optimization cpp11

rcppensmallen's People

Contributors

coatless avatar eddelbuettel avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rcppensmallen's Issues

Restore GitHub Links post-CRAN GH_TOKEN addition

In PR #25's 29ed79b , we lost the ability to fully link to the Ensmallen commits on GitHub due to the NEWS.md file having too many links to pages on GitHub. e.g.

From: NEWS.md
Status: 429
Message: Too Many Requests

From Slack, @eddelbuettel mentioned that Kurt Hornik is working to add a GITHUB_PAT/GITHUB_TOKEN to allow for increased traffic rates to GitHub. Once this goes through, we can restore by running:

# Read in news items
items = readLines("NEWS.md")

# Convert
items = sub(
          "mlpack/ensmallen#([0-9]+)",
          "[#\1](https://github.com/mlpack/ensmallen/pulls/\1)", 
          items
         )

# Write out fixed items
writeLines(items, "NEWS.md")

Move ci tests forward

In all that exitement about GH Actions it seems to have been overlooked that the most current R version is not 3.6 anymore.

Error on installation in R 4.1.3(macport version) under macos Monterey

Hi, while installing the package I got the following error messages

installing source package ‘RcppEnsmallen’ ...
** package ‘RcppEnsmallen’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
/opt/local/bin/clang++-mp-13 -std=gnu++11 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Users/gpasa/Library/R/x86_64/4.1/library/Rcpp/include' -I'/Users/gpasa/Library/R/x86_64/4.1/library/RcppArmadillo/include' -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I../inst/include -fopenmp -fPIC -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from ./../inst/include/RcppEnsmallen.h:25:
In file included from ../inst/include/ensmallen.hpp:75:
../inst/include/ensmallen_bits/callbacks/callbacks.hpp:765:26: error: no member named 'HasGenerationalStepTakenSignature' in namespace 'ens::callbacks::traits'
callbacks::traits::HasGenerationalStepTakenSignature<
~~~~~~~~~~~~~~~~~~~^
../inst/include/ensmallen_bits/callbacks/callbacks.hpp:766:7: error: 'CallbackType' does not refer to a value
CallbackType, OptimizerType, FunctionType, MatType, ObjectivesVecType,
^
../inst/include/ensmallen_bits/callbacks/callbacks.hpp:758:21: note: declared here
template<typename CallbackType,
^
../inst/include/ensmallen_bits/callbacks/callbacks.hpp:767:28: error: expected member name or ';' after declaration specifiers
IndicesType>::hasBool, bool>::type
~~~~~~~~~~~~~~~~~~~~~^

Overly eager Actions

Probably unintentional and would-be-nice-if-turned-off, but each time I comment on an issue I get an email with

Run failed for master (e7a2f28)

Repository: coatless/rcppensmallen
Workflow: Commands
Duration: 3.0 seconds
Finished: 2020-01-11 12:33:43 UTC

View results: https://github.com/coatless/rcppensmallen/commit/e7a2f2803f70eb22f08d0f7b2cd578a97c63021a/checks?check_suite_id=395491589

Jobs:

To-do's

  • Surface the optimizers into R.
  • Consider implementing our own configure.ac to check for:
    • C++11-compliant compiler
    • Armadillo version > 6.500
    • macOS OpenMP issues

Add citation to ensmallen arxiv paper

Link to paper: https://arxiv.org/abs/1810.09361
Citation:

@ARTICLE{2018arXiv181009361B,
   author = {{Bhardwaj}, S. and {Curtin}, R.~R. and {Edel}, M. and {Mentekidis}, Y. and 
	{Sanderson}, C.},
    title = "{ensmallen: a flexible C++ library for efficient function optimization}",
  journal = {ArXiv e-prints},
archivePrefix = "arXiv",
   eprint = {1810.09361},
 primaryClass = "cs.MS",
 keywords = {Computer Science - Mathematical Software, Computer Science - Machine Learning, Mathematics - Optimization and Control, 65K10, 68N99, 68W99, 90C53, G.1.6, G.4},
     year = 2018,
    month = oct,
   adsurl = {http://adsabs.harvard.edu/abs/2018arXiv181009361B},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

/cc @conradsnicta

Package usage error - RcppExports includes Rcpp and RcppArmadillo

Thank you for creating a great package that is easy to use. However, when creating a R package with RcppEnsmallen I am encountering an error that I'm not sure how to address. In the RcppExports.cpp file there are include statements for both Rcpp and RcppArmadillo, which is leading to the error "Do not include either 'Rcpp.h' or 'RcppArmadillo.h'. Please only use 'RcppEnsmallen.h'." Because the RcppExports.cpp file is generated by the Rcpp::compileAttributes() function I am not sure how to correct this. This is only an issue I've encountered when creating a package, not when running individual script files via Rcpp::sourceCpp().

I am a beginner to using Rcpp so there might be something simple that I am missing. I use devtools and RStudio for creating packages, and from my understanding devtools::document(), as well as the RStudio package build/reload tools, automatically calls the Rcpp::compileAttributes() function. My .cpp file containing functions only begins with the following:

#include <RcppEnsmallen.h>
#include <RcppArmadilloExtensions/sample.h>

// [[Rcpp::plugins("cpp11")]]

// [[Rcpp::depends(RcppEnsmallen)]]

using namespace Rcpp;

In my use of RcppEnsmallen by just calling Rcpp::sourceCpp() on scripts rather than developing a package, I do not encounter any errors. I'm not sure what is the proper way to address the RcppExports file however.

Any help would be greatly appreciated, I look forward to continue to use RcppEnsmallen in my research.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.