[Rd] Problem with function in fortran 95

2009-08-14 Thread Fabio Mathias Corrêa
Thanks very much!!!   Fábio Mathias Corrêa Estatística e Experimentação Agropecuária/UFLA --- Em sex, 14/8/09, Simone Giannerini escreveu: > De: Simone Giannerini > Assunto: Re: [Rd] Problem with function in fortran 95 > Para: "Fabio Mathias Corrêa" > Cc:

Re: [Rd] Problem with function in fortran 95

2009-08-14 Thread Simone Giannerini
Fabio, I see two problems with your code: 1. R type numeric corresponds to FORTRAN Real*8 (or double precision) so that line 4 of your mat.f95 becomes: REAL*8 :: x, y, res 2. your R code won't ever succeed because you pass integer matrices (x,y,res) to a subroutine that expects REAL*8 data. you

Re: [Rd] Problem with function in fortran 95

2009-08-12 Thread Göran Broström
Fabio Mathias Corrêa skrev: I am writing a function in fortran 95, but the intrinsic function MATMUL is not working properly. Here's an example. SUBROUTINE mymult(x,y,res,m,n) IMPLICIT NONE INTEGER :: m,n REAL :: x, y, res Is REAL in Fortran 95 the same as "dou

[Rd] Problem with function in fortran 95

2009-08-12 Thread Fabio Mathias Corrêa
I am writing a function in fortran 95, but the intrinsic function MATMUL is not working properly. Here's an example. SUBROUTINE mymult(x,y,res,m,n) IMPLICIT NONE INTEGER :: m,n REAL :: x, y, res DIMENSION :: x(m,n), y(n,m), res(m,m) res = MATMUL(x,y