[Boost-bugs] [Boost C++ Libraries] #4860: Rational does not play well with uBlas

Subject: [Boost-bugs] [Boost C++ Libraries] #4860: Rational does not play well with uBlas
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-11-16 20:00:54


#4860: Rational does not play well with uBlas
-----------------------------------------+----------------------------------
 Reporter: pierluigi.rolando@… | Owner: guwi17
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: uBLAS
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: |
-----------------------------------------+----------------------------------
 I'm trying to solve a rational linear system using boost/rational + uBlas.
 I've tried to copy many examples on the web that all follow the same line:

 {{{
         typedef permutation_matrix<rational_t> pmatrix;
         pmatrix pm(a.size1());
         matrix_t inverse(a.size1(), a.size2());
         lu_factorize(a, pm);

         inverse.assign(identity_matrix<rational_t>(a.size1()));
         lu_substitute(a, pm, inverse);
 }}}

 a is of type matrix_t, which is defined as follows:
 {{{
 typedef rational<long long int> rational_t;
 typedef matrix<rational_t> matrix_t;
 }}}

 Compilation fails on the lu_factorize function call with the following
 error messages:
 {{{
 In file included from interpolator.cpp:5:
 /usr/local/include/boost/numeric/ublas/lu.hpp: In function ‘void
 boost::numeric::ublas::swap_rows(const PM&, MV&,
 boost::numeric::ublas::matrix_tag) [with PM =
 boost::numeric::ublas::permutation_matrix<boost::rational<long long int>,
 boost::numeric::ublas::unbounded_array<boost::rational<long long int>,
 std::allocator<boost::rational<long long int> > > >, MV =
 boost::numeric::ublas::matrix<boost::rational<long long int>,
 boost::numeric::ublas::basic_row_major<long unsigned int, long int>,
 boost::numeric::ublas::unbounded_array<boost::rational<long long int>,
 std::allocator<boost::rational<long long int> > > >]’:
 /usr/local/include/boost/numeric/ublas/lu.hpp:90: instantiated from
 â€˜void boost::numeric::ublas::swap_rows(const PM&, MV&) [with PM =
 boost::numeric::ublas::permutation_matrix<boost::rational<long long int>,
 boost::numeric::ublas::unbounded_array<boost::rational<long long int>,
 std::allocator<boost::rational<long long int> > > >, MV =
 boost::numeric::ublas::lu_factorize(M&, PM&) [with M = matrix_t, PM =
 main()::pmatrix]::matrix_type]’
 /usr/local/include/boost/numeric/ublas/lu.hpp:165: instantiated from
 â€˜typename M::size_type boost::numeric::ublas::lu_factorize(M&, PM&) [with
 M = matrix_t, PM = main()::pmatrix]’
 interpolator.cpp:122: instantiated from here
 /usr/local/include/boost/numeric/ublas/lu.hpp:83: error: no matching
 function for call to
 â€˜row(boost::numeric::ublas::matrix<boost::rational<long long int>,
 boost::numeric::ublas::basic_row_major<long unsigned int, long int>,
 boost::numeric::ublas::unbounded_array<boost::rational<long long int>,
 std::allocator<boost::rational<long long int> > > >&, const
 boost::rational<long long int>&)’
 /usr/local/include/boost/numeric/ublas/matrix_proxy.hpp:466: note:
 candidates are: boost::numeric::ublas::matrix_row<M>
 boost::numeric::ublas::row(M&, typename M::size_type) [with M =
 boost::numeric::ublas::matrix<boost::rational<long long int>,
 boost::numeric::ublas::basic_row_major<long unsigned int, long int>,
 boost::numeric::ublas::unbounded_array<boost::rational<long long int>,
 std::allocator<boost::rational<long long int> > > >]
 /usr/local/include/boost/numeric/ublas/matrix_proxy.hpp:471: note:
 const boost::numeric::ublas::matrix_row<const M>
 boost::numeric::ublas::row(const M&, typename M::size_type) [with M =
 boost::numeric::ublas::matrix<boost::rational<long long int>,
 boost::numeric::ublas::basic_row_major<long unsigned int, long int>,
 boost::numeric::ublas::unbounded_array<boost::rational<long long int>,
 std::allocator<boost::rational<long long int> > > >]
 }}}

 It looks like the two libraries do not play well together, which means
 that Boost is basically useless for what I'm trying to do :-/

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4860>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC