Thanks Karli, much appreciated as always. -------- Original message -------- From: Karl Rupp <r...@iue.tuwien.ac.at> Date: 08/05/2016 5:13 PM (GMT-05:00) To: Andrew Palumbo <ap....@outlook.com>, viennacl-devel@lists.sourceforge.net Subject: Re: [ViennaCL-devel] compressed_matrix %*% matrix_Base
Hi Andy, hmm, a first look doesn't reveal anything suspicious in the constructor code. I'll have a close look on Sunday. Best regards, Karli On 08/05/2016 09:04 PM, Andrew Palumbo wrote: > Hi Karl, > > > I've been trying to implement tests for: > > > matrix_base<double> C = compressed_matrix<double> A %*% > > matrix_base<double,row_major> B. > > > I cant find in the code or the documentation any constructor for > matrix_base<T>( > > matrix_expression<const viennacl::compressed_matrix<T>, const > viennacl::matrix_base<T>, viennacl::op_prod>) > > ie. a mixed expression of compressed_matrix and matrix_base > > and get a compilation error when I try to instantiate a: > > matrix_base<double>(matrix_expression<const > viennacl::compressed_matrix<double>, const > viennacl::matrix_base<double>, > viennacl::op_prod>) > > Is there a transformation that I need to do from this > > matrix_expression<compressed_matrix<double>, matrix_base<double>, > op_prod> > > to something else so that I may be able to initialize a matrix_base (or > possibly even a compressed_matrix) from it? > > The compilation error that i get is below. > > Thanks, > > Andy > > {...} > > /usr/include/viennacl/matrix.hpp: In instantiation of ‘static void > viennacl::linalg::detail::op_executor<viennacl::matrix_base<T>, > viennacl::op_assign, viennacl::matrix_expression<const LHS, const RHS, > viennacl::op_prod> >::apply(viennacl::matrix_base<T>&, const > viennacl::matrix_expression<const SparseMatrixType, const > viennacl::matrix_base<T>, viennacl::op_prod>&) [with SparseMatrixType = > viennacl::compressed_matrix<double>; T = double; LHS = > viennacl::compressed_matrix<double>; RHS = viennacl::matrix_base<double>]’: > > /usr/include/viennacl/matrix.hpp:324:107: required from > ‘viennacl::matrix_base<NumericT, SizeT, DistanceT>& > viennacl::matrix_base<SCALARTYPE, SizeType, > DistanceType>::operator=(const viennacl::matrix_expression<const LHS, > const RHS, OP>&) [with LHS = viennacl::compressed_matrix<double>; RHS = > viennacl::matrix_base<double>; OP = viennacl::op_prod; NumericT = > double; SizeT = long unsigned int; DistanceT = long int]’ > > {...} > > > ------------------------------------------------------------------------ > *From:* Andrew Palumbo <ap....@outlook.com> > *Sent:* Thursday, August 4, 2016 11:06:33 AM > *To:* Karl Rupp; viennacl-devel@lists.sourceforge.net > *Subject:* Re: [ViennaCL-devel] compressed_matrix %*% matrix_Base > > Thanks Karl- Appreciate it! > > > ------------------------------------------------------------------------ > *From:* Karl Rupp <r...@iue.tuwien.ac.at> > *Sent:* Thursday, August 4, 2016 3:36:53 AM > *To:* Andrew Palumbo; viennacl-devel@lists.sourceforge.net > *Subject:* Re: [ViennaCL-devel] compressed_matrix %*% matrix_Base > Hi Andrew, > > > > On 08/04/2016 01:33 AM, Andrew Palumbo wrote: >> Oops sorry - wrong class in the last post. Too many things going on at >> once. >> >> >> @Properties(inherit = Array(classOf[Context]), >> value = Array(new Platform( >> include =Array("matrix.hpp"), >> library ="jniViennaCL") >> )) >> @Namespace("viennacl") >> @Name(Array("matrix_expression<const viennacl::compressed_matrix<double>, " + >> "const viennacl::matrix_base<double>, " + >> "viennacl::op_prod>")) > > yes, this is the right result expression template type. > > Regarding trans: Currently the functionality isn't fully exposed through > the API, i.e. you cannot write A = trans(B) for sparse matrices A and B. > However, the functionality is implemented in > viennacl::linalg::detail::amg::amg_transpose(B, A) and will be properly > exposed soon. > > Best regards, > Karli > > > > > >> ------------------------------------------------------------------------ >> *From:* Andrew Palumbo <ap....@outlook.com> >> *Sent:* Wednesday, August 3, 2016 6:44:10 PM >> *To:* Karl Rupp; viennacl-devel@lists.sourceforge.net >> *Subject:* Re: [ViennaCL-devel] compressed_matrix %*% matrix_Base >> >> Hi Karl, as always thanks for the quick response. >> >> I Just needed a point in the right direction, and have it compiling >> now. (Tests up next). >> >> Just FYI, I needed a new class for the product result: >> >> @Properties(inherit = Array(classOf[Context]), >> value = Array(new Platform( >> include =Array("matrix.hpp"), >> library ="jniViennaCL") >> )) >> @Namespace("viennacl") >> @Name(Array("vector_expression<const viennacl::matrix_base<double>, " + >> "const viennacl::vector_base<double>, " + >> "viennacl::op_prod>")) >> class MatVecProdExpressionextends Pointer { >> >> } >> >> Wanted to make sure that I wasn't grinding my wheels. >> >> Thanks alot for your time. >> >> One more question, there is no `trans(compressed_matrix cm)` function >> correct? This should just be done by taking the teanspose first of the >> matrix before converting it to CSR, etc? Curious, as we may be able to >> shave a small amount of time if so. >> >> Thanks! >> >> Andy >> >> >> ------------------------------------------------------------------------ >> *From:* Karl Rupp <r...@iue.tuwien.ac.at> >> *Sent:* Wednesday, August 3, 2016 5:28:58 PM >> *To:* Andrew Palumbo; viennacl-devel@lists.sourceforge.net >> *Subject:* Re: [ViennaCL-devel] compressed_matrix %*% matrix_Base >> Hi Andrew, >> >> > I'm having some trouble with sparse `compressed_matrix` `matrix`(base) >>> matrix multiplication. This is supported, correct? >> >> Yes. Could you please let us know what you have tried already? >> It shouldn't be any more code to write than >> >> viennacl::compressed_matrix<T> A(...); >> viennacl::matrix<T> B(...); >> viennacl::matrix<T> C = viennacl::linalg::prod(A, B); >> >> Make sure to >> #include "viennacl/matrix.hpp" >> #include "viennacl/compressed_matrix.hpp" >> #include "viennacl/linalg/prod.hpp" >> at the beginning; otherwise you get incomprehensible C++ compiler output. >> >> Best regards, >> Karli >> >> >> >> >>> >>> >>> I've been trying to use the: >>> >>> >>> template< typename SparseMatrixType, typename SCALARTYPE> >>> typename viennacl::enable_if< >>> viennacl::is_any_sparse_matrix<SparseMatrixType>::value >>> <http://viennacl.sourceforge.net/doc/structviennacl_1_1enable__if.html>, >>> viennacl::matrix_expression >>> <http://viennacl.sourceforge.net/doc/classviennacl_1_1matrix__expression.html><const >>> SparseMatrixType, >>> const matrix_base <SCALARTYPE> >>> <http://viennacl.sourceforge.net/doc/classviennacl_1_1matrix__base.html>, >>> op_prod >>> <http://viennacl.sourceforge.net/doc/structviennacl_1_1op__prod.html> > >>> >::type >>> <http://viennacl.sourceforge.net/doc/namespaceviennacl_1_1linalg.html#a3bba0146e669e012bb7c7380ce780a25> >>> prod >>> <http://viennacl.sourceforge.net/doc/namespaceviennacl_1_1linalg.html#aa18d10f8a90e38bd9ff43c650fc670ef>(const >>> SparseMatrixType & sp_mat, >>> const viennacl::matrix_base<SCALARTYPE> >>> <http://viennacl.sourceforge.net/doc/classviennacl_1_1matrix__base.html> >>> & d_mat) >>> { >>> return viennacl::matrix_expression >>> <http://viennacl.sourceforge.net/doc/classviennacl_1_1matrix__expression.html><const >>> SparseMatrixType, >>> const viennacl::matrix_base<SCALARTYPE> >>> <http://viennacl.sourceforge.net/doc/classviennacl_1_1matrix__base.html>, >>> op_prod >>> <http://viennacl.sourceforge.net/doc/structviennacl_1_1op__prod.html> >>> >(sp_mat, d_mat); >>> >>> >>> method from prod.hpp. >>> >>> >>> I just wanted to make sure that this was the correct method, and that it >>> accepted `compressed_matrix`s as `sp_mat`. Is that correct? I'm >>> mapping this to java via javacpp so the templates can prove difficult, >>> and are likely where I'm getting errors. >>> >>> >>> Just wanted to confirm that this was supported as I am using it (and >>> that there is not a more straightforward way with fewer template arguments. >>> >>> >>> Thanks, >>> >>> >>> Andy >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> >>> >>> _______________________________________________ >>> ViennaCL-devel mailing list >>> 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