search for: convolve2

Displaying 10 results from an estimated 10 matches for "convolve2".

Did you mean: convolve
2010 May 30
1
Calling fft from C
Hi I have made a R function 'convolve2' for convolution of two real valued vectors based on Rs 'convolve' with option type="open" - see below. (exp.length and irf.length are variables set in another part of the program) I wish to implement the function convolve2 in C and use it in a function used from R with .Call...
2007 Feb 06
0
convolve: request for "usual" behaviour + some improvements + some fixes
...echler at stat.math.ethz.ch>: > > > Thank you, Herve, > > > > >>>>> "Herve" == Herve Pages <hpages at fhcrc.org> > > >>>>> on Fri, 02 Feb 2007 21:30:04 -0800 writes: > > > > Herve> Last but not least: convolve2 can be made 100 times or 1000 times > faster > > Herve> than convolve by choosing a power of 2 for the length of the > fft-buffer > > Herve> (a length of 2^n is the best case for the fft, the worst case > being > when > > Herve> the length is a pri...
2007 Aug 23
1
.Call and to reclaim the memory by allocVector
...he C code and have found that the .Call didn't release the memory claimed by allocVector. Even after applying gc() function and removing the R object created by the .Call function, the memory was still not reclaimed back to the operating system. Here is an example. It was modified from the convolve2 example from the R extension manual. Now I am computing the crossproduct of a and b, which returns a vector of size length(a)*length(b). The C code is at the end of this message with the modification commented. The R code is here ---------------------------- dyn.load("crossprod2.so") c...
2007 Aug 23
1
.Call and to reclaim the memory by allocVector
...he C code and have found that the .Call didn't release the memory claimed by allocVector. Even after applying gc() function and removing the R object created by the .Call function, the memory was still not reclaimed back to the operating system. Here is an example. It was modified from the convolve2 example from the R extension manual. Now I am computing the crossproduct of a and b, which returns a vector of size length(a)*length(b). The C code is at the end of this message with the modification commented. The R code is here ---------------------------- dyn.load("crossprod2.so") c...
2012 Feb 14
2
R CMD SHLIB in Windows XP - No output at all
...I actually use the """ make -f "C:/Trading/R/R-2.14.1/etc/i386/Makeconf" -f "C:/Trading/R/R-2.14.1/share/make/winshlib.mk" SHLIB= OBJECTS= """ directly in the command prompt, it works more or less. I managed to build a simple dll based on C code (convolve2.dll, from the example), but couldn't build any dll based on c++ code. Is my SHLIB properly set up ? Why do I have a strange Makeconf ? Should I try to find a proper version of the file ? or reinstall R ? Does anyone have any idea how to fix that ? Been trying to fix it for a long time now !...
2004 Nov 12
1
dyn.load problem
...oad(x, as.logical(local), as.logical(now)) : unable to load shared library "C:/Dev-Cpp/teste": LoadLibrary failure: Par??metro incorreto. (Incorrect Parameter) My C code is (extracted form Writing R Extension): #include <R.h> #include <Rinternals.h> SEXP convolve2(SEXP a, SEXP b) { R_len_t i, j, na, nb, nab; double *xa, *xb, *xab; SEXP ab; PROTECT(a = coerceVector(a, REALSXP)); PROTECT(b = coerceVector(b, REALSXP)); na = length(a); nb = length(b); nab = na + nb - 1; PROTECT(ab = allocVector(REALSXP, nab)...
2004 Nov 07
2
Problem with dyn.load()
...( I have installed ActivePerl, Rtools and MinGW as indicated in http://www.murdoch-sutherland.com/Rtools/ an with correct path). I would like run the coded write below named conv.c (Example from "Write R Extension") : #include <R.h> #include <Rinternals.h> SEXP convolve2(SEXP a, SEXP b) { R_len_t i, j, na, nb, nab; double *xa, *xb, *xab; SEXP ab; PROTECT(a = coerceVector(a, REALSXP)); PROTECT(b = coerceVector(b, REALSXP)); na = length(a); nb = length(b); nab = na + nb - 1; PROTECT(ab = allocVector(REALSXP,...
2012 Dec 10
1
Changing arguments inside .Call. Wise to encourage "const" on all arguments?
...no longer protected after the function starts modifying it? Here's an example with similar usage in Writing R Extensions, section 5.10.1 "Calling .Call". It protects the arguments a and b (needed ??), then changes them. #include <R.h> #include <Rdefines.h> SEXP convolve2(SEXP a, SEXP b) { R_len_t i, j, na, nb, nab; double *xa, *xb, *xab; SEXP ab; PROTECT(a = AS_NUMERIC(a)); /* PJ wonders, doesn't this alter "a" in calling code*/ PROTECT(b = AS_NUMERIC(b)); na = LENGTH(a); nb = LENGTH(b); nab...
2013 Jun 23
1
stats::convolve documentation enhancement
Hi, the function stats::convolve does not mention efficient usage of the underlying FFT algorithm, such as (a) if type="circular", then length(x)=length(y) should have many factors (e.g. length(x) = length(y) = 2^n) (b) if type="open" or "filter", then length(x)+length(y)-1 should have many factors (e.g. length(x)+length(y)-1 = 2^n) In particular the latter may
2007 Feb 02
1
Inaccuracy in ?convolve
Hi, Man page for 'convolve' says: conj: logical; if 'TRUE', take the complex _conjugate_ before back-transforming (default, and used for usual convolution). The complex conjugate of 'x', of 'y', of both? In fact it seems that it takes the complex conjugate of 'y' only which is OK but might be worth mentioning because (1) conj=TRUE is the