Boost logo

Ublas :

From: Nico Galoppo (nico_at_[hidden])
Date: 2006-04-14 10:43:35


Karl,

That sounds *very* interesting. I've wanted to try out GOTO BLAS for a while
now. Could you give a quick howto-introduction on how to hook it all together?

Thanks!

--nico

Karl Meerbergen wrote:
> The problem of relying on atlas is that it is not optimal for blas.
> There are better blas implementations available, e.g. goto blas. The
> performance of lapack mainly lies in the performance of the BLAS.
>
> There is no problem for me if you want to use atlas, but you have to be
> aware of the fact that it is not the platform generic way to develop
> efficient code, imho. Using the blas and lapack interfaces allow to link
> with *any* implementation of blas and lapack, not just atlas ;-)
>
> Karl
>
>
> Nico Galoppo wrote:
>
>
>>What I was saying is that, just as there are bindings for blas/lapack, there are
>>bindings for atlas (imo a platform-optimized version of a subset of blas/lapack
>>operations). There are bindings in
>>boost-sandbox/numeric/bindings/atlas
>>
>>#include <boost/numeric/bindings/atlas/cblas1.hpp>
>>#include <boost/numeric/bindings/atlas/cblas2.hpp>
>>#include <boost/numeric/bindings/atlas/cblas3.hpp>
>>#include <boost/numeric/bindings/atlas/clapack.hpp>
>>#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
>>#include <boost/numeric/bindings/traits/ublas_vector.hpp>
>>namespace atlas = boost::numeric::bindings::atlas;
>>
>>std::vector<int> ipiv(matrix.size1());
>>
>>int ierr = atlas::getrf(matrix, ipiv);
>>ierr = atlas::getrs(matrix, ipiv, rhs);
>>
>>solves matrix * x = b where rhs stores b on input and receives x on output.
>>atlas::getri(matrix, ipiv) does this in one step.
>>
>>the documentation is in
>>boost-sandbox/libs/numeric/bindings/atlas/doc/index.html
>>
>>--nico
>>
>>Karl Meerbergen wrote:
>>
>>
>>
>>>I suppose atlas is a compiled lapack. there are bindings in
>>>boost-sandbox/numeric/bindings/lapack/gesv.hpp
>>>
>>>#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
>>>#include <boost/numeric/bindings/traits/ublas_vector2.hpp>
>>>#include <boost/numeric/bindings/lapack/gesv.hpp>
>>>
>>>boost::numeric::bindings::lapack::gesv( matrix, rhs ) ;
>>>
>>>solves matrix * x = b where rhs stores b on input and receives x on output.
>>>
>>>for the factorization only (with singularity check), use:
>>>
>>>#include <boost/numeric/bindings/traits/std_vector.hpp>
>>>std::vector<int> pivots( matrix.size1() ) ;
>>>int info = boost::numeric::bindings::lapack::getrfv( matrix, pivots )
>>>
>>>Karl
>>>
>>>
>>>
>>>Nico Galoppo wrote:
>>>
>>>
>>>
>>>
>>>
>>>>Have a look at the ATLAS bindings for ublas. ATLAS provides such factorization
>>>>methods.
>>>>
>>>>http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?action=browse&id=Linear_Algebra_With_UBLAS&revision=15
>>>>
>>>>HTH,
>>>>
>>>>--nico
>>>>
>>>>John Maddock wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>I gather from a quick web search that ublas does have LUP decomposition
>>>>>routines, however a grep of the docs failed to find any mention of the
>>>>>routine in question, and how they should be used.
>>>>>
>>>>>So.... does anyone have the boiler plate code needed to solve for x given
>>>>>matrix A and vector b ?
>>>>>
>>>>>Many thanks,
>>>>>
>>>>>John Maddock.
>>>>>
>>>>>_______________________________________________
>>>>>ublas mailing list
>>>>>ublas_at_[hidden]
>>>>>http://lists.boost.org/mailman/listinfo.cgi/ublas
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>

-- 
nico galoppo von borries     |  address: 105 creel st., chapel hill
comp. graphics phd. student  |           north carolina, 27516 USA
UNC, chapel hill             |  phone: +1 (919) 962-1898 (office)
                              |         +1 (919) 942-7609 (home)
                              |  email: nico at cs dot unc dot edu
                              |  homepage: http://www.ngaloppo.org