Re: [Rcpp-devel] Rcpp equivalent of sapply(L, length)

2021-07-01 Thread Qiang Kou
What about using "Rf_length"? --- #include using namespace Rcpp; // [[Rcpp::export]] IntegerVector c_listlengths(List L) { IntegerVector lens(L.size()); for (int i=0; i Rcpp::sourceCpp("example.cpp") > l=list(1:3, 2:3, 1:6) > l2=list(

Re: [Rcpp-devel] Why might loadModule() fail?

2020-08-11 Thread Qiang Kou
I am the original maintainer of the mxnet R package. Can you give me a little more information? Best, KK On Tue, Aug 11, 2020 at 9:42 AM Jeskynar wrote: > Hi > > I'm trying to build the mxnet library from source but the installation is > failing somewhere inside loadModule('mxnet'). There's n

Re: [Rcpp-devel] dmvnorm() of mvtnorm using RcppArmadillo

2019-12-18 Thread Qiang Kou
Please try the line below: f(k) = *Rcpp::as*(dmvnorm(x.row(k), mean, sigma, give_log)); Best, KK On Wed, Dec 18, 2019 at 8:27 PM Shaami wrote: > Hi Dear > > I want to use dmvnorm() function into an cpp function using RcppArmadillo > I am trying to execute the following function. It gives me

Re: [Rcpp-devel] Value type of DataFrame::operator[]

2019-12-06 Thread Qiang Kou
What about using "TYPEOF"? Please see R Internals ( https://cran.r-project.org/doc/manuals/r-release/R-ints.html#SEXPTYPEs) for more details. #include using namespace Rcpp; // [[Rcpp::export]] DataFrame rcpp_df(){ NumericVector numeric = {1,3}; IntegerVector integer = {1,3}; Character

Re: [Rcpp-devel] Segmentation faults

2019-12-06 Thread Qiang Kou
, 2019 at 3:08 PM Brook Milligan wrote: > > > > On Dec 6, 2019, at 3:58 PM, Qiang Kou wrote: > > > > I suggest you check all the examples of RInside. For example, > > > > > https://github.com/eddelbuettel/rinside/blob/master/inst/examples/standard/rinside_sa

Re: [Rcpp-devel] Segmentation faults

2019-12-06 Thread Qiang Kou
I suggest you check all the examples of RInside. For example, https://github.com/eddelbuettel/rinside/blob/master/inst/examples/standard/rinside_sample16.cpp This might meet your requirements. Best, Qiang Kou On Fri, Dec 6, 2019 at 2:54 PM Brook Milligan wrote: > > > > On Dec 6

Re: [Rcpp-devel] Segmentation faults

2019-12-06 Thread Qiang Kou
RInside is to call the embedded R. What do you want to do with R/Rcpp? Best, KK ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC

2019-02-01 Thread Qiang Kou
Hi, Sariya, I think you need to recompile the GSL library with "-fPIC". Best, KK On 2/1/19, 9:54 AM, "Rcpp-devel on behalf of Sariya, Sanjeev" wrote: I'd requested IT/cluster person of my floor with this and see if could assist with error. It still fails after changing to "-fP

Re: [Rcpp-devel] Debugging Rcpp for Solaris

2019-01-09 Thread Qiang Kou
For testing, I suggest you use a virtual machine. You can find the instructions by the link below: https://github.com/jeroen/solarisvm Best, KK From: Rcpp-devel on behalf of mike guggis Date: Wednesday, January 9, 2019 at 6:04 AM To: "rcpp-devel@lists.r-forge.r-project.org" Subject: [Rcpp

Re: [Rcpp-devel] Package Submission Barred by Pedantic

2018-12-17 Thread Qiang Kou
NO_AUTO_PTR tells the Boost library no > to use an idiom about which newer compiler complain a lot. (And eg I sent a > PR to the dplyr team to add this which they, after sitting on it for three > weeks, now merged.) > > | On Mon, Nov 5, 2018 at 11:34 PM Qiang Kou wrote: > | > | >

Re: [Rcpp-devel] Subsetter uses int for indexing (among other issues)?

2018-11-07 Thread Qiang Kou
Hi, William, I think you can send the PR first. It will trigger the unit tests on github. Best, KK On Wed, Nov 7, 2018 at 10:52 PM William Nolan wrote: > Okay. Changes are done and appear to work for *just* my test case. Of > course I'd like to ensure I didn't break anything along the way.

Re: [Rcpp-devel] Subsetter uses int for indexing (among other issues)?

2018-11-06 Thread Qiang Kou
Hi, William, Can you give us a small piece of code to reproduce the error? That will ease our discussion. Best, KK On Tue, Nov 6, 2018 at 10:46 PM William Nolan wrote: > Hi all, > > Longtime user and lurker here. > > I got "index error" thrown by Rcpp when trying to subset a matrix with > wid

Re: [Rcpp-devel] Package Submission Barred by Pedantic

2018-11-05 Thread Qiang Kou
Hi, Nicholas, First, what you reported is a known issue from boost [1], not Rcpp. Second, this issue has been fixed in boost 1.69 [2] and the bh package still uses 1.66. Third, this warning won't block your submission to CRAN [3] [4]. I hope I answered your question. Best wishes, KK [1] http

Re: [Rcpp-devel] Template argument deduction with R objects

2018-10-13 Thread Qiang Kou
Hi, Vissarion, If I understand your problem correctly, you can use "TYPEOF" from R's C API. You can find more info on the type of an R object from https://cran.r-project.org/doc/manuals/r-release/R-ints.html#SEXPTYPEs The return value of this macro is an integer: https://github.com/wch/r-source/

Re: [Rcpp-devel] questions Rcpp

2018-09-13 Thread Qiang Kou
Hi, Mounia, In Rcpp, using std::vector is preferred. It is still possible to use pointers, however, I am afraid you need to write your "as" and "wrap" by yourself. You can find how to develop them in our documents. Best, Qiang Kou On Thu, Sep 13, 2018 at 4:15 AM Mounia Z

Re: [Rcpp-devel] ld: warning

2018-07-13 Thread Qiang Kou
StackOverflow [1] and the mailing list. Best wishes, Qiang Kou [1] https://stackoverflow.com/questions/51314888/ld-warning-text-based-stub-file-are-out-of-sync-falling-back-to-library-file On Fri, Jul 13, 2018 at 12:27 PM, Chun Leung To wrote: > When I am trying to source the cpp file, it gi

Re: [Rcpp-devel] ___assert_rtn warning with package check

2018-06-13 Thread Qiang Kou
Hi, Jason, The assert is from RcppEigen. I think the reason is how "NDEBUG" is handled by Armadillo. In your package, the RcppArmadillo header is included before RcppEigen: https://github.com/jasonserviss/check/blob/master/src/RcppExports.cpp#L4 In RcppArmadillo: https://github.com/RcppCore/Rc

Re: [Rcpp-devel] OpenACC, Rcpp and RStudio on Windows

2018-01-23 Thread Qiang Kou
On Mon, Jan 22, 2018 at 11:24 PM, Emmanuel Hamel wrote: > > For the moment, I compile the GPU code with Visual studio 2015 to make à > DLL, and then I call it from R. It is the only solution I found for the > moment. > > In MXNet R package, we also compile the cuda code using visual studio to gen

Re: [Rcpp-devel] Rcpp project for GSoC18

2017-11-16 Thread Qiang Kou
ttp://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org > _______ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- Qiang Kou q...@umai

Re: [Rcpp-devel] Stripping symbols and Cran

2017-09-18 Thread Qiang Kou
On OSX, "-strip-all" or "-strip-debug" should work. See [1] for more information. Best, Qiang Kou [1] http://releases.llvm.org/2.9/docs/CommandGuide/html/llvm-ld.html On Mon, Sep 18, 2017 at 11:42 AM, Dan Dillon wrote: > What is the output of strip --help (or equiva

Re: [Rcpp-devel] Rcpp + Package -> undefined symbol

2017-08-02 Thread Qiang Kou
Hi, Michael, All the ".cc" files need to be compiled to make your package work. Putting them in the inst/include folder is not enough. I made some quick changes in your package and please check the attachment. Best, Qiang Kou On Wed, Aug 2, 2017 at 11:22 AM, Michaël BENESTY wr

Re: [Rcpp-devel] return Colvec as vector

2017-07-27 Thread Qiang Kou
t; Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- Qiang Kou q...@umail.iu.edu School of Informatics and Computing, Indiana University ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] Check error: undefined symbol

2017-07-14 Thread Qiang Kou
Please share your code. KK On 14 Jul 2017 12:31 a.m., "Johannes Signer" wrote: > Dear Rcpp-Developers, > > I have an R-package with some Rcpp code. If I build and install the > package (`devtools::build()` and `devtools::install()`) everything works > fine. > > But, when I check the package for

Re: [Rcpp-devel] A tough RcppArmadillo Error; address(nil) cause 'unknown' in R

2017-07-09 Thread Qiang Kou
In the ge-model.cpp, from line 216 to line 225, the *_rand* will be initialized there. These lines of code are part of the "initialize" function. If you don't call the "initialize", the array won't be initialized and cause a memory error in deconstructor. Can we discuss off the list? This reall

Re: [Rcpp-devel] A tough RcppArmadillo Error; address(nil) cause 'unknown' in R

2017-07-09 Thread Qiang Kou
l as a C++ script even in our current system. > > I still wonder why this ge-r.cpp works in the old system, but I will ask > this to the maintainer of our system. > I have learned a lot from your suggestion. > > Thanks again! > > Best, > > Takeshi > > > On 2017/07

Re: [Rcpp-devel] A tough RcppArmadillo Error; address(nil) cause 'unknown' in R

2017-07-09 Thread Qiang Kou
th. > > The obs.Os01g0182600_g1.nc file is a file containing environmental > fluctuation data. > > Best, > > Takeshi > > On 2017/07/04 5:40, Qiang Kou wrote: > > Hi, I am afraid the example you provided is not a reproducible example. > > First, we don't know the

Re: [Rcpp-devel] A tough RcppArmadillo Error; address(nil) cause 'unknown' in R

2017-07-03 Thread Qiang Kou
; Rcpp::Named("out_res_dev")=Model.out_res_dev > ); > > cout << "List constructed.\n"; > >fflush(stdout); > > return (out); > } > > catch(char* e) { > cout << e << "\n"; > exit(EXIT_FAILURE); > } > catch(...) { > cout << "Error\n"; > exit(EXIT_FAILURE); > } > } > > > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- Qiang Kou q...@umail.iu.edu School of Informatics and Computing, Indiana University ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] Parallel ANN search with openMPI

2017-06-06 Thread Qiang Kou
Hi, Xiaojie, Please provide a reproducible example. I am afraid it is very hard to help with just a small code snippet. Best, Qiang Kou On Tue, Jun 6, 2017 at 6:22 PM, Xiaojie Qiu wrote: > Hi Rcpp friends, > > I have a question regarding to parallel my rcpp code for KNN querying.

Re: [Rcpp-devel] howto access elements of a DataFrame ?

2017-05-29 Thread Qiang Kou
%d rows \\n", i, df.nrow()); > for(int k=0; k < df.nrow(); k++){ > // Rcpp::GenericVector v = df[k]; > // Rprintf("typeof v = %s \\n", typeid(v).name()); > // Rprintf(" row [%d] = %s \\n", k, df[k]); > } > } > return splitted; > ' > rm(fun_4) > fun_4 <- cxxfunction(sig=signature(env="environment"), body = src_4, > plugin = "Rcpp") > ret_4 <- fun_4(PLAYGROUND) > > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Qiang Kou q...@umail.iu.edu School of Informatics and Computing, Indiana University ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] C++ compiler being omitted during compilation

2017-02-20 Thread Qiang Kou
t; Have I mistakenly set something here that is causing this problem? > > I tried putting the 'CXX=g++' in the `Makevars` but I had previously read > that it is ignored by the internal R `Makefile` so naturally it provided no > help. > > Regards, > Charles

Re: [Rcpp-devel] Add include path to sourceCpp

2017-02-01 Thread Qiang Kou
> Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- Qiang Kou q...@umail.iu.edu School of Informatics and Computing, Indiana University _

Re: [Rcpp-devel] How to set a default value when call a R function in Rcpp

2016-11-11 Thread Qiang Kou
isNull()) > > (Untested, but should work) > > Dirk > > -- > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge

Re: [Rcpp-devel] Rcpp exception with UTF-8 strings on Windows

2016-06-12 Thread Qiang Kou
Hi, Qin, I am afraid the problem you met is Windows-specific. On OSX and Linux, I got > error_with_unicode(enc2utf8("测试")) *Error: 测试* Personally I am not sure we can fix this on C++ side. Best wishes, KK ___ Rcpp-devel mailing list Rcpp-devel@lists

Re: [Rcpp-devel] Linking to GLPK

2016-06-09 Thread Qiang Kou
hanks! >> >> Tiago >> >> >> > > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- Qiang Kou q...@u

Re: [Rcpp-devel] Bug: replace_last()

2016-05-16 Thread Qiang Kou
_t index = buffer.find_last_of(s); >if (index != std::string::npos) buffer.replace(index, strlen(s), news); >valid = false; >return *this; > } > --- > > rcpp_string() > replace_all() > AabCDabCDA > > replace_first() > AabCDABCDA > &

Re: [Rcpp-devel] Bug: replace_last()

2016-05-16 Thread Qiang Kou
'%s')", s, news); > > if (is_na()) return *this; > > setBuffer(); > > //size_t index = buffer.find_last_of(s); > > size_t index = buffer.find_last_of(s) - (strlen(s)-1); > > Rcout << "A" << index << "\n"; > > if (index != st

Re: [Rcpp-devel] Bug: replace_last()

2016-05-16 Thread Qiang Kou
ind_last_of(s); > size_t index = buffer.find_last_of(s) - (strlen(s)-1); > Rcout << "A" << index << "\n"; > if (index != std::string::npos) buffer.replace(index, strlen(s), news); > valid = false; > return *this; &g

Re: [Rcpp-devel] clang-omp and clang++ -fopenmp compiler (OS X)

2016-04-05 Thread Qiang Kou
ally accomplishes. > > So I wonder if it’s possible to either specify c++ compiler in sourceCpp > or somehow add the ‘-fopenmp’ flag > > > Thanks in advance, > Yue > > > > _______ > Rcpp-devel mailing list > Rcp

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-02-01 Thread Qiang Kou
1.1.0 R6_2.1.1tools_3.2.3 curl_0.9.5 > [5] memoise_0.2.1 git2r_0.13.1digest_0.6.8devtools_1.10.0 > > > I'm glad I found MLPACK while looking at your GitHub. That has neat > features, which I'll try out. We have a big data workgroup here and > I'll look

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-30 Thread Qiang Kou
have not actually been properly materialized when we attempt to > perform the subset? > > But then, a simple test case with `x[y - 1]` with `x` and `y` both > being integer vectors seems to work just fine. So I am a bit confused. > > On Fri, Jan 29, 2016 at 3:16 PM, Dirk Eddelbuett

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-29 Thread Qiang Kou
will try to reuse it. This led to a segfault in this case, which I don't know why. Dirk and Kevin, do you have any thoughts on it? Best wishes, KK [1] https://github.com/thirdwing/Rcpp/commit/216c5220bcb84778a656b3496d0f1803b973ef61 On Fri, Jan 29, 2016 at 3:00 PM, Qiang Kou wrote: >

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-29 Thread Qiang Kou
list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- Qiang Kou q...@umail.iu.edu School of Informatics and Computing, Indiana University ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Qiang Kou
__ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- Qiang Kou q...@umail.iu.edu School of Informatics and Computing, Indiana University _

Re: [Rcpp-devel] Debugging an C++ code in package using Rcpp package ?

2016-01-13 Thread Qiang Kou
gt; >> Skype: RMkrug >> >> PGP: 0x0F52F982 >> ___ >> Rcpp-devel mailing list >> Rcpp-devel@lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > > &g

Re: [Rcpp-devel] package using Rcpp aborting with: terminate called after throwing an instance of 'Rcpp::not_compatible' inside class__newInstance()

2015-11-19 Thread Qiang Kou
el | e...@debian.org > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- Qiang Kou q...@umail.iu.edu School of Informatics and Comp

Re: [Rcpp-devel] Rcpp package building

2015-11-19 Thread Qiang Kou
> Youssef > > Phd Student at Aix-Marseille University, France > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Qiang Kou

Re: [Rcpp-devel] Overflow error when creating a large matrix

2015-11-01 Thread Qiang Kou
be a problem when in R I do: > >>>> > >>>>> mat <- matrix(0, nrow=nrow, ncol=ncol) > >>>> > >>>> > >>>> Questions: > >>>> 1. why is the behaviour different between R and Rcpp in the allocation > >>>> of a matrix? > >>>> 2. In a 64 bits machine, what is actually the maximum allowed length > >>>> of a vector/matrix? does the length of a vector/matrix need to be > >>>> represented by an int? > >>>> > >>>> Thanks a lot and best regards, > >>>> Alessandro > >>>> > >>> > >> > >> > >> > >> -- > >> Alessandro Mammana, PhD Student > >> Max Planck Institute for Molecular Genetics > >> Ihnestraße 63-73 > >> D-14195 Berlin, Germany > > > > > > > > -- > > Alessandro Mammana, PhD Student > > Max Planck Institute for Molecular Genetics > > Ihnestraße 63-73 > > D-14195 Berlin, Germany > > > > -- > Alessandro Mammana, PhD Student > Max Planck Institute for Molecular Genetics > Ihnestraße 63-73 > D-14195 Berlin, Germany > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- Qiang Kou q...@umail.iu.edu School of Informatics and Computing, Indiana University ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] Overflow error when creating a large matrix

2015-11-01 Thread Qiang Kou
On Sat, Oct 31, 2015 at 3:08 PM, Alessandro Mammana wrote: > Dear All, > When creating a large matrix with the follwing code: > > #include > // [[Rcpp::export]] > Rcpp::IntegerMatrix makeMat(int nrow, int ncol){ > Rcpp::IntegerMatrix mat(nrow, ncol); > return mat; > } > > I get t

Re: [Rcpp-devel] RcppEigen UmfPack?

2015-10-30 Thread Qiang Kou
Hall Room 102 > Charlottesville, VA 22904 > http://people.virginia.edu/~jnp3bc > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel >

Re: [Rcpp-devel] Optimization flag may be needed in Makevars.win for 4.9.2 toolchain

2015-08-25 Thread Qiang Kou
our > packages. > > Dirk > > -- > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman

Re: [Rcpp-devel] undefined symbol: _ZTVN10__cxxabiv120__si_class_type_infoE (on Ubuntu but not on Mac OS X)

2015-07-07 Thread Qiang Kou
K to mix C++ and f77. More people can give more help if you are willing to share the source. Best wishes, KK > > > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project

Re: [Rcpp-devel] error: wrap is not a template function

2015-05-21 Thread Qiang Kou
project, > where I omit the GSL (and RcppGSL) dependency (I could attach it but I > don't know if it is allowed). > > Sorry if this question might sound silly (and it does to me), but is there > any known issue or incompatibility with RcppGSL and wrap/as? > > > Thanks, >

Re: [Rcpp-devel] examples of using cula matrix multiplication in Rcpp

2015-05-18 Thread Qiang Kou
.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Qiang Kou q...@umail.iu.edu School of Informatics and Computing, Indiana University ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.o

Re: [Rcpp-devel] RcppParallel on Solaris

2015-04-02 Thread Qiang Kou
As far as I know it is possible to run OpenSolaris. Let me check. On 2 April 2015 at 16:31, Romain Francois wrote: | Would be useful to have a solaris machine on aws or whatever with R all these toils installed. | | I once had a virtual machine set up thanks to martyn but the user experience of v

Re: [Rcpp-devel] Linking to c++ files in a package without Rcpp overhead for faster computation

2015-03-06 Thread Qiang Kou
gt; > #include > > // [[Rcpp::depends(RcppArmadillo)]] > // [[Rcpp::interfaces(cpp)]] > > using namespace Rcpp; > > //[[Rcpp::export]] > List rcpp_hello_world() { > > CharacterVector x = CharacterVector::create( "foo", "bar" ) ; >

Re: [Rcpp-devel] Integrals with Rcpp

2015-01-09 Thread Qiang Kou
t; | Rcpp-devel mailing list > | Rcpp-devel@lists.r-forge.r-project.org > | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > > -- > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org > ___________ > Rcpp-devel mailing

Re: [Rcpp-devel] Possible error in setequal ??

2015-01-02 Thread Qiang Kou
)) [1] FALSE > seteq1(c("a","b"), c("a","b","k")) [1] FALSE > seteq1(c("a","b"), c("a","b","b")) [1] TRUE [1] https://github.com/RcppCore/Rcpp/blob/master/inst/include/Rcpp/sugar/functio

Re: [Rcpp-devel] Possible error in setequal ??

2015-01-02 Thread Qiang Kou
gt; > >> seteq1(c("a","b"), c("a","b")) > > [1] FALSE > > > >> seteq1(c(1,2,3), c(3,2)) > > [1] FALSE > > > >> seteq1(c("a","b"), c("a","b","k")) > > [1]

Re: [Rcpp-devel] Does uncaught c++ exception cause memory leak?

2014-12-29 Thread Qiang Kou
ors from 0 contexts (suppressed: 0 from 0) > edd@max:/tmp$ > > By overwriting d the memory is lost for good, and valgrind notices as you;d > think it would. > > Dirk > > -- > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org > __

Re: [Rcpp-devel] Rcpp catching a domain error

2014-12-12 Thread Qiang Kou
) > [1] FALSE > R> isItNan(3L) > [1] FALSE > R> > > There are (better) alternatives in the Rcpp sources, but some of the > behaviour is subtle. Kevin once wrote a great answer at StackOverflow: > > > http://stackoverflow.com/

Re: [Rcpp-devel] Rcpp catching a domain error

2014-12-11 Thread Qiang Kou
t; | > | Thanks > | > | Devin > | > | > | > | > | ___ > | Rcpp-devel mailing list > | Rcpp-devel@lists.r-forge.r-project.org > | > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > | > | >

Re: [Rcpp-devel] Rcpp catching a domain error

2014-12-11 Thread Qiang Kou
> > *std::cout << "Domain Error occurred!" << std::endl;* > > *}* > > *return 0;* > > *} * > > > > This seems to be wrong, since it still causes an abortion error in RStudio. > > > > I appreciate any input

Re: [Rcpp-devel] Rcpp Parallel and Rcpp Armadillo

2014-12-09 Thread Qiang Kou
- > ### Main R code > > rm(list=ls(all=TRUE)) > > library(Rcpp) > library(RcppGSL) > library(RcppParallel) > library(RcppArmadillo) > setwd('U:/testParallel') > > sourceCpp("test.cpp") > > asd = matrix(runif(1000), ncol = 100) > contr

Re: [Rcpp-devel] Rcpp API Reference

2014-09-04 Thread Qiang Kou
gt;> Purdue University >> >> ___ >> Rcpp-devel mailing list >> Rcpp-devel@lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel >> > > > > -- > http://w

Re: [Rcpp-devel] Rf_integrate?

2014-07-30 Thread Qiang Kou
headers, > but my head is too small for this yet. > > Any ideas that could help me? > > Dave Silkworth > > > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/c

[Rcpp-devel] New package: RcppMLPACK, integration with MLPACK using Rcpp

2014-07-24 Thread Qiang Kou
ns (0.028s) is 33-time faster than kmeans in R (0.947s). However, we should note that R returns more information than the clustering result and there are much more checking functions in R. There is an important problem in MLPACK: it uses *size_t* type heavily. There will be problems in wrapping

Re: [Rcpp-devel] Rcpp C++ code debug / Calling Rcpp in a C++ environment

2014-07-11 Thread Qiang Kou
em calling the package in RStudio. > > Thanks! > Jing > > > > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- Qiang Kou q

Re: [Rcpp-devel] RcppMLPACK ?

2014-06-11 Thread Qiang Kou
Understood! I will contact Ryan and modify the package in the weekend. Best, KK On Wed, Jun 11, 2014 at 9:28 AM, Dirk Eddelbuettel wrote: > > On 11 June 2014 at 08:50, Qiang Kou wrote: > | Thanks for the opinions! > > As they say, "talk is cheap" so I dispense it fr

Re: [Rcpp-devel] RcppMLPACK ?

2014-06-11 Thread Qiang Kou
Thanks for the opinions! On Wed, Jun 11, 2014 at 7:38 AM, Dirk Eddelbuettel wrote: > And smart how you just added the little bit from Boost > we don't have in BH (program_options). > As far as I know all parts in BH package are headers-only, and "program_options" is required by MLPACK to handle

Re: [Rcpp-devel] RcppMLPACK ?

2014-06-10 Thread Qiang Kou
Armadillo, there is not much work as I have seen. Please send pull request If interested in contributing code or testing. Best, KK [1] https://github.com/thirdwing/RcppMLPACK.git On Sun, Apr 6, 2014 at 1:08 AM, Dirk Eddelbuettel wrote: > > James, Qiang, > > On 5 April 2014 at 23:3

Re: [Rcpp-devel] Converting std::cout to Rcpp::Rcout automatically

2014-05-25 Thread Qiang Kou
he > library > > Does anyone have any idea how can I do that automatically? > > Thank you! > > Best, > > KK > > -- > Qiang Kou > q...@umail.iu.edu > School of Informatics and Computing, Indiana University > > ___ >

[Rcpp-devel] Converting std::cout to Rcpp::Rcout automatically

2014-05-23 Thread Qiang Kou
you! Best, KK -- Qiang Kou q...@umail.iu.edu School of Informatics and Computing, Indiana University ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] RcppMLPACK ?

2014-04-06 Thread Qiang Kou
I will contact them to listen their opinions and try to figure out the bigger picture. Best, KK On Sun, Apr 6, 2014 at 1:08 AM, Dirk Eddelbuettel wrote: > > James, Qiang, > > On 5 April 2014 at 23:33, Qiang Kou wrote: > | Hi, I think we can try to start this in the summer, si

Re: [Rcpp-devel] RcppMLPACK ?

2014-04-05 Thread Qiang Kou
l mailing list >> Rcpp-devel@lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel >> > > > > -- > James Li *|* Ph.D. Candidate *|* http://jamesyili.com/ > Dept. of Statistical Science *|* Cornell University >