Boost logo

Ublas :

From: Gross, Steve (SGross_at_[hidden])
Date: 2007-03-21 11:00:26


Ok, as requested here is the full sample code. I'm using boost 1.32.00.

Code follows:

#include <iostream>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>

namespace ublas = boost::numeric::ublas;

// Ublas typedefs:
typedef ublas::vector<double> uvec;
typedef ublas::matrix<double> umat;

int main()
{
    const int size = 500;

    umat m1(size, size);
    umat m2(size, size);

    for(int i = 0; i < size; ++i)
    {
        for(int j = 0; j < size; ++j)
        {
            m1(i, j) = j;
            m2(i, j) = j * 5 - 2;
        }
    }

    umat C = ublas::prod(m1, m2);

    return 0;
}

And here is the full error message:

/usr/local/include/boost/numeric/ublas/functional.hpp: In static member function `static typename boost::numeric::ublas::matrix_matrix_binary_functor<T1, T2, TR>::result_type boost::numeric::ublas::matrix_matrix_prod<T1, T2, TR>::apply(const boost::numeric::ublas::matrix_expression<E1>&, const boost::numeric::ublas::matrix_expression<E2>&, typename boost::numeric::ublas::matrix_matrix_binary_functor<T1, T2, TR>::size_type, typename boost::numeric::ublas::matrix_matrix_binary_functor<T1, T2, TR>::size_type, boost::numeric::ublas::abstract_tag) [with E1 = boost::numeric::ublas::matrix_reference<const boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > > >, E2 = boost::numeric::ublas::matrix_reference<const boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > > >, T1 = double, T2 = double, TR = double]':
/usr/local/include/boost/numeric/ublas/functional.hpp:1237: instantiated from `static typename boost::numeric::ublas::matrix_matrix_binary_functor<T1, T2, TR>::result_type boost::numeric::ublas::matrix_matrix_prod<T1, T2, TR>::apply(const boost::numeric::ublas::matrix_expression<E1>&, const boost::numeric::ublas::matrix_expression<E2>&, typename boost::numeric::ublas::matrix_matrix_binary_functor<T1, T2, TR>::size_type, typename boost::numeric::ublas::matrix_matrix_binary_functor<T1, T2, TR>::size_type) [with E1 = boost::numeric::ublas::matrix_reference<const boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > > >, E2 = boost::numeric::ublas::matrix_reference<const boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > > >, T1 = double, T2 = double, TR = double]'
/usr/local/include/boost/numeric/ublas/matrix_expression.hpp:4517: instantiated from `typename F::result_type boost::numeric::ublas::matrix_matrix_binary<E1, E2, F>::operator()(typename boost::numeric::ublas::promote_traits<typename E1::size_type, typename E2::size_type>::promote_type, typename boost::numeric::ublas::promote_traits<typename E1::size_type, typename E2::size_type>::promote_type) const [with E1 = boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, E2 = boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, F = boost::numeric::ublas::matrix_matrix_prod<double, double, double>]'
/usr/local/include/boost/numeric/ublas/matrix_assign.hpp:616: instantiated from `void boost::numeric::ublas::indexing_matrix_assign(F, M&, const boost::numeric::ublas::matrix_expression<E2>&, boost::numeric::ublas::row_major_tag) [with F = boost::numeric::ublas::scalar_assign<double&, double>, M = boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, E = boost::numeric::ublas::matrix_matrix_binary<boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, boost::numeric::ublas::matrix_matrix_prod<double, double, double> >]'
/usr/local/include/boost/numeric/ublas/matrix_assign.hpp:651: instantiated from `void boost::numeric::ublas::matrix_assign(F, boost::numeric::ublas::full, M&, const boost::numeric::ublas::matrix_expression<E2>&, boost::numeric::ublas::dense_proxy_tag, C) [with F = boost::numeric::ublas::scalar_assign<double&, double>, M = boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double>> >, E = boost::numeric::ublas::matrix_matrix_binary<boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, boost::numeric::ublas::matrix_matrix_prod<double, double, double> >, C = boost::numeric::ublas::row_major_tag]'
/usr/local/include/boost/numeric/ublas/matrix_assign.hpp:1265: instantiated from `void boost::numeric::ublas::matrix_assign(F, M&, const boost::numeric::ublas::matrix_expression<E2>&) [with F = boost::numeric::ublas::scalar_assign<double&, double>, M = boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, E = boost::numeric::ublas::matrix_matrix_binary<boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, boost::numeric::ublas::matrix_matrix_prod<double, double, double> >]'
/usr/local/include/boost/numeric/ublas/matrix.hpp:114: instantiated from `boost::numeric::ublas::matrix<T, F, A>::matrix(const boost::numeric::ublas::matrix_expression<E1>&) [with AE = boost::numeric::ublas::matrix_matrix_binary<boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, boost::numeric::ublas::matrix<double, boost::numeric::ublas::row_major, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, boost::numeric::ublas::matrix_matrix_prod<double, double, double> >, T = double, F = boost::numeric::ublas::row_major, A = boost::numeric::ublas::unbounded_array<double, std::allocator<double> >]'
test2.cpp:29: instantiated from here
/usr/local/include/boost/numeric/ublas/functional.hpp:1212: error: `BOOST_UBLAS_SAME' was not declared in this scope