Dear Rcpp experts,

When passing a vector/argument with infinite values to a C++ function, the R wrapper returns NA's. [See the code below] Is there a way around this to ensure that infinite values are preserved from R to C++ and then from C++ to R again?

######################################
D <- matrix(c(0,1,Inf,Inf),2,2)
src3 <- '
  IntegerMatrix xD(D);
  IntegerVector Drow(xD.ncol());
  for(int i=0; i<xD.ncol(); i++) std::cout << xD[1,i] << std::endl;
return xD;
'
rowExtraction <- cxxfunction(signature(D="matrix"),body=src3,plugin="Rcpp",verbose=TRUE)
rowExtraction(D)
######################################

Thank you very much,
Cedric

--
Cedric Ginestet
Centre for Neuroimaging Sciences (L3.04)
NIHR Biomedical Research Centre
Department of Neuroimaging
Institute of Psychiatry, Box P089
King's College London
De Crespigny Park
London
SE5 8AF
Tel: (+44) 20-3228-3052
Fax: (+44) 20-3228-2116
Email: [email protected]
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to