Hi Charles,

 > Okay, I thought that would be a workaround.  Does the current `resize`
> method create a copy of the matrix internally as well?  Ideally one
> could resize without the copying overhead.

The resize() method allocates a new buffer and copies over the old 
entries. Pretty much the same as in the workaround solution I suggested.

> Also, would you consider this as new functionality to be added in the
> future?  If so I can create a new github issue but if not, this
> workaround should be sufficient unless there is a way to avoid the
> aforementioned copy overhead.

Do you happen to have a suggestion for an intuitive interface? I can't 
think of a good one, so I'd rather leave it as-is with the explicit 
copying as suggested.

Best regards,
Karli



> On Wed, Jan 20, 2016 at 11:08 AM, Karl Rupp <r...@iue.tuwien.ac.at
> <mailto:r...@iue.tuwien.ac.at>> wrote:
>
>     Hi Charles,
>
>     > I can easily resize a matrix with the `resize` function
>
>
>         viennacl::matrix vcl_A(3,3);
>         vcl_A.resize(3,4);
>
>         but I notice that this adds the new column on the end of the
>         matrix.  Is
>         there a way to append it on to the front of the matrix?
>
>
>     Not directly. But you can create a new matrix and then use
>     viennacl::project() to place the old entries at the correct spot:
>
>     matrix<T> B(3,4);
>     matrix_range<matrix<T> > B_right(B, range(0, 3), range(1,4));
>     B_right = A;
>
>
>
>     Best regards,
>     Karli
>
>


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to