My C++ coding style (such as it is) has been influenced by reading
Frank Bokken's "C++ Annotations". I keep most data members of classes
private or protected and usually with names like d_x, d_y, d_weights,
etc. then provide accessor functions named x, y, weights, etc.
Generally the accessors retu
Thanks again Romain. Now that you mention it I remember.
On Thu, Nov 18, 2010 at 3:41 PM, Romain Francois
wrote:
> Le 18/11/10 22:31, Douglas Bates a écrit :
>>
>> My C++ coding style (such as it is) has been influenced by reading
>> Frank Bokken's "C++ Annotati
I believe it is now recommended that a class to be exposed in a module
should expose a default constructor (i.e. a constructor called with no
arguments). Is such a constructor actually called or is it just there
to establish the necessary linkage? In a class where it would not
make sense to const
Thanks to you and to Andrew for the responses. I will put the module
declaration in a separate .cpp file.
On Tue, Nov 16, 2010 at 2:50 AM, Romain Francois
wrote:
> Le 16/11/10 03:50, Douglas Bates a écrit :
>>
>> Is there any guidance on where to put RCPP_MODULE declaration
On Tue, Nov 16, 2010 at 4:31 AM, Rainer M Krug wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi
>
> I am new to C, and my question might be basic, but I am struggling with it:
>
> I have about 10 lines of code in a simulation, which take up about 50%
> of the whole simulation, As th
That's fine with me. Sorry for the slow response. I'm down with a
cold or the flu today.
On Sun, Nov 21, 2010 at 1:52 PM, Romain Francois
wrote:
> Le 21/11/10 20:42, Andrew Redd a écrit :
>>
>> The init_2 is unnatural. I would prefer the new syntax. As I have to
>> code that is relying in the
I have seen a couple of ways of creating an instance of a C++ class
exported in a module
mod <- Module("myMod", "myPackage")
cls <- mod$myClass
inst <- cls$new(constructorArgs)
and
inst <- new(mod$myClass, constructorArgs)
Is one of these the preferred way?
_
set_data_path
6: module$set_data_path
7: fun(...)
8: doTryCatch(return(expr), name, parentenv, handler)
...
>
> Romain
>
>
>
> Le 30 nov. 2010 à 05:21 PM, Douglas Bates a écrit :
>
>> I have seen a couple of ways of creating an instance of a C++ class
>> expo
Against my better judgement I will try to correct a misconception. I
fear that my message will only fan the flames but I also think that
if we are to be subjected to long, drawn out, personal attacks on this
subject then the readers of this list are entitled to facts instead of
speculation.
On W
In the lme4a package I mixed calls to Rf_error and throwing C++
exceptions. This is causing problems and I plan to replace the calls
to Rf_error by exceptions so that there is a consistent approach.
Many of the calls to Rf_error take advantage of the fact the Rf_error
implicitly calls sprintf to
I currently use constructions like
if (as(lst.attr("class")) != "family")
throw std::runtime_error("glmFamily requires a list of (S3) class
\"family\"");
Is there a cleaner way that I haven't discovered yet.
This method is error-prone because the S3 class of an object is a
Ch
On Fri, Dec 3, 2010 at 11:00 PM, Christian Gunning wrote:
>> | The first three look correct to me:
>> | i) assign 3, 4, 5
>> | ii) copy row 0 as 1
>> | iii) copy col 3 to 4
>> |
>> | but I am also a little puzzled by the last submatrix.
>> |
>> | I'm sure Romain will weigh in in a few hours.
>
Thanks very much, Romain.
On Sat, Dec 4, 2010 at 8:13 AM, Romain Francois
wrote:
> Le 02/12/10 22:15, Douglas Bates a écrit :
>>
>> In the lme4a package I mixed calls to Rf_error and throwing C++
>> exceptions. This is causing problems and I plan to replace the ca
I'm again trying to define instances of the wrap template for C++
classes that have data members defined in Rcpp.h
A stand-alone example, which is rather lengthy, is enclosed. In this
example I am unsuccessful in using the "intrusive" formulation
described in the "Extending Rcpp" vignette. I wil
On looking more closely I can't use cxxfunction with plugin="Rcpp" to
test this because the plugin inserts
#include
before the user includes and some parts in the user includes need to
be declared before Rcpp.h is included. I'll create a small package.
On Tue, Dec 7, 2010
nction( .., settings = settings )
>
> I'm looking at the rest of the first email now.
>
> Romain
>
> Le 07/12/10 17:32, Douglas Bates a écrit :
>>
>> On looking more closely I can't use cxxfunction with plugin="Rcpp" to
>> test this because the
On Wed, Dec 8, 2010 at 3:02 PM, Dirk Eddelbuettel wrote:
>
> On 8 December 2010 at 13:41, Andrew Redd wrote:
> | I have an MCMC chain that runs entirely in c++ with Rcpp. It sometimes runs
> | for a vary long time and I want to interrupt it. Is there an efficient easy
> | way to include catching
On Sat, Dec 4, 2010 at 8:13 AM, Romain Francois
wrote:
> Le 02/12/10 22:15, Douglas Bates a écrit :
>>
>> In the lme4a package I mixed calls to Rf_error and throwing C++
>> exceptions. This is causing problems and I plan to replace the calls
>> to Rf_error by ex
On Thu, Dec 16, 2010 at 5:18 PM, Savitsky, Terrance wrote:
> I note that employing the namespace declaration - using namespace arma; -
> allows one to use the declaration of a new armadillo matrix under an
> RcppArmadillo header with – mat X(Xr.begin() …. – instead of – arma::mat
> X(Xr.begin() …
I have been using external pointers through the Rcpp::Xptr class and
have encountered memory problems that I think are related to the way I
construct instances of this class. I have looked at
Rcpp/inst/unitTests/runit.XPtr.R and at Rcpp/inst/include/XPtr.h
(although I haven't read the latter caref
On Tue, Dec 21, 2010 at 11:21 AM, Gabor Grothendieck
wrote:
> I tried copying the example in the intro vignette
> http://dirk.eddelbuettel.com/code/rcpp/Rcpp-introduction.pdf
> and get the following error. What's wrong?
Hmm. The externally-callable function is being declared twice,
perhaps due
On Wed, Dec 22, 2010 at 5:33 AM, wrote:
> Hello,
>
> Following Gabor's thread yesterday, I looked into R source code and figure
> that we don't need to test for NA when using numeric vector. See this:
>
> require(inline)
> require(Rcpp)
>
> pl <- cxxfunction( , '
> return List::create(
>
On Wed, Dec 22, 2010 at 12:08 PM, Cedric Ginestet
wrote:
> Dear Rcpp Experts,
>
> I have encountered two issues when modifying an object within C++ function.
> See the code below:
>
> ##
> library(inline); library(Rcpp)
> D <- matrix(rnorm(4),2,2)
> src3 <-
ricMatrix xD(clone(D));
> xD(0,0) = 100.0;
> return xD;
> '
> passRef <- cxxfunction(signature(D="matrix"),body=src3,plugin="Rcpp")
> passRef(D); D
> ##
>
>
>
> On 22/12/10 18:32, Douglas Bates wro
On Mon, Dec 27, 2010 at 6:57 AM, Richard Chandler
wrote:
> Hi,
>
> I am trying to speed up a vectorized R function without much luck. Perhaps
> it is not possible, but if it is could someone suggest how to improve the
> C++/Rcpp code below? The speed is approximately equal on a 64-bit version of
>
My apologies, I accidentally hit send on an incomplete message.
On Mon, Dec 27, 2010 at 8:34 AM, Douglas Bates wrote:
> On Mon, Dec 27, 2010 at 6:57 AM, Richard Chandler
> wrote:
>> Hi,
>>
>> I am trying to speed up a vectorized R function without much luck. Perhaps
&g
You forgot to initialize i in both loops. It should be
for(int i = 0; i < Ne; i++)
On Mon, Jan 3, 2011 at 9:50 AM, Cedric Ginestet
wrote:
> Dear Rcpp experts,
>
> I have the following bizarre problem. Although the second summing C++
> function seems easier than the former, it does not produce t
On Tue, Jan 4, 2011 at 11:13 AM, Romain Francois
wrote:
> Le 04/01/11 17:42, Romain Francois a écrit :
>>
>> Le 04/01/11 16:35, Andrew Redd a écrit :
>>>
>>> Cedric,
>>> This was addressed about 2 weeks ago on the list, please read the
>>> archives. Basic point, Rcpp/sugar will not be faster than
On Tue, Jan 4, 2011 at 12:04 PM, Douglas Bates wrote:
> On Tue, Jan 4, 2011 at 11:13 AM, Romain Francois
> wrote:
>> Le 04/01/11 17:42, Romain Francois a écrit :
>>>
>>> Le 04/01/11 16:35, Andrew Redd a écrit :
>>>>
>>>> Cedric,
>>>
rcpp-devel readers will be coming in to the middle of a conversation
but it's all there if you want to catch up.
On Tue, Jan 4, 2011 at 11:47 AM, Dirk Eddelbuettel wrote:
>
> Hi Ben,
>
> On 4 January 2011 at 12:24, Ben Bolker wrote:
> | -BEGIN PGP SIGNED MESSAGE-
> | Hash: SHA1
> |
> |
I don't know whether this is through error on my part or because of an
"infelicity" in the Rcpp module code but the lme4a package, which now
uses Rcpp modules extensively, ends up with some difficult-to-trace
memory corruption issues. Yesterday i finally bit the bullet and ran
a test with gctortur
This time with the enclosure :-)
On Wed, Jan 5, 2011 at 11:52 AM, Douglas Bates wrote:
> I don't know whether this is through error on my part or because of an
> "infelicity" in the Rcpp module code but the lme4a package, which now
> uses Rcpp modules extensively, ends u
from my point of view) that test didn't
show any problems. I'm at a bit of a loss where to go on this.
On Wed, Jan 5, 2011 at 11:55 AM, Douglas Bates wrote:
> This time with the enclosure :-)
>
> On Wed, Jan 5, 2011 at 11:52 AM, Douglas Bates wrote:
>> I don't know wh
On Wed, Jan 5, 2011 at 2:15 PM, Douglas Bates wrote:
> On looking more closely at the output, I thought that the problem may
> arise in loading the Rcpp package because that is when the function
> init_Rcpp_cache() is evaluated. So I ran another test which was
> simply
>
&
On Wed, Jan 5, 2011 at 2:38 PM, Douglas Bates wrote:
> On Wed, Jan 5, 2011 at 2:15 PM, Douglas Bates wrote:
>> On looking more closely at the output, I thought that the problem may
>> arise in loading the Rcpp package because that is when the function
>> init_Rcpp_cache() is
On Thu, Jan 6, 2011 at 9:54 AM, Douglas Bates wrote:
> On Wed, Jan 5, 2011 at 2:38 PM, Douglas Bates wrote:
>> On Wed, Jan 5, 2011 at 2:15 PM, Douglas Bates wrote:
>>> On looking more closely at the output, I thought that the problem may
>>> arise in loading the R
On Thu, Jan 6, 2011 at 12:57 PM, Steve Moffitt wrote:
> My mail server didn't like the attached installation script - I've resent it
> with the script header removed.
>
> From: rcpp-devel-boun...@lists.r-forge.r-project.org
> [rcpp-devel-boun...@lists.r-f
In the continuing saga ...
On Thu, Jan 6, 2011 at 12:57 PM, Douglas Bates wrote:
> On Thu, Jan 6, 2011 at 9:54 AM, Douglas Bates wrote:
>> On Wed, Jan 5, 2011 at 2:38 PM, Douglas Bates wrote:
>>> On Wed, Jan 5, 2011 at 2:15 PM, Douglas Bates wrote:
>>>> On look
On Thu, Jan 6, 2011 at 2:19 PM, Douglas Bates wrote:
> In the continuing saga ...
>
> On Thu, Jan 6, 2011 at 12:57 PM, Douglas Bates wrote:
>> On Thu, Jan 6, 2011 at 9:54 AM, Douglas Bates wrote:
>>> On Wed, Jan 5, 2011 at 2:38 PM, Douglas Bates wrote:
>>>
On Thu, Jan 6, 2011 at 2:37 PM, Douglas Bates wrote:
> On Thu, Jan 6, 2011 at 2:19 PM, Douglas Bates wrote:
>> In the continuing saga ...
>>
>> On Thu, Jan 6, 2011 at 12:57 PM, Douglas Bates wrote:
>>> On Thu, Jan 6, 2011 at 9:54 AM, Douglas Bates wrote:
>&
I finally managed to get an example from the Rcpp documentation to fail for me.
Rcpp_module_class_error.R
Description: Binary data
Rcpp_module_class_error.Rout
Description: Binary data
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
On Fri, Jan 7, 2011 at 5:34 AM, Romain Francois
wrote:
> Le 05/01/11 18:52, Douglas Bates a écrit :
>>
>> I don't know whether this is through error on my part or because of an
>> "infelicity" in the Rcpp module code but the lme4a package, which now
>> u
e this today as I need a working
version of lme4a by tomorrow.
> On Fri, Jan 7, 2011 at 9:47 AM, Romain Francois
> wrote:
>>
>> Hmm. I commited 2845 and 2846 today.
>>
>> Anyway, if you see it also with 0.9.0 this means more detective work.
>>
>> Le 07/01/11 15:
On Sat, Jan 8, 2011 at 7:49 AM, Douglas Bates wrote:
> On Sat, Jan 8, 2011 at 12:45 AM, Dominick Samperi wrote:
>> I checked things under Linux and Windows (using GCC and VC++ DLL's) and the
>> same problem occurs at the same place, which is a good sign when it comes
On Sat, Jan 8, 2011 at 12:57 PM, Dominick Samperi wrote:
>
>
> On Sat, Jan 8, 2011 at 9:48 AM, Douglas Bates wrote:
>>
>> On Sat, Jan 8, 2011 at 7:49 AM, Douglas Bates wrote:
>> > On Sat, Jan 8, 2011 at 12:45 AM, Dominick Samperi
>> > wrote:
>>
d
appreciate your efforts in helping to debug this.
I am trying a slightly different approach for the installation of the
error indicator and codes from rcpp_tryCatch.
> On Sat, Jan 8, 2011 at 2:06 PM, Douglas Bates wrote:
>>
>> On Sat, Jan 8, 2011 at 12:57 PM, Dominick Samperi
&g
On Sun, Jan 9, 2011 at 12:07 PM, Dirk Eddelbuettel wrote:
>
> On 9 January 2011 at 12:12, Dominick Samperi wrote:
> | Actually, the problem seems to be pretty transparent, and the
> | solution is the same (see below). This gets you through Evaluator,
> | but you fail in SlotProxy in the call to "$
On Sun, Jan 9, 2011 at 12:21 PM, Dominick Samperi wrote:
>
>
> On Sun, Jan 9, 2011 at 1:07 PM, Dirk Eddelbuettel wrote:
>>
>> On 9 January 2011 at 12:12, Dominick Samperi wrote:
>> | Actually, the problem seems to be pretty transparent, and the
>> | solution is the same (see below). This gets you
On Tue, Jan 11, 2011 at 12:27 PM, Dominick Samperi wrote:
>
>
> On Tue, Jan 11, 2011 at 1:20 PM, Romain Francois
> wrote:
>>
>> Le 11/01/11 19:12, Davor Cubranic a écrit :
>>>
>>> I think an important point from Doug has been lost in the subsequent
>>> 20-odd messages of flamebombing:
>>>
> I
For the time being I would suggest using the released version of Rcpp
instead of the latest package from R-forge. That is, install from a
CRAN mirror site and not the R-forge site. There are some issues with
the version currently in SVN.
On Fri, Jan 14, 2011 at 10:45 AM, amao oluwole wrote:
> H
On Tue, Jan 18, 2011 at 6:19 PM, Dirk Eddelbuettel wrote:
>
> On 18 January 2011 at 15:52, Christian Gunning wrote:
> | On Tue, Jan 18, 2011 at 2:46 PM,
> | wrote:
> | >
> | > Can people share any tricks they use to debug Rcpp packages? For example,
> can I "print" variables in a format that's a
It is more effective to send such inquiries to the Rcpp-devel mailing
list which I am cc'ing on this reply.
On Thu, Jan 20, 2011 at 3:05 PM, mtck1982 wrote:
>
> Hi All,
>
> I am new to this area and use Rcpp to call C++ from R and try to build the
> package under Windows 7. I use Rtools and R 2.1
cs/gdb/Pretty-Printing.html.) Would people
>> be interested in having Rcpp-specific pretty printers?
>>
>> That would be great. I have read about this feature ever since gcb 7.0 was
>> announced but have never used. It probably would make a lot of sense here.
>>
>
As the Grateful Dead said, "What a long, strange trip it's been." I
have spent over a month trying to debug some code in the lme4a package
that uses Rcpp modules. Partly I was getting the wrong numerical
answer, which was due to a dumb cut-and-paste error on my part - now
fixed - but more importa
On Sun, Jan 30, 2011 at 3:47 PM, Douglas Bates wrote:
> As the Grateful Dead said, "What a long, strange trip it's been." I
> have spent over a month trying to debug some code in the lme4a package
> that uses Rcpp modules. Partly I was getting the wrong numerical
>
As Dirk and Romain know I have been struggling to debug a memory
protection problem that I encounter in code based on Rcpp Modules. As
with all memory protection problems, it is very difficult to track
down and I have kind-of run out of options right now.
I plan, for the time being, to use code t
I'm back to "it's not your night, kid". I seem to be unable to
install the RcppArmadillo package under Ubuntu 10.10 with R-2.12.1
installed from the packages on CRAN. The compilation goes fine but
the package can't be loaded because the symbol
arma::arma_version::major is undefined. It should ha
On Tue, Feb 8, 2011 at 1:55 PM, Dirk Eddelbuettel wrote:
> On 8 February 2011 at 13:42, Douglas Bates wrote:
> | I'm back to "it's not your night, kid". I seem to be unable to
> | install the RcppArmadillo package under Ubuntu 10.10 with R-2.12.1
> | installed
On Tue, Feb 8, 2011 at 2:54 PM, Dirk Eddelbuettel wrote:
>
> On 8 February 2011 at 14:39, Douglas Bates wrote:
> | On Tue, Feb 8, 2011 at 1:55 PM, Dirk Eddelbuettel wrote:
> |
> | > On 8 February 2011 at 13:42, Douglas Bates wrote:
> | > | I'm back to "it
On Tue, Feb 8, 2011 at 3:49 PM, Douglas Bates wrote:
> On Tue, Feb 8, 2011 at 2:54 PM, Dirk Eddelbuettel wrote:
>>
>> On 8 February 2011 at 14:39, Douglas Bates wrote:
>> | On Tue, Feb 8, 2011 at 1:55 PM, Dirk Eddelbuettel wrote:
>> |
>> | > On 8 Februar
On Mon, Feb 14, 2011 at 12:45 PM, Dirk Eddelbuettel wrote:
>
> The new Rcpp 0.9.1 release is now on CRAN. The NEWS entry is below; more
> details are in the ChangeLog. But in short, this is a mostly 'internal
> fixes' release which addresses some issues in memory management which, while
> not tr
On Wed, Feb 16, 2011 at 11:47 AM, wrote:
> Hi, I'm having some trouble wrapping a relatively simple C function using
> Rcpp and inline and friends. This is my first time trying to use these
> tools, so I'm sure I'm doing something wrong my immediate problem is
> that I can't seem to figure out
On Wed, Feb 16, 2011 at 2:03 PM, wrote:
> On 2/16/11 12:18 PM, "Douglas Bates" wrote:
>>The dgCMatrix object is of an S4 class. It's best to use the S4 class
>>from Rcpp so you can extract the slots as Rcpp::IntegerVector and
>>Rcpp::NumericVector objects.
On Fri, Feb 18, 2011 at 4:50 PM, wrote:
> On 2/16/11 3:55 PM, "Douglas Bates" wrote:
>>I decided that it would be simple enough to write a small package to
>>show exactly how you would pass a dgCMatrix to an Rcpp-based C++
>>function and create a smat object.
On Sat, Feb 19, 2011 at 12:56 AM, Rohit Pandey wrote:
> Hi Christopher/ Dirk,
> Thank you very much for your replys. I think the idea of using inline as you
> suggest is the best way to start off with using c++ with R. I went through
> your examples and also plenty I found on the net. I have been
On Tue, Feb 22, 2011 at 10:53 AM, wrote:
>
>
> On 2/19/11 9:20 AM, "Douglas Bates" wrote:
>
>>On Fri, Feb 18, 2011 at 4:50 PM, wrote:
>>
>>> Hi Doug, did you ever get a test case working for this?
>>
>>I didn't try further. I was
On Wed, Mar 9, 2011 at 9:14 AM, Dahir Alihassan wrote:
> Hi,
>
> I am posting here upon Dirk's suggestion, as I understand this is well
> attended to and I'd be grateful for any help. I am taking over a project
> which involves upgrading to the latest version of Rcpp and thus I have to
> upgrade a
On Tue, Mar 22, 2011 at 2:16 PM, Henry Bee wrote:
> Hi Christian,
> Thanks for the source file. Below are the full results as you requested.
> It's giving the same error as before. Is 64-bit R supported?
64-bit R is supported. Has it already been established that you have
the Rtools (compilers,
On Mon, Mar 28, 2011 at 1:31 PM, Sean Robert McGuffee
wrote:
> How hard is it to set up the list with a default reply to address of the
> list?
Making the change, not difficult. Convincing Dirk to make the change,
very difficult.
Google the phrase "Reply-to munging considered harmful".
>
>
> O
On Tue, Apr 12, 2011 at 1:11 AM, Romain Francois
wrote:
> Le 12/04/11 04:15, Christian Gunning a écrit :
>>
>> On Mon, Apr 11, 2011 at 3:00 AM,
>> wrote:
>>>
>>>
>>> This will load the declared modules, and populate them into your
>>> package's namespace.
>>>
>>> I will update the Rcpp-modules v
On Tue, Apr 12, 2011 at 11:11 AM, Giuseppe Milicia
wrote:
> Dirk,
>
> I steer away from the Solaris compiler, too many headaches there...
>
> I'm currently using gcc 4.4.3
>
> I tried rearranging the headers (in my code) but I got nowhere :( I suspect
> this is the case because sys/vnode.h is use
On Wed, Apr 13, 2011 at 6:50 AM, Cedric Ginestet
wrote:
> Brilliant, Dirk. Thanks for that.
> Next time, I'll read the Rcpp Sugar .pdf more carefully.
> Cheers,
Be aware that in both versions you will never return a vector
containing b, which might be confusing. That is, the argument b
should be
pe;
> return rnorm(10, 0, 100);
>
>
> Shall I use anything else?
> Cheers,
>
>
> On 13/04/11 13:59, Douglas Bates wrote:
>>
>> On Wed, Apr 13, 2011 at 6:50 AM, Cedric Ginestet
>> wrote:
>>>
>>> Brilliant, Dirk. Thanks for that.
>&g
On Thu, Apr 14, 2011 at 12:43 AM, Christian Gunning wrote:
> On Tue, Apr 12, 2011 at 11:07 PM, Romain Francois
> wrote:
>>>
>>> Just to clarify -- does your plan include storing user-modified
>>> fields and properties in objects? E.g. below, modtest with the msg
>>> set?
>>
>> yes. Although the
On Thu, Apr 14, 2011 at 10:00 AM, Cedric Ginestet
wrote:
> Hi all,
>
> I am trying to pass on a boolean vector from R to C++. I have naively tried
> the following:
>
>
> src <- '
> using namespace Rcpp ;
> using namespace std ;
> int b = as(xb);
> return wrap
My colleague Sunduz Keles once mentioned a similar problem to me. She
had a large sample from a reference distribution and a test sample
(both real-valued in her case) and she wanted, for each element of the
test sample, the proportion of the reference sample that was less than
the element. It's
mber that there is a findInterval function.
> From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf
> Of Douglas Bates [ba...@stat.wisc.edu]
> Sent: Thursday, April 14, 2011 6:22 PM
> To: William Dunlap
> Cc: r-h...@r-project.org; Sunduz Keles; rcpp-devel; Kevin
On Thu, Apr 14, 2011 at 11:47 PM, Christian Gunning wrote:
> On Thu, Apr 14, 2011 at 7:02 PM,
> wrote:
>
>> I was able to write a very short C++ function using the Rcpp package
>> that provided about a 1000-fold increase in speed relative to the best
>> I could do in R. I don't have the script o
ersus random access to the elements
of y.
On Fri, Apr 15, 2011 at 7:34 AM, Douglas Bates wrote:
> On Thu, Apr 14, 2011 at 11:47 PM, Christian Gunning wrote:
>> On Thu, Apr 14, 2011 at 7:02 PM,
>> wrote:
>>
>>> I was able to write a very short C++ function using the Rcp
Rcpp from SVN version 3004 is segfaulting on me in the unit tests at
test.sugar.asvector
Executing test function test.sugar.asvector ...
*** caught segfault ***
address 0x3, cause 'memory not mapped'
Traceback:
1: .Primitive(".Call")(, x, y, z)
2: fx(1:4, 1:5, diag(1:5))
3: func()
4: system
Sorry - I misspoke. The segfault was with R-2.13.0, the Ubuntu
maverick amd_64 build.
On Tue, Apr 19, 2011 at 12:55 PM, Douglas Bates wrote:
> Rcpp from SVN version 3004 is segfaulting on me in the unit tests at
> test.sugar.asvector
>
> Executing test function test.su
I have been facing this problem for months now and I still don't know
why other users of Ubuntu 10.10 using
$ g++ --version
g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warrant
cil point breaking.
On Thu, Apr 28, 2011 at 2:53 PM, Douglas Bates wrote:
> I have been facing this problem for months now and I still don't know
> why other users of Ubuntu 10.10 using
>
> $ g++ --version
> g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
> Copyright (C) 2010 Free
iddle of our Rcpp workshop so this is timely :)
>
> On 28 April 2011 at 14:53, Douglas Bates wrote:
> | I have been facing this problem for months now and I still don't know
> | why other users of Ubuntu 10.10 using
> |
> | $ g++ --version
> | g++ (Ubuntu/Linaro 4.4.4-1
On Thu, Apr 28, 2011 at 3:26 PM, Douglas Bates wrote:
> I just realized what is probably happening. I have the Ubuntu
> armadillo package installed and that version of the header files may
> be being picked up ahead of the version in the package.
Oops. Scratch that theory. I don
Yesterday I upgraded to Ubuntu 11.04 for which the default g++ version is 4.5.2
I rebuilt R-devel and R-patched from the sources and things changed --
R-devel CMD check Rcpp now fails at a different point. This time it
doesn't segfault but it does produce results that are different from
the refer
OK, this is bizarre. I am able to install the RcppArmadillo package
on my current setup provided that I turn on optimization in the call
to g++ to compile RcppArmadillo.cpp. The only difference between the
following two calls is the -O3 flag. (I haven't tried other levels of
optimization yet but
And I can get past R CMD check Rcpp if I include -O3 in CXXFLAGS.
On Fri, Apr 29, 2011 at 11:59 AM, Douglas Bates wrote:
> OK, this is bizarre. I am able to install the RcppArmadillo package
> on my current setup provided that I turn on optimization in the call
> to g++ t
I'm working on translating Tim Davis's CSparse library of C functions
into templated C++ classes. The purpose is to allow spare matrix
manipulation both using Rcpp objects and using other types of vector
objects, such as std::vector.
The templates are in terms of the vector objects. The basic
re
You can check what is done in R itself in the R sources but I imagine that
it uses a uniform random variate converted to an integer through the
cumulative probabilities. The good news is that it is easy to create the
cumulative weights with the std::accumulate function.
On May 14, 2011 4:12 PM, "Ch
On May 15, 2011 5:17 PM, "Dirk Eddelbuettel" wrote:
>
>
> Hi Jelmer,
>
> On 15 May 2011 at 21:42, Jelmer Ypma wrote:
> | Dear all,
> |
> | This is a question about recommended ways of linking C++ code in an R
> | package to C++ code defined in other R packages (using Rcpp 0.9.4.1
>
> Well, you see
On May 18, 2011 2:53 AM, wrote:
>
> Hello Dirk
>
> That was exactly the trick! Thanks a lot! Our class and code work so far,
but it may take more time to debug or find bad design. Perhaps we will be
back with more detailed questions. Anyway, one question already emerged.
When librarying the class,
On Fri, May 20, 2011 at 5:01 AM, wrote:
> On 18.05.2011, at 15:17, Douglas Bates wrote:
>
>> On May 18, 2011 2:53 AM, wrote:
>>
>>> [...]
>>>
>>> When librarying the class, assigning an object, do some calculations,
>>> whatever -- every
I am developing classes for sparse matrices with an Rcpp interface that includes
Rcpp::Dimension dim() const {return Rcpp::Dimension(nr(), nc());}
Rcpp::NumericMatrix asmatrix() const;
The implementation of the asmatrix method begins with
Rcpp::NumericMatrix ans(dim(
Sorry for the long subject line but I hope it describes what I want to
do. I have a C++ class, dgTMatrix, that is exported in a module
definition.
RCPP_MODULE(RcppSp) {
...
class_("dgCMatrix")
...
;
}
Many of the methods for this class return other members of this class.
Can I creat
On Sat, Jun 4, 2011 at 11:08 AM, Silkworth,David J.
wrote:
> 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
On Sat, Jun 4, 2011 at 11:26 AM, Douglas Bates wrote:
> On Sat, Jun 4, 2011 at 11:08 AM, Silkworth,David J.
> wrote:
>> 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
>>
With
> sessionInfo()
R version 2.14.0 Under development (unstable) (2011-05-26 r55995)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
[
A thinko on my part. Remove the '*' in front of the std::min_element.
On Sat, Jun 4, 2011 at 12:52 PM, Silkworth,David J.
wrote:
> 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.
>
dou
On Jun 6, 2011 4:17 AM, "baptiste auguie"
wrote:
>
> Thank you for the explanations below.
>
> On 5 June 2011 10:40, Dirk Eddelbuettel wrote:
> >
> > On 5 June 2011 at 10:12, baptiste auguie wrote:
> > | Hi Dirk and all,
> > |
> > | On 4 June 2011 12:04, Dirk Eddelbuettel wrote:
> > | >
> > | >
1 - 100 of 401 matches
Mail list logo