Hi,
 > Fair enough, thank you Karl.  One follow-up question, where is this in
> the documentation?  I am trying to get a feel of where everything is so
> I don't have to ask these simple questions on here.

This is listed in the 'Basic Operations'-Chapter:
http://viennacl.sourceforge.net/doc/manual-operations.html#manual-operations-row-column-diagonal

All supported operations are supposed to be described in the 'User 
Manual'. With the operator-overloading in C++ it is not easy to list all 
available operation in e.g. a single large table of function names. If 
you have suggestions for further improvements, please let us know. :-)

Best regards,
Karli



> On Mon, Aug 17, 2015 at 8:15 AM, Karl Rupp <r...@iue.tuwien.ac.at
> <mailto:r...@iue.tuwien.ac.at>> wrote:
>
>     Hi Charles,
>
>     you can extract the row or column of a matrix using viennacl::row()
>     and viennacl::column(), e.g.
>
>     viennacl::matrix<T> A(N, N);
>     viennacl::vector<T> x(N);
>
>     x = viennacl::row(A, 2);
>     x = viennacl::column(A, 3);
>
>     The assignment of a vector to a matrix row or matrix column is more
>     involved, though...
>
>     In either case you really want to iterate over elements and use
>     per-element access. This is because each access entails a
>     host<->device communication, which is very costly with CUDA and OpenCL.
>
>     Best regards,
>     Karli
>
>
>
>
>     On 08/17/2015 03:08 PM, Charles Determan wrote:
>
>         I have seen in the documentation that it is simple to access an
>         individual element in a viennacl::matrix with
>
>         mat(i,j)
>
>         but how could I access an entire row or column?  Is there
>         similar syntax
>         or would I need to iterate over each element of a row/column?
>
>         Thanks,
>         Charles
>
>
>         
> ------------------------------------------------------------------------------
>
>
>
>         _______________________________________________
>         ViennaCL-devel mailing list
>         ViennaCL-devel@lists.sourceforge.net
>         <mailto:ViennaCL-devel@lists.sourceforge.net>
>         https://lists.sourceforge.net/lists/listinfo/viennacl-devel
>
>
>


------------------------------------------------------------------------------
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to