Boost logo

Ublas :

From: Paul C. Leopardi (paul.leopardi_at_[hidden])
Date: 2007-08-15 21:48:28


Hi all,
I'm playing around with GluCat, and have just changed the matrices from row
major to column major:

    typedef ublas::column_major orientation_t;
    typedef ublas::compressed_matrix< Scalar_T, orientation_t >
                                                       basis_matrix_t;
    typedef basis_matrix_t matrix_t;

This results in the following error message:

leopardi_at_linfinit:~/src/Working/Working-0.2.3/glucat/squaring> make
if
g++ -DHAVE_CONFIG_H -I. -I. -I.. -Wstrict-aliasing=2 -Wall -ansi -DNDEBUG -g -O3 -finline-limit=2400 -D_GLUCAT_USE_GNU_CXX_HASH_MAP -fno-check-new -fabi-version=0 -fexceptions -MT
squaring.o -MD -MP -MF ".deps/squaring.Tpo" -c -o squaring.o squaring.cpp; \
then mv -f ".deps/squaring.Tpo" ".deps/squaring.Po"; else
rm -f ".deps/squaring.Tpo"; exit 1; fi
../boost/numeric/ublas/operation.hpp: In function ‘M&
boost::numeric::ublas::axpy_prod(const
boost::numeric::ublas::matrix_expression<RHS_T>&, const
boost::numeric::ublas::matrix_expression<E2>&, M&, TRI,
boost::numeric::ublas::sparse_proxy_tag,
boost::numeric::ublas::column_major_tag) [with M =
boost::numeric::ublas::compressed_matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long int>, 0ul,
boost::numeric::ublas::unbounded_array<long unsigned int, std::allocator<long
unsigned int> >, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >, E1 =
boost::numeric::ublas::compressed_matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long int>, 0ul,
boost::numeric::ublas::unbounded_array<long unsigned int, std::allocator<long
unsigned int> >, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >, E2 =
boost::numeric::ublas::compressed_matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long int>, 0ul,
boost::numeric::ublas::unbounded_array<long unsigned int, std::allocator<long
unsigned int> >, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >, TRI = boost::numeric::ublas::basic_full<long
unsigned int>]’:
../boost/numeric/ublas/operation.hpp:724: instantiated from ‘M&
boost::numeric::ublas::axpy_prod(const
boost::numeric::ublas::matrix_expression<RHS_T>&, const
boost::numeric::ublas::matrix_expression<E2>&, M&, bool) [with M =
boost::numeric::ublas::compressed_matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long int>, 0ul,
boost::numeric::ublas::unbounded_array<long unsigned int, std::allocator<long
unsigned int> >, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >, E1 =
boost::numeric::ublas::compressed_matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long int>, 0ul,
boost::numeric::ublas::unbounded_array<long unsigned int, std::allocator<long
unsigned int> >, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >, E2 =
boost::numeric::ublas::compressed_matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long int>, 0ul,
boost::numeric::ublas::unbounded_array<long unsigned int, std::allocator<long
unsigned int> >, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >]’
../glucat/matrix_multi_imp.h:508: instantiated
from ‘glucat::matrix_multi<Scalar_T, LO, HI>& glucat::matrix_multi<Scalar_T,
LO, HI>::operator/=(const glucat::matrix_multi<Scalar_T, LO, HI>&) [with
Scalar_T = double, int LO = -0x00000000000000020, int HI = 32]’
squaring.cpp:62: instantiated from here
../boost/numeric/ublas/operation.hpp:645: error: ‘functor_type’ is not a
member of ‘boost::numeric::ublas::basic_full<long unsigned int>’
make: *** [squaring.o] Error 1

I'm using Boost 1.34.1.

I checked boost/numeric/ublas/operation.hpp and in
    axpy_prod (const matrix_expression<E1> &e1,
               const matrix_expression<E2> &e2,
               M &m, TRI,
               sparse_proxy_tag, row_major_tag)
it has on lines 566-567:
if (triangular_restriction::other (it1.index1 (), itr.index ()))
  m (it1.index1 (), itr.index ()) += *it2 * *itr;

but in
    axpy_prod (const matrix_expression<E1> &e1,
               const matrix_expression<E2> &e2,
               M &m, TRI,
               sparse_proxy_tag, column_major_tag)
it has on lines 645-646:
if (triangular_restriction::functor_type ().other (itc.index (), it2.index2
()))
  m (itc.index (), it2.index2 ()) += *it1 * *itc;

Why do these two functions differ in this way? Is this a bug?

Best regards, Paul