Skip to content

fft

2 messages · Martin Schlather, Ole Christensen

#
This is a multi-part message in MIME format.
--------------CFA855794B7333D088726B1A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hi,

I have problems when calling fft_factor and fft_work directly in my 
C-code. Martin Maechler already told me that I should not do this -- 
anyway, the code works fine if the length of the vector is a multiple 
of 2,3,5.
If the length of the vector has different form I get, in some cases, a 
segmentation fault when work and iwork are freed (I use C's malloc to 
allocate memory for work and iwork). No or less problems occur if I 
allocate more memory than stated in  src/appl/fft.c.

However R's fft in called in R does not fail.

I would be grateful if anybody would tell me why this happens or to 
which fact I did not pay attention.
Please find attached the package containing the relevant files.
Details can be found in  tests/test.R

Many thanks in advance.
Martin
#
This is a multi-part message in MIME format.
--------------583A5CD90029B2577BD50770
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi Martin

I tried your FFT stuff. Here is my report:

1. I observed similar behaviour as you did (on my Linux machine with
R-1.4.1)

2. Changing from malloc to S_alloc seems to remove the problem (see
attachment).

I remember I had a similar problem long time ago (which caused me to
change from malloc to S_alloc everywhere) when calling the same function
twice (as you have). As far as I remember this problem was present on
Linux but not on Solaris. I could try running your test functions on
Solaris, but first I have to install a new R-version there (R-1.3.0 is
probably too old for this ?).

Hope this sheds a little light on the problem, but we are not there yet
(I do not understand the reason for the difference between S_alloc and
malloc). 


Ole
Martin.Schlather@uni-bayreuth.de wrote: