Hello!

I have a program in Fortran and would like to build a matrix with random
numbers, I have a function in C.
However, I have problems with the use of function in R.

Code to compile: R CMD SHLIB mat.f myrbeta.c -o func.so

Code in C.

#include <R.h>
#include <Rmath.h>

void F77_SUB(fseedi)(void){
  GetRNGstate();
}

void F77_SUB(fseedo)(void){
  PutRNGstate();
}

void F77_SUB(myrbeta)(double *px, double *pa, double *pb){
  *px = rbeta(*pa,*pb);
}



Code in Fortran

    subroutine mat(x,l,c)
    integer l,c
    double precision x(l,c)
    integer i,j
     do j = 1, c
       do i = 1, l
        call fseedi()
         x(i,j) = call myrbeta(1,4,5) ! It's correct?
        call fseedo()
           enddo
          enddo
    end


Thanks very much!


-- 
             Fábio Mathias Corrêa
Estatística e Experimentação Agropecuária

	[[alternative HTML version deleted]]

