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>"))
class SrMatDnMatProdExpression extends Pointer {

thanks again,

Andy


________________________________
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 MatVecProdExpression extends 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

Reply via email to