<div dir="ltr">Just curious - did it stop working because GSL changed?<div><br></div><div style>Yurii</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 28, 2013 at 3:32 AM,  <span dir="ltr"><<a href="mailto:noreply@r-forge.r-project.org" target="_blank">noreply@r-forge.r-project.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: wja<br>
Date: 2013-01-27 21:32:44 +0100 (Sun, 27 Jan 2013)<br>
New Revision: 1088<br>
<br>
Modified:<br>
   pkg/MixABEL/src/MXlib/moorepenrose.cpp<br>
   pkg/MixABEL/src/MXlib/twovarcomp.cpp<br>
Log:<br>
Fixed bug #2449. Addresses of temporaries (submatrix/vector views) were being taken<br>
<br>
Modified: pkg/MixABEL/src/MXlib/moorepenrose.cpp<br>
===================================================================<br>
--- pkg/MixABEL/src/MXlib/moorepenrose.cpp      2013-01-18 19:37:08 UTC (rev 1087)<br>
+++ pkg/MixABEL/src/MXlib/moorepenrose.cpp      2013-01-27 20:32:44 UTC (rev 1088)<br>
@@ -57,12 +57,15 @@<br>
      return GSL_SUCCESS;<br>
    }<br>
    for(it=0;it<thresh;it++)<br>
-     gsl_vector_scale(&(gsl_matrix_column(psvd_V_mat,it).vector),1.0/gsl_vector_get(psvd_S_vec,it));<br>
-<br>
+    {<br>
+       gsl_vector_view columnview = gsl_matrix_column(psvd_V_mat,it);<br>
+       gsl_vector_scale(&(columnview.vector),1.0/gsl_vector_get(psvd_S_vec,it));<br>
+   }<br>
    pUrest_mat=gsl_matrix_alloc(pA_mat->size1, thresh);<br>
-   gsl_matrix_memcpy(pUrest_mat,&(gsl_matrix_submatrix(pA_mat,0,0,pA_mat->size1, thresh).matrix));<br>
+<br>
+   gsl_matrix_view sub_mat = gsl_matrix_submatrix(pA_mat,0,0,pA_mat->size1, thresh);<br>
+   gsl_matrix_memcpy(pUrest_mat,(&sub_mat.matrix));<br>
<br>
-<br>
    svd_Vrest_matview=gsl_matrix_submatrix(psvd_V_mat, 0, 0, pA_mat->size1, thresh);<br>
<br>
    gsl_blas_dgemm(CblasNoTrans, CblasTrans, 1.0, &(svd_Vrest_matview.matrix), pUrest_mat,0.0, pA_mat);<br>
<br>
Modified: pkg/MixABEL/src/MXlib/twovarcomp.cpp<br>
===================================================================<br>
--- pkg/MixABEL/src/MXlib/twovarcomp.cpp        2013-01-18 19:37:08 UTC (rev 1087)<br>
+++ pkg/MixABEL/src/MXlib/twovarcomp.cpp        2013-01-27 20:32:44 UTC (rev 1088)<br>
@@ -675,8 +675,10 @@<br>
<br>
   gsl_matrix_memcpy(pdev_work->pa_mat, ppRvPx_mat[pdev_work->k]);<br>
   for(pdev_work->it=0;pdev_work->it<n;pdev_work->it++)<br>
-    gsl_vector_scale(&(gsl_matrix_row(pdev_work->pa_mat,pdev_work->it).vector), gsl_vector_get(pdev_work->pa2_vec,pdev_work->it));<br>
-<br>
+  {<br>
+         gsl_vector_view rowview=gsl_matrix_row(pdev_work->pa_mat,pdev_work->it);<br>
+         gsl_vector_scale(&rowview.vector, gsl_vector_get(pdev_work->pa2_vec,pdev_work->it));<br>
+  }<br>
   gsl_vector_memcpy(pdev_work->pxPhiy_vec, ppxPVPy_vec[pdev_work->k]);<br>
   gsl_matrix_memcpy(pdev_work->pxPhix_mat, ppxPVPx_mat[pdev_work->k]);<br>
<br>
@@ -851,8 +853,10 @@<br>
   gsl_matrix_memcpy(pdev_work->pa_mat, ppRvPx_mat[pdev_work->k]);<br>
<br>
   for(pdev_work->it=0;pdev_work->it<n;pdev_work->it++)<br>
-    gsl_vector_scale(&(gsl_matrix_row(pdev_work->pa_mat,pdev_work->it).vector), gsl_vector_get(pdev_work->pa2_vec,pdev_work->it));<br>
-<br>
+       {<br>
+               gsl_vector_view rowview;<br>
+               gsl_vector_scale(&(rowview.vector), gsl_vector_get(pdev_work->pa2_vec,pdev_work->it));<br>
+       }<br>
<br>
   gsl_vector_memcpy(pdev_work->pxPhiy_vec, ppxPVPy_vec[pdev_work->k]);<br>
   gsl_matrix_memcpy(pdev_work->pxPhix_mat, ppxPVPx_mat[pdev_work->k]);<br>
<br>
_______________________________________________<br>
Genabel-commits mailing list<br>
<a href="mailto:Genabel-commits@lists.r-forge.r-project.org">Genabel-commits@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>-----------------------------------------------------<br>Yurii S. Aulchenko<br><div><br></div><div>[ <a href="http://nl.linkedin.com/in/yuriiaulchenko" target="_blank">LinkedIn</a> ] [ <a href="http://twitter.com/YuriiAulchenko" target="_blank">Twitter</a> ] [ <a href="http://yurii-aulchenko.blogspot.nl/" target="_blank">Blog</a> ]</div>

</div>