Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

added optional RCPP_ARMADILLO_RETURN_COLVEC_AS_VECTOR and co.#151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
eddelbuettel merged 2 commits intoRcppCore:masterfromsgsokol:master
Aug 1, 2017
Merged

Conversation

@sgsokol
Copy link
Contributor

@sgsokolsgsokol commentedJul 29, 2017
edited by eddelbuettel
Loading

I don't know how to add unit tests with RUnit so tested by hand with code snipets like the following:

legacy colvec

> sourceCpp(code="// [[Rcpp::depends(RcppArmadillo)]]\n#include <RcppArmadillo.h>\n// [[Rcpp::export]]\narma::vec add1(arma::vec x) {return(x+1);}")> add1(1:2)     [,1][1,]2[2,]3

colvec tested with COLVEC

> sourceCpp(code="// [[Rcpp::depends(RcppArmadillo)]]\n#define RCPP_ARMADILLO_RETURN_COLVEC_AS_VECTOR\n#include <RcppArmadillo.h>\n// [[Rcpp::export]]\narma::vec add1v(arma::vec x) {return(x+1);}")> add1v(1:2)[1]23

colvec tested with ANYVEC

> sourceCpp(code="// [[Rcpp::depends(RcppArmadillo)]]\n#define RCPP_ARMADILLO_RETURN_ANYVEC_AS_VECTOR\n#include <RcppArmadillo.h>\n// [[Rcpp::export]]\narma::vec add1v(arma::vec x) {return(x+1);}")> add1v(1:2)[1]23

legacy rowvec

> sourceCpp(code="// [[Rcpp::depends(RcppArmadillo)]]\n#include <RcppArmadillo.h>\n// [[Rcpp::export]]\narma::rowvec add1r(arma::rowvec x) {return(x+1);}")> add1r(1:2)     [,1] [,2][1,]23

rowvec tested with ROWVEC

> sourceCpp(code="// [[Rcpp::depends(RcppArmadillo)]]\n#define RCPP_ARMADILLO_RETURN_ROWVEC_AS_VECTOR\n#include <RcppArmadillo.h>\n// [[Rcpp::export]]\narma::rowvec add1rv(arma::rowvec x) {return(x+1);}")> add1rv(1:2)[1]23

rowvec tested with ANYVEC

> sourceCpp(code="// [[Rcpp::depends(RcppArmadillo)]]\n#define RCPP_ARMADILLO_RETURN_ANYVEC_AS_VECTOR\n#include <RcppArmadillo.h>\n// [[Rcpp::export]]\narma::rowvec add1rv(arma::rowvec x) {return(x+1);}")> add1rv(1:2)[1]23

Signed-off-by: Serguei Sokol

Signed-off-by: Serguei Sokol <sokol at insa-toulouse.fr>
@eddelbuettel
Copy link
Member

eddelbuettel commentedJul 29, 2017
edited
Loading

First off, thanks for getting this started!

Second, I edited your markdown. Level headers (one #) are 'too loud'; I made them level four. And I made your code snippets code snippets. See what I did there, and read up on Markdown and GitHub-flavoured Markdoiwn. It is worth it.

Third, this must have new unit tests. Adding them is trivial. Justlook at the subdirectory and therunit.* files along with the supportingcpp/ directory and it should become clear. We may need several .cpp files with/without the defines.

Copy link
Member

@eddelbuetteleddelbuettel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This looks fine but is too minimal and bare.

We need unit tests.

We probably need a commented-out but documenting setting in RcppArmadilloConfig.h.

unit_test_setup() is modified to accept character vector as first argument;
@eddelbuettel
Copy link
Member

That looks good. I'll add ChangeLog and NEWS entries.

@eddelbuetteleddelbuettel merged commit41f7930 intoRcppCore:masterAug 1, 2017
@eddelbuetteleddelbuettel mentioned this pull requestAug 1, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@eddelbuetteleddelbuetteleddelbuettel approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@sgsokol@eddelbuettel

[8]ページ先頭

©2009-2025 Movatter.jp