|
Ublas : |
From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2006-04-14 10:39:45
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
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
-- ============================================== Look at our unique training program and Register on-line at http://www.fft.be/?id=35 ---------------------------------------------- Karl Meerbergen Free Field Technologies NEW ADDRESS FROM FEBRUARY 1st ONWARD: Axis Park Louvain-la-Neuve rue Emile Francqui, 1 B-1435 Mont-Saint Guibert - BELGIUM Company Phone: +32 10 45 12 26 Company Fax: +32 10 45 46 26 Mobile Phone: +32 474 26 66 59 Home Phone: +32 2 306 38 10 mailto:Karl.Meerbergen_at_[hidden] http://www.fft.be ============================================