Skip to content
Prev 7072 / 15075 Next

gfortran bug?

I have been able to make an example that shows the weird behaviour. For the
Fortran code in last post run

rmfilter    <- function(x, coef)
{
    dyn.load('~/rmfilter.so')
    nl    <- dim(x)
    cdim    <- dim(coef)
    init    <- matrix(0, cdim[3], nl[2])
    ans    <- .Fortran('rmfilter', as.double(x), as.integer(nl),
as.double(coef), as.integer(cdim), as.double(init))[[1]]
    dim(ans)    <- dim(x)
    return(ans)
}

eps <- matrix(rnorm(300), ncol = 3)
tmp <- lapply(seq(5000), function(x) rmfilter(eps, array(diag(3)*0.5,
c(3,3,2))))
sum(!sapply(2:5000, function(x) all.equal(tmp[[1]], tmp[[x]])) == 'TRUE')

The three last runs I have done give

tmp <- lapply(seq(5000), function(x) rmfilter(eps, array(diag(3)*0.5,
c(3,3,2))))
[1] 639
c(3,3,2))))
[1] 0
c(3,3,2))))
[1] 29

I hope you have some ideas.

Best
Andreas


Den 25/04/10 16.22 skrev "Andreas Noack Jensen"
<andreas.noack.jensen at econ.ku.dk> f?lgende: