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