
Ublas : 
Subject: Re: [ublas] a problem with compressed matrices
From: Ungermann, JÃ¶rn (j.ungermann_at_[hidden])
Date: 20110823 09:01:48
Hi Tarek,
sorry, your mail does not contain enough information to see what's wrong. In the least, I'd need to have a very short program exhibiting the error, compile command and the version of boost you are using.
If you are looking for speed, it depends on which operation should be fast. Compressed_matrix<> times vector is reasonably fast with ublas. For basically everything else involving dense matrices (ublas::matrix<>), one should rely on some numerical backend such as ATLAS and call this via the boost::numerical_bindings.
If you are not yet commited to one solution, you might want to have a look at Eigen, which is very fast for dense matrices but offers only alpha support for sparse matrices.
Again, depends on your use case. To my knowledge, there is currently no silver bullet C++ linear algebra solution.
Regards,
Joern
> Original Message
> From: ublasbounces_at_[hidden] [mailto:ublas
> bounces_at_[hidden]] On Behalf Of Tarek
> Sent: Dienstag, 23. August 2011 13:22
> To: ublas_at_[hidden]
> Subject: Re: [ublas] a problem with compressed matrices
>
> Dear Joern,
> Thanks a lot for your reply. I tried to use sparse_prod, but I always
> get
> the following error, though I include the file:
> <boost/numeric/ublas/operation_sparse.hpp>
> error: no matching function for call to
> â€š'sparse_prod(boost::numeric::ublas::matrix<double>&,
> boost::numeric::ublas::matrix<double>&)â€šÃ„Ã´
>
>
> As for axpy_prod, it works fine in release mode (twice as fast as prod)
> when
> used for matrixvector multiplication. For matrixmatrix multiplication
> however, it yields the following error:
>
> /usr/include/boost/numeric/ublas/operation.hpp: In function â€š'M&
> boost::numeric::ublas::axpy_prod(const
> boost::numeric::ublas::matrix_expression<E2>&, const
> boost::numeric::ublas::matrix_expression<E2>&, M&, bool) [with M =
> boost::numeric::ublas::compressed_matrix<std::complex<double>
> >, E1
> = boost::numeric::ublas::matrix_binary_scalar1<const double,
> boost::numeric::ublas::compressed_matrix<std::complex<double> >,
> boost::numeric::ublas::scalar_multiplies<double,
> std::complex<double> > >, E2 =
> boost::numeric::ublas::compressed_matrix<std::complex<double>
> >]â€šÃ„Ã´:
> main.cpp:203:45: instantiated from here
> /usr/include/boost/numeric/ublas/operation.hpp:719:13: error: invalid
> use of
> incomplete type â€š'struct
> boost::numeric::ublas::zero_matrix<std::complex<double>,
> std::allocator<std::complex<double> > >â€š'
> /usr/include/boost/numeric/ublas/fwd.hpp:132:11: error: declaration of
> â€šÃ„Ã²struct
> boost::numeric::ublas::zero_matrix<std::complex<double>,
> std::allocator<std::complex<double> > >â€š'
>
>
> I noticed that Mathematica works much faster than uBlas programs, are
> you
> aware of other libraries that can do the multiplication faster than
> axpy_prod ?
>
>
> 
> View this message in context: http://boost.2283326.n4.nabble.com/a
> problemwithcompressedmatricestp3757133p3762462.html
> Sent from the Boost  uBLAS mailing list archive at Nabble.com.
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: j.ungermann_at_[hidden]