Your Makevar.site is incorrect. Replace
CXX11 = $CXX
with
CXX11 = $(CXX)
$CXX only expands the macro 'C', not 'CXX'. Since C is not defined $CXX
expands to XX.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Jun 16, 2020 at 12:39 PM Thell Fowler wrote:
> Windows 10 Pro 2004190
--- re-building ‘lolog-ergm.Rmd’ using rmarkdown
Quitting from lines 69-75 (lolog-ergm.Rmd)
Error: processing vignette 'lolog-ergm.Rmd' failed with diagnostics:
unimplemented type (28) in 'duplicate'
I don't believe there is a type (*SXP) 28 in R. This could be due to
memory misuse.
Have you tri
But do replace pkgKitten's boilerplate before submitting the package to
CRAN, lest CRAN people decide to insist on meaningful content.
./RApiDatetime/man/RApiDatetime-package.Rd: This section should provide a
more detailed overview of how to use the
./SimplifyStats/man/SimplifyStats-package.Rd:
Could the c++ slowdown be due to the fact that Rinternals.h defines ISNAN
differently for C and C++? For C it uses the compiler's isnan macro, for
C++ it calls the function R_isnancpp.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Dec 13, 2016 at 5:04 AM, Christian Gunning wrote:
> > |
Replacing the PROTECT and UNPROTECT_PTR with R_PreserveObject and
R_ReleaseObject will probably take care of the unbalanced-protection-stack
warnings, but I don't know if there would be any bad interactions with
anything else in Rcpp.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Oct 6, 20
Have you tried running your code on the Mac after setting gctorture(TRUE)?
By the way, valgrind showed the opposite of a memory leak - the code was
using memory that it had declared free. A leak is when the code does not
free memory that it can no longer use.
Bill Dunlap
TIBCO Software
wdunlap t
Using 'valgrind', along with gctorture(TRUE) can help track down these
bugs. E.g.
% R --debugger valgrind
==8445== Memcheck, a memory error detector
==8445== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==8445== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
=
> if (std::isnan(input[i])) {
> output[i] = NA_REAL; // this is the desired output (instead of NAN)
In this case I think you could replace the second line with
output[i] = input[i];
to emulate the usual R mapping of NA to NA and NaN to NaN.
(I have seen C compilers that messed up my pro
Here is one way to do it in R. Much of the code is checking that the
format of 'x'
is what you describe and you may omit it if you know that does not need
checking.
The call to 'unlist' in the call to lapply is responsible for setting the
classes of the outputs.
Since translation from R to Rcpp i
Note that the R function rpois() always returns an integer vector and thus
commonly runs into problems when lambda is near or above 2^31 (the
smallest positive integral double that cannot represented as a 32-bit signed
integer).
> set.seed(1)
> rpois(10, 2^31)
[1] 2147454617 NA NA
Why do you include "Rdefines.h" in your Rcpp code? It contains errors
(e.g., it leaves the initial Rf_ off of the length function). Also, in my
opinion, it is obsolete, especially for Rcpp code, since it is for writing
code that works in R and S (including S+) and Rcpp will never work in S+.
Bil
Do you really need the macros like GET_LENGTH that are defined in
#include
? It looks like they are meant to ease porting of C code written for S or
S+,
but very little code these days is written for S or S+ and certainly not
Rcpp
code.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Fe
> The `mode()` function was pretty useless for determining a matrix
object's type
Use the storage.mode() function.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Nov 26, 2014 at 9:06 AM, David Shih
wrote:
> Hi Yixuan,
>
>
> You're right!
>
>
> Whether the input matrix can be modified
> In quickref, all examples pass just numbers without any prior conversion
> to NumericVector or IntegerVector. Strings are exception to this?
Strings are different than numbers in that they don't occupy a fixed
amount of space, so some memory management is needed for them.
Bill Dunlap
TIBCO Sof
> I will try "gctorture(TRUE)" suggested by Martin.
Try running it under valgrind as well. E.g.,
% R --debugger=valgrind
==15338== Memcheck, a memory error detector
==15338== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==15338== Using Valgrind-3.7.0 and LibVEX; rerun w
Why don't you make track non-static instead?
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Oct 22, 2014 at 12:03 PM, nate russell wrote:
> Just for the sake of completeness, I noticed that the value of
> trackIdx::tracker was persisting (and therefore continuing to be
> incremented) betwe
The point of gctorture(TRUE), preferably used with an address-validity
checker like valgrind, is that you are alerted the first time you use
an address that you did not allocate for your use. With
gctorture(FALSE) you are alerted after the n'th bad usage, where n
depends on when the garbage collec
You can get more information about intermittent problems like this by
running R under valgrind and using gctorture(TRUE). It will run very
slowly, but valgrind will flag the first time you use memory that is
not currently allocated by new or malloc. Without valgrind you only
see a problem if the
E <- (exp(A) * (1 - 1 / A) + 1 / A) / (exp(A) - 1)
If A is a matrix by then, isn't exp a very slow (and imprecise:
http://blogs.mathworks.com/cleve/2012/07/23/a-balancing-act-for-the-matrix-exponential/)
operation, isn't it? You do it twice on the same matrix.
exp(A) is the element-by-e
> Is there a way to get the exact arithmetic as in R?
Make your sum quad precision ('long double' in g++).
% cat s.cpp
#include
int main(int argc, char *argv[])
{
double dSum(0.0);
long double ldSum(0.0);
for(int i=0 ; i < 10 ; i++) {
dSum += 0.1;
ldSum += 0.1;
}
This would be easier if base::set.seed() accepted a value of .Random.seed
instead of just a scalar integer or, new to R-3.0.0, NULL. If set.seed()
returned the
previous value of .Random.seed (NULL if there was no previous value) things
might be even easier. People should not have to know where .
21 matches
Mail list logo