<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: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-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
.MsoChpDefault
        {mso-style-type:export-only;}
@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>I am running into some strange behavior with Rcpp objects
returned to R. 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> </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> </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> </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>); <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); <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> </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'>"lls"</span>)=Rcpp::wrap(lls),
<o:p></o:p></span></p>
<p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;
font-family:"Menlo","serif"'> </span></span><span
style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>"thets"</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"'> </span></span><span
style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>"Es"</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"'> </span></span><span
style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>"es"</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"'> </span></span><span
style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>"ais"</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"'> </span></span><span
style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>"bis"</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"'> </span></span><span
style='font-size:8.5pt;font-family:"Menlo","serif"'>Rcpp::Named(<span
style='color:#B13D26'>"movsAB"</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"'> </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> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </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> </o:p></p>
</div>
</body>
</html>