<p>Hello. I have a mlpack program dealing with products of large matrices ~(100000,400). <br>
Repeated executions started giving me different results and I have written a few lines example to illustrate such problem: </p>
<p>#include <br>
using namespace arma;</p>
<p>int main(void) { <br>
//Vector declaration & initialisation<br>
vec a_vector=ones(400);<br>
vec fcol=ones(61);<br>
mat M = ones(400,61);<br>
for (int iter=0; iter<1; iter++){<br>
a_vector=M<em>fcol;<br>
}<br>
std::cout << "i.rows=" << a_vector.n_rows << " i.cols=" << a_vector.n_cols << " i399=" << a_vector(399);<br>
if (a_vector(399)!=61) std::cout << "</em>" << std::endl;<br>
else std::cout << std::endl;<br>
return 0;<br>
}</p>
<p>Here we find a simple matrix multiplication of matrix * column to obtain a column-> (400,61)*(61,1)=(400,1). <br>
To check whether this method works I print out the last element of the resulting column. Since all elements are set to 1, any final element should be a sum of 61 elements = 61. <br>
Well, it turns out that when running it several times these doesn't always hold. </p>
<p>You can try with a .sh script that runs, say, 80 times. <br>
This problem is not encountered when using only armadillo. </p>
<p>The program was compiled through:<br>
"g++ main.cpp -O2 -std=gnu++11 -I/home/usrname/lib/Boost161/include -L/home/usrname/lib/Boost161/lib -larmadillo -lmlpack -I/home/usrname/lib/mlpacklib/include -L/home/usrname/lib/mlpacklib/lib" </p>
<p>I would be really grateful if someone could shed some light on this. <br>
<a href="https://github.com/mlpack/mlpack/files/408636/code.zip">code.zip</a></p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/issues/759">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFLq2PhEotBkA-myVI2NE1zN426Nbks5qeExrgaJpZM4Jf5j4">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFOdgoyl258xy_fEwY_jue4e8-v0Sks5qeExrgaJpZM4Jf5j4.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/issues/759"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/mlpack/mlpack","title":"mlpack/mlpack","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/mlpack/mlpack"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Basic matrix multiplication error when done multiple times (#759)"}],"action":{"name":"View Issue","url":"https://github.com/mlpack/mlpack/issues/759"}}}</script>