<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Dear Rcpp experts, <br>
    <br>
    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? <br>
    <br>
    ######################################<br>
    D &lt;- matrix(c(0,1,Inf,Inf),2,2)<br>
    src3 &lt;- '<br>
    &nbsp; IntegerMatrix xD(D);<br>
    &nbsp; IntegerVector Drow(xD.ncol()); <br>
    &nbsp; for(int i=0; i&lt;xD.ncol(); i++) std::cout &lt;&lt; xD[1,i]
    &lt;&lt; std::endl;<br>
    return xD;<br>
    '<br>
    rowExtraction &lt;-
    cxxfunction(signature(D="matrix"),body=src3,plugin="Rcpp",verbose=TRUE)<br>
    rowExtraction(D)<br>
    ######################################<br>
    <br>
    Thank you very much, <br>
    Cedric <br>
    <br>
    <div class="moz-signature">-- <br>
      <div class="moz-signature"><font face="Times" size="3"> Cedric
          Ginestet <br>
          Centre for Neuroimaging Sciences (L3.04) <br>
          NIHR Biomedical Research Centre <br>
          Department of Neuroimaging <br>
          Institute of Psychiatry, Box P089 <br>
          King's College London <br>
          De Crespigny Park<br>
          London <br>
          SE5 8AF <br>
          Tel: (+44) 20-3228-3052<br>
          Fax: (+44) 20-3228-2116<br>
          Email: <a moz-do-not-send="true"
            class="moz-txt-link-abbreviated"
            href="mailto:cedric.ginestet@kcl.ac.uk">cedric.ginestet@kcl.ac.uk</a><br>
        </font> </div>
    </div>
  </body>
</html>