Displaying 2 results from an estimated 2 matches for "dimif".
Did you mean:
dimi
2012 Dec 15
3
interfacing with .Call
Hi
My code is as following:
#include <R.h>
#include <Rinternals.h>
//* the Projector part *//
void Projector(double *L, int *dimL, double *G, int *dimG, double *W, int
*dimW, int *xymod, int *dimxy, double *modif, int *dimif, double *Lsum)
{ ...}
//* the interface part *//
#define getDim(A) INTEGER(coerceVector(getAttrib(A,R_DimSymbol), INTSXP))
SEXP Projector5(SEXP L, SEXP G, SEXP W, SEXP xymod, SEXP modif)
{
//* digest SEXPs from R *//
int *dimL, *dimG, *dimW, *dimxy, *dimif;
double *lptr, *gptr, *wptr,...
2012 Dec 06
1
Use .Call interface
...EAL(L);
double *gptr; gptr=REAL(G);
double *wptr; wptr=REAL(W);
int *xyptr; xyptr=INTEGER(xymod);
double *ifptr; ifptr=REAL(modif);
int *dimL; dimL=INTEGER(GET_DIM(L));
int *dimG; dimG=INTEGER(GET_DIM(G));
int *dimW; dimW=INTEGER(GET_DIM(W));
int *dimxy; dimxy=INTEGER(GET_DIM(xymod));
int *dimif; dimif=INTEGER(GET_DIM(modif));
SEXP ans;
PROTECT(ans=allocMatrix(REALSXP, dimG[0], dimL[1])); nprot++;
double *ansptr; ansptr=REAL(ans);
Projector(lptr, dimL, gptr, dimG, wptr, dimW, xyptr, dimxy, ifptr, dimif,
ansptr);
UNPROTECT(nprot);
return ans;
}
The question is that the function "...