Displaying 18 results from an estimated 18 matches similar to: "Use .Call interface"
2012 Dec 15
3
interfacing with .Call
Hi
My code is as following:
#include <R.h>
#include <Rinternals.h>
//* the Projector part *//
void Projector(double *L, int *dimL, double *G, int *dimG, double *W, int
*dimW, int *xymod, int *dimxy, double *modif, int *dimif, double *Lsum)
{ ...}
//* the interface part *//
#define getDim(A) INTEGER(coerceVector(getAttrib(A,R_DimSymbol), INTSXP))
SEXP Projector5(SEXP L, SEXP G,
2013 Apr 17
1
stack imbalance in max.col for non-real matrices
It's tough to reliably reproduce, but I often get stack imbalance warnings
when calling max.col() on non-real/double matrix. The code is conditionally
PROTECTing but not incrementing its nprot counter for the eventual
UNPROTECT. Pretty sure this would fix (but I haven't tested it):
Index: array.c
===================================================================
--- array.c (revision
2007 Dec 31
2
the woes of NA
Joyful.
I'm adapting a FORTRAN 77 package for use with R. Pretty
straightforward.
Except for a glitch it took me some time to figure out. This existing
package has subroutines which have parameters called "NA". So, I called
subroutines like
bnodes <- function(n, lst, lptr, lend, nodes, nb, na, nt)
{
ensure.all.numeric(list(n, lst, lptr, lend, nodes, nb, n.a, nt),
2004 Jun 22
3
[Q] GET_DIM() crash on Windows only
I have the following contrived code in package format.
On Solaris and Mac OS X, code runs just fine. On Windows,
it crashes the R environment with the "Send Bug Report"
dialog. I tried R 1.8.1 (Win2K) and R 1.9 (WinXP) binaries
with the same result. PCs otherwise appear properly
configured for creating R packages. Anything blatantly
wrong? Suggestions?
TIA
Relevant files from package
2004 Jun 24
0
[SOLVED] GET_DIM() crash on Windows only
Paul Roebuck wrote:
>I have the following contrived code in package format.
>On Solaris and Mac OS X, code runs just fine. On Windows,
>it crashes the R environment with the "Send Bug Report"
>dialog. I tried R 1.8.1 (Win2K) and R 1.9 (WinXP) binaries
>with the same result. PCs otherwise appear properly
>configured for creating R packages. Anything blatantly
>wrong?
2007 May 22
2
inline C/C++ in R: question and suggestion
This is a question and maybe an announcement.
We've been discussing in the group that it would be nice to have a
mechanism for something like "inline" C/C++ function calls in R. I do
not want to reinvent the wheel, therefore, if something like that
already exists, please give me a hint -- I could not find anything. If
not, here is a working solution, please criticise so I could
2007 Feb 13
2
anyone has C++ STL classes stability issue if used with R
Hello,
is there any one who uses C++ STL classes when programming shared libs
for R and has had any problems with STL?
In the very simple example below I am constantly getting segfaults when
trying to populate the queue. The segfault occurs at what looks like a
random index in the loop when pushing another element to the queue.
Reproduced on 4 machines. Object x is an Image as in EBImage,
2006 May 29
5
Can't Run "Within A Deep Forest"
i hope you can help me. The game's site is
http://withinadeepforest.ni2.se/index.php?
here's the terminal output from the install (from install binary) and
the run.
the install:
$ wine install_wadf_11.exe
fixme:advapi:CheckTokenMembership ((nil) 0x7ff18088 0x7fc8fe1c) stub!
fixme:sfc:SfcIsFileProtected ((nil), L"C:\\Program Files\\Within a Deep
Forest\\unins000.exe") stub
2005 Jul 28
1
Rails+Apache 2+FastCGI on Fedora Core 3 Linux: Has anyone got it working well?
Hi All,
I have a Rails application that needs to be served from a
Fedora Core 3 Linux server. The application runs well as a
"plain" CGI application.
My next step was to speed things up with FastCGI installed
via "gem install fcgi". (version 0.8.6.1).
That approach lead to this error in the fastcgi.crash.log:
Dispatcher failed to catch: undefined method
2007 Oct 05
1
Sklyar's inline package: how to return a list?
Hi,
Below I have a mickey-mouse example using Oleg Sklyar's wonderful inline package.
The question I have is, how do I return multiple values, say in a list?
Inside the C code, I've also calculated 'sum'. How do I return this along with 'res'?
Ultimately, I want to return multiple matrix results. Thanks in advance for any code snipplets/advice!
Regards,
Ken
#
2003 May 21
2
moving onto returning a data.frame?
I've been studying some of the code and I'm still a little shakey on the
proper method for returning a data.frame from a C function (which is my
ultimate goal here). I've started some code that I've "stolen" from the
archives and I'm running into crashes, etc. I've been trying to gleen some
insight from the src/main/scan.c file and didn't find many comments in
2016 Jan 10
3
coerce SEXP type to C++ matrix class and back
Dear all,
I am testing a simple C++ function that takes a double matrix as
argument and which uses routines provided by the C++ Armadillo
package. I am aware of the nice capabilities of Rcpp and RcppArmadillo
which helps simplifying a lot and that I have already successfully
tested. However, I had a hard time trying to figure out how the
coercion from a REALSPX matrix to an arma::mat =
2003 Jun 23
3
FW: S4 classes, creating in C
I am using C code to create an S4 object based on Douglas Bates's example
in his lecture notes on
<http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Tutorials/RExtensions/slide
s.pdf>
http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Tutorials/RExtensions/slides
.pdf
e.g.
SEXP La_DGE_dc(SEXP A)
{
SEXP aa = PROTECT(duplicate(A));
SEXP adims, pivot, val;
int
2001 Dec 14
2
colSums in C
Hi, all!
My project today is to write a speedy colSums(), which is a function
available in S-Plus to add the columns of a matrix. Here are 4 ways to do it,
with the time it took (elapsed, best of 3 trials) in both R and S-Plus:
m <- matrix(1, 400, 40000)
x1 <- apply(m, 2, sum) ## R=16.55 S=52.39
x2 <- as.vector(rep(1,nrow(m)) %*% m) ## R= 2.39 S= 8.52
x3 <-
2010 Feb 18
3
R CMD check: OK in LINUX. Crashes in Windows!
Hi,
I have followed the recommended steps for creating a package (rctest). As of
now, my goal is simply to understand how various pieces fit together. The
package includes:
(1) C code with source in sub-directories, compiled to create a static
library.
(a) There is a single C-struct (dns) a simple 'matrix': {int m; int n;
double *d;}
(b) C code to create random matrix of a certain size.
2010 Jul 27
1
R CMD build wiped my computer
Hi,
I ran R (version 2.9.0) CMD build under root in Fedora (9). When it
tried to remove "junk files" it removed EVERYTHING in my local
account! (See below).
Can anyone tell me what happened, and even more importantly if I can I
restore what was lost.
Panickingly,
Jarrod
[jarrod at localhost AManal]$ R CMD build MCMCglmm_2.05
* checking for file
2010 Jul 27
1
R CMD build wiped my computer
Hi,
I ran R (version 2.9.0) CMD build under root in Fedora (9). When it
tried to remove "junk files" it removed EVERYTHING in my local
account! (See below).
Can anyone tell me what happened, and even more importantly if I can I
restore what was lost.
Panickingly,
Jarrod
[jarrod at localhost AManal]$ R CMD build MCMCglmm_2.05
* checking for file
2010 Jul 27
1
R CMD build wiped my computer
Hi,
I ran R (version 2.9.0) CMD build under root in Fedora (9). When it
tried to remove "junk files" it removed EVERYTHING in my local
account! (See below).
Can anyone tell me what happened, and even more importantly if I can I
restore what was lost.
Panickingly,
Jarrod
[jarrod at localhost AManal]$ R CMD build MCMCglmm_2.05
* checking for file 'MCMCglmm_2.05/DESCRIPTION'