Re: [Rcpp-devel] Rf_integrate?

2014-07-30 Thread Silkworth,David J.
The code from Yixuan is exactly what I dreamed might be found. This will suit my needs perfectly. Thank you. ___ 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

[Rcpp-devel] Rf_integrate?

2014-07-30 Thread Silkworth,David J.
I have a current project desire to move something like R's integrate function inside a loop in Rcpp code. The performance hit to call back to R seems to kill the advantage of Rcpp in the first place. Actually my integrand is t*pdf(t), very similar indeed to pweibull which integrates pdf(t). I

[Rcpp-devel] Can't build RcppArmadillo dependent packages on R-forge

2013-08-23 Thread Silkworth,David J.
It has been over a month now that I can't build my dependent packages. There seems to be a header issue with RcppArmadillo 0.3.910.0.1 Since R-forge doesn't revert back to stable version after a commit, all of my build attempts fail with the same header fault. There apparently is an untermin

[Rcpp-devel] failed RcppArmadillo build on R-forge

2013-07-18 Thread Silkworth,David J.
I have been at frustrated by failed builds on my package on R-forge. It seems that the problem is a failed build of RcppArmadillo itself on 13 July. The culprit seems to be an unterminated #ifndef in Module_generated_CppFunction.h:22:0 I don't know why but the R-forge folks let the offending

[Rcpp-devel] RCOM

2013-06-18 Thread Silkworth,David J.
In reply to initial issue by Umesh Chitre regarding roll of RCOM. I use RCOM to connect my R gui to Excel on Windows for development purposes (I know this makes Dirk laugh). Trying to compile C++ using other than gcc would not work, so there would be no point in attempting to code in MSVC++ for

Re: [Rcpp-devel] Broken wrapper code using .Call in R 3.0

2013-05-14 Thread Silkworth,David J.
Oh, I found it. Not a version issue. Seems I had reorganized some Rcpp functions into a single .cpp file and had not let SVN know it was an ADD. Happened early in the 2 week delay (due to version change no doubt) for "nightly" build and I had forgotten about it. Since it was an SVN problem m

[Rcpp-devel] Broken wrapper code using .Call in R 3.0

2013-05-14 Thread Silkworth,David J.
I am having trouble with broken builds on R-forge with code that never changed since previous builds, (I even had a successful previous build with R-3.0.1!!) The error does not appear until example code in the man pages is run for functions including .Call() for my RcppArmadillo code. The Error

[Rcpp-devel] Working with arma::cube

2013-03-05 Thread Silkworth,David J.
I am helping a student build some R code in Rcpp for his first time. He is working with 3-dimensional arrays, so I am hopeful to be working with arma::cube objects. When I simply try to bring the array in as an argument I can't seem to use the same as<[TEMPLATE]> construction as other objects.

[Rcpp-devel] Rcpp advocacy question -- build environment

2012-11-27 Thread Silkworth,David J.
I have been attempting to collect enough material together to create a wiki book of sorts for the Windows user that is likely new to C++ as well. I would be pleased to receive progress notes/problems off-list as you venture here. Rtools is pretty good, but there are things happening that are qu

[Rcpp-devel] Memory Leak found and resolved

2012-08-26 Thread Silkworth,David J.
About a week ago I mentioned a problem I was having maintaining a package, which seemed to require inline compiling for use. I never wanted to use cxxfunplus, and never explored this. It turns out I created a mysterious memory leak, that just happened to be resolved when code was prepared inli

Re: [Rcpp-devel] cxxfunplus

2012-08-21 Thread Silkworth,David J.
It is curious that just last night I gave up on a package development of some two months to regard a work-around requiring inline compilation for production activity. I had then just discovered that the compiled objects returned NULL pointers when I tried to save the environment. Now, I really

Re: [Rcpp-devel] Accessing an attribute object in C/C++

2012-07-12 Thread Silkworth,David J.
> Why the attachment at all _to pass a variable_ ? > > Dirk I tried to explain in first post. I receive such an object with this attachment as a return object from some ripped code written years ago in C. My example only passed in such an attached variable so that I could demonstrate my situ

Re: [Rcpp-devel] Accessing an attribute object in C/C++

2012-07-12 Thread Silkworth,David J.
Sweet! Here is my sample now: src<- ' Rcpp::NumericMatrix m_rcpp(arg1); arma::mat m_arma = Rcpp::as(arg1); Rcpp::NumericVector v_rcpp(m_rcpp.attr("attachment")); arma::vec v_arma = Rcpp::as(v_rcpp); return(Rcpp::List::create(Rcpp::Named("origMatrix")=wrap(m_arma), Rcpp::Named("ori

[Rcpp-devel] Accessing an attribute object in C/C++

2012-07-11 Thread Silkworth,David J.
I have built the following example in order to demonstrate my concern. In reality I am obtaining an object such as the example mymat with an attached vector as an attribute from Douglas Bates' 1998 C code for spline_basis in the splines package. It seems that back in the days of stone knives a

Re: [Rcpp-devel] Configuring GSL headers for inline

2012-07-06 Thread Silkworth,David J.
>> | Unfortunately, I still don't know how to direct gcc to these header files >> while using inline. > The Rcpp-FAQ vignette has a worked example on how to specify a plugin which > should apply to this case, see question 3.6 (or possibly 3.7 if you need just > a single setting). > > Dirk > > -

[Rcpp-devel] Configuring GSL headers for inline

2012-07-06 Thread Silkworth,David J.
After the glow of success with configuring GSL headers and libraries for compilation in Windows, I have run into a problem duplicating this success using inline for compiling. I have attempted the inline example directly from the RcppGSL Vignette. It is clear that the includes are not being ac

Re: [Rcpp-devel] Configuring GSL headers and library for RcppGSL use on windows

2012-07-05 Thread Silkworth,David J.
Success is always a good feeling. I have had Rtools installed for building packages for some time now. So, this should be considered a pre-requisite. The resources I used long ago for this were this site: http://www.biostat.wisc.edu/~kbroman/Rintro/Rwinpack.html and the wonderful RcppPackage pa

Re: [Rcpp-devel] Configuring GSL headers and library for RcppGSL use on windows

2012-07-05 Thread Silkworth,David J.
able to load shared object 'C:/RcppPack/RcppGSLExample.Rcheck/RcppGSLExample/libs/i386/RcppGSLExample.dll': LoadLibrary failure: The specified module could not be found. -Original Message- From: Dirk Eddelbuettel [mailto:e...@debian.org] Sent: Thursday, July 05, 2012 3:59 PM To:

[Rcpp-devel] Configuring GSL headers and library for RcppGSL use on windows

2012-07-05 Thread Silkworth,David J.
I can't believe I am the first to say this, but all searches related have come up pretty dry. I have installed the GSL setup file " Complete package, except sources Setup 6476814 11 July 2006" from http://gnuwin32.sourceforge.net/packages/gsl.htm Rather than the default installation l

[Rcpp-devel] Ripping C source from R

2012-07-01 Thread Silkworth,David J.
I am attempting to take a copy of the entire splines.c file and use this for compilation into a new project (so I can call spline_basis() directly, but preserve the identity and integrity of the original work. When I tried to pack this code into the include for the inline cxxfunction call I end

Re: [Rcpp-devel] replacing a splines ns() call with other Rcpp attached library function

2012-06-29 Thread Silkworth,David J.
With respect to replies: > a) fit a decent, modern, documented C++ implementation of what is needed Yes, this was the question. Can anyone help? I am failing right here. > and of course if a) fails, one can always 'rip out' what is underneath a > known R function and use that as a fallback. T

[Rcpp-devel] replacing a splines ns() call with other Rcpp attached library function

2012-06-28 Thread Silkworth,David J.
Folks, I am bravely helping Gianluca Bonitta (a.k.a. bbo...@tin.it) develop an Rcpp solution for his thesis, he already has a functioning R prototype. He has been using ns() from the splines library (thank-you Doug Bates!), and we are interested in identifying an alternati

Re: [Rcpp-devel] Call R function (bbo...@tin.it)

2012-06-20 Thread Silkworth,David J.
I am not going to ask why to do this, but here is a way how. I added your R function into the mypackage skeleton from RcppPackage R_user_F<-function (par) { y<-par[1] x<-par[2] return(dnorm(x)*dnorm(y)) } I prefer to use the explicit return function for clarity. Now I install the package after

[Rcpp-devel] Irregular crash with rcpp and inline

2012-04-15 Thread Silkworth,David J.
While I really appreciated this exchange as informative in tutorial sense, I am still trying to figure out the cause of Marie's seg-fault. Holding Dirk's first fix up to the light with Marie's code all I really see is removal of the #include directive (which I assume, without looking, i

Re: [Rcpp-devel] rcpp as a compiler to create stand-alone applications

2012-02-06 Thread Silkworth,David J.
I will defer to others for the technical response, but as for the practical: What's the problem with R deployment in corporations? A 300 to 500 meg installation that enables an entire development environment seems like valuable "overhead" to me. The most likely reason to avoid this deployment

Re: [Rcpp-devel] One main needs to call a few other functions

2011-10-20 Thread Silkworth,David J.
>> I have need for a few c++ functions. (One main needs to call a few other functions.) At this point, I don't need separate classes, just the ability to have multiple functions. (Coding up several separate R functions using Inline would be ineffecient as the data would need to pass between R and

Re: [Rcpp-devel] Success with integrating external C++ Code

2011-10-12 Thread Silkworth,David J.
...@gmail.com] Sent: Wednesday, October 12, 2011 1:20 PM To: Silkworth,David J. Cc: Steve Lianoglou; rcpp-de...@r-forge.wu-wien.ac.at Subject: Re: [Rcpp-devel] Success with integrating external C++ Code if you want it to be inline, then simply copy the contents of the .hpp and .cpp files into your R

Re: [Rcpp-devel] Success with integrating external C++ Code

2011-10-12 Thread Silkworth,David J.
I see, but this is not truly an inline example is it? https://github.com/armstrtw/CppBugs/tree/master/test/r.inline.example Does that elucidate the things that need elucidating for you? -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology  | Memorial Sloan-Kettering Cance

[Rcpp-devel] Success with integrating external C++ Code

2011-10-12 Thread Silkworth,David J.
I have been observing Simon Fuller's exploration here with interest, but not so fully that I could replicate what he is now capable of doing. I wonder if someone could build a small test case that would show how this works, since I think this would be of interest to many. _

Re: [Rcpp-devel] Push back to a matrix (Noah Silverman)

2011-09-05 Thread Silkworth,David J.
Looking at your pseudo code it appears that you know how many columns are required in your matrix before run time. This situation lends itself well to generating the columns of your matrix as vectors as these can be manipulated with STL. Combining these vectors to a dataframe for return is very

Re: [Rcpp-devel] repeatable random numbers

2011-09-01 Thread Silkworth,David J.
RNGScope() mearly saves the state of the RNG for the R environment, returning it upon class destruction at end of your (compiled) Rcpp function. You can pass a seed to your Rcpp function as an argument and, after preserving state with RNGScope(), you can set the seed within the Rcpp function for t

Re: [Rcpp-devel] A question in slides from Rcpp workshop

2011-08-05 Thread Silkworth,David J.
A fair question (although on R itself) and a reference to slides I am glad I have now seen. An even better reply by Dirk. ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp

Re: [Rcpp-devel] redimension success with arma

2011-07-02 Thread Silkworth,David J.
y windows system, but doubt I will have to get that far in the near future. -Original Message- From: icos.atr...@gmail.com [mailto:icos.atr...@gmail.com] On Behalf Of Christian Gunning Sent: Wednesday, June 08, 2011 4:55 AM To: rcpp-de...@r-forge.wu-wien.ac.at Cc: Silkworth,David J.; Dougl

Re: [Rcpp-devel] getting ncol(DF) in Rcpp

2011-06-27 Thread Silkworth,David J.
you can avoid an explicit loop in R, there is a chance that even the interpreted language can do you many favors. -Original Message- From: dmba...@gmail.com [mailto:dmba...@gmail.com] On Behalf Of Douglas Bates Sent: Monday, June 27, 2011 1:47 PM To: Silkworth,David J. Cc: rcpp-de...@r

[Rcpp-devel] getting ncol(DF) in Rcpp

2011-06-27 Thread Silkworth,David J.
You guys know I am here just to give you a chuckle. I wanted to build a function passing just a dataframe to Rcpp. In order to use this dataframe, I need to know how many columns it has at runtime. My attempts at getting this ncol information were thwarted on several counts. The Dimension cla

Re: [Rcpp-devel] Using Rcpp in C++

2011-06-11 Thread Silkworth,David J.
You obviously want to get stated. I have to assume that you use R, because you would not have found Rcpp any other way. Rcpp is a means of writing functions in C++ that R can call. So you don't expect to compile a stand-alone program with main(). The easiest way to experience Rcpp is using inline

Re: [Rcpp-devel] redimension help-my_chosen_solution

2011-06-08 Thread Silkworth,David J.
Thanks for all who got involved in my folly. I have chosen the following path for now. src <- ' int s = 7; // result of original oversize estimate before process runs int c=3; //known column count established from a list argument (variable to function) Rcpp::IntegerVector v(s); Rcpp::IntegerMat

Re: [Rcpp-devel] redimension help

2011-06-07 Thread Silkworth,David J.
I have not been slack on reviewing the archives, but they ARE hard to search. So far, I am led to believe that a list of vectors can only be accessed during initialization. This would seem to be a real problem for entering elements in looped increments 10's of thousands of times. The original mat

Re: [Rcpp-devel] redimension help

2011-06-07 Thread Silkworth,David J.
n vectors for( i=0; ir-1;e--)  { Lmv[i].erase(e); } // redimension the vector } I'm trying, but still stuck. -Original Message- From: Silkworth,David J. Sent: Tuesday, June 07, 2011 3:42 PM To: 'Douglas Bates' Subject: RE: [Rcpp-devel] redimension help My apologies,

[Rcpp-devel] redimension help

2011-06-07 Thread Silkworth,David J.
I want you guys to know that I appreciate all the effort that you put into the Rcpp package and this list. I am obviously one of the early people to hurdle the new "lowered bar" for C++ development in R. I have developed a function that builds a series of vectors and a matrix of undetermined size

Re: [Rcpp-devel] fun(Times) with STL

2011-06-04 Thread Silkworth,David J.
--Original Message- From: Dirk Eddelbuettel [mailto:e...@debian.org] Sent: Saturday, June 04, 2011 12:59 PM To: Douglas Bates Cc: Silkworth,David J.; rcpp-de...@r-forge.wu-wien.ac.at Subject: Re: [Rcpp-devel] fun(Times) with STL On 4 June 2011 at 11:37, Douglas Bates wrote: | Dirk

Re: [Rcpp-devel] fun(Times) with STL

2011-06-04 Thread Silkworth,David J.
Many thanks, Doug, I feel so-o-o close, but the revised example does not compile. I have taken the liberty to condense our discussion a little here. >>> double* myIterator = std::min_element (TimeQ.begin(), TimeQ.end()); >> >> The usual idiom is >> >> double TQmin = *std::min_element(TimeQ.begin

[Rcpp-devel] fun(Times) with STL

2011-06-04 Thread Silkworth,David J.
I ran into this yesterday as I needed to get the position of the least time value in a small Que of times that I had extracted from a more complex structure. I ended up with this problem during a separate work-around, which is a story I'd love to tell also. But, to the point. I explored using S

[Rcpp-devel] Problems wit rlnorm

2011-05-29 Thread Silkworth,David J.
I've made a lot of progress working through some simple issues, but this one effects the cornerstone of my project. Below is some sample code that shows my efforts. I can set the seed programmatically with any integer variable in the place of the 20 in "seed"=20 using the environment method. The