<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=WordSection1>

<p class=MsoNormal><span style='color:#1F497D'>A clarification on what I wrote
- the dims reported are NULL for objects that do not report the dims correctly
and then when accessing the elements as a matrix it acts like a vector (and
fails). However, both problems only happen some of the time. Other times the
correct dims are reported and access does not fail.<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Lovett, Mitch <br>
<b>Sent:</b> Tuesday, October 19, 2010 1:54 PM<br>
<b>To:</b> 'Rcpp-devel@lists.r-forge.r-project.org'<br>
<b>Subject:</b> Inconsistent returns<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I am running into some strange behavior with Rcpp objects
returned to R.&nbsp;Specifically, I run a program that sets values on several
large matrices. I initialize these and pass the matrices back with the code
below (I don't include all the code to fill the matrix). So, I pass it back as
a list. Once in R, I summarize the list to find all the objects of the right
length. I try to get the dims on the objects and only some of them return the
correct dims some of the time, while all of them do other times. In case it
matters, these are running on MacOS and running the previous version of Rcpp.
Any help would be great.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Thanks,<o:p></o:p></p>

<p class=MsoNormal>Mitch<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>//initialize<o:p></o:p></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::NumericMatrix
Res(n,nmcmc/keep);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::NumericMatrix
REs(n,nmcmc/keep);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::NumericMatrix
Rais(n,nmcmc/keep);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::NumericMatrix
Rbis(n,nmcmc/keep);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::NumericMatrix
Rthets(thet.n_rows,nmcmc/keep);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::NumericMatrix
RmovsE(n/<span style='color:#2B21D5'>2</span>,mreport);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>arma::mat
Es(REs.begin(),n,nmcmc/keep,<span style='color:#9F36A1'>false</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>arma::mat
ais(Rais.begin(),n,nmcmc/keep,<span style='color:#9F36A1'>false</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>arma::mat
bis(Rbis.begin(),n,nmcmc/keep,<span style='color:#9F36A1'>false</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>arma::mat
es(Res.begin(),n,nmcmc/keep,<span style='color:#9F36A1'>false</span>); &nbsp;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>arma::mat
thets(Rthets.begin(),thet.n_rows,nmcmc/keep,<span style='color:#9F36A1'>false</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>arma::colvec
lls(nmcmc/keep);&nbsp;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>arma::mat
movsE(RmovsE.begin(),n/<span style='color:#2B21D5'>2</span>,mreport,<span
style='color:#9F36A1'>false</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>//return<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::List
ret=Rcpp::List::create(Rcpp::Named(<span style='color:#B13D26'>&quot;lls&quot;</span>)=Rcpp::wrap(lls),
&nbsp; &nbsp;<o:p></o:p></span></p>

<p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;
font-family:"Menlo","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>&quot;thets&quot;</span>)=Rcpp::wrap(thets),<o:p></o:p></span></p>

<p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;
font-family:"Menlo","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>&quot;Es&quot;</span>)=Rcpp::wrap(Es),<o:p></o:p></span></p>

<p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;
font-family:"Menlo","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>&quot;es&quot;</span>)=Rcpp::wrap(es),<o:p></o:p></span></p>

<p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;
font-family:"Menlo","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>&quot;ais&quot;</span>)=Rcpp::wrap(ais),<o:p></o:p></span></p>

<p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;
font-family:"Menlo","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>&quot;bis&quot;</span>)=Rcpp::wrap(bis),<o:p></o:p></span></p>

<p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;
font-family:"Menlo","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>&quot;movsAB&quot;</span>)=Rcpp::wrap(movsE)<o:p></o:p></span></p>

<p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;
font-family:"Menlo","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:8.5pt;font-family:"Menlo","serif"'>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Menlo","serif";
color:#9F36A1'>return</span><span style='font-size:8.5pt;font-family:"Menlo","serif"'>
Rcpp::wrap(ret);<o:p></o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Mitchell J. Lovett<o:p></o:p></p>

<p class=MsoNormal>Assistant Professor of Marketing<o:p></o:p></p>

<p class=MsoNormal>Simon School of Business<o:p></o:p></p>

<p class=MsoNormal>University of Rochester<o:p></o:p></p>

<p class=MsoNormal>(585) 276-4020<o:p></o:p></p>

<p class=MsoNormal>mitch.lovett@simon.rochester.edu<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>