小编Ami*_*ein的帖子

转换cpp函数以在r中使用

我有以下cpp函数,并希望在R中编写它

我使用rcpp包编译并使用它但发生了一些错误

实际上我在R中使用指针时遇到问题

      void creationPI(double *distC, int mC, int tailleC, double *PIC,int aC)
    //distC: distribution de X ; mC= smax-smin+1 ie u+v+1; tailleC=a+1; PIC la matrice PI comme resultat
    {

    double *f;//=NULL;  /*f(k)=P[X<=k]*/
    int t1,k,b,c,l;
    int top_un,top_deux;
      //FILE *matrix;

    t1=2*(aC-1)+1;   // taille du vecteur des f ca va de 1-a à a-1 ; k va de [0 à 2*(a-1)]


    /* ALLOCATION DES MATRICES*/
      //if (!(f = (double *)calloc(t1, sizeof(double))))
         //exit(ALLOC_ERROR);
    f = (double *)calloc(t1, sizeof(double));


    /* CREATION DES f */ …
Run Code Online (Sandbox Code Playgroud)

c++ pointers r function-pointers rcpp

0
推荐指数
1
解决办法
74
查看次数

标签 统计

c++ ×1

function-pointers ×1

pointers ×1

r ×1

rcpp ×1