Boost logo

Ublas :

Subject: [ublas] Problem creating mapping from string to vector_expression
From: SHIVAM MITTAL (2015csb1032_at_[hidden])
Date: 2017-03-30 13:30:22


Hi,

I have been trying to create a mapping from string to
ublas::vector_expression.

template <class T>
boost::unordered_map<std::string, vector_expression <T> > c;

vector<int> v (10);
for (unsigned i = 0; i < v.size (); ++ i)
v (i) = i;
c <int>["first"] = v;

I have been getting this error :
error: no match for ‘operator=’ (operand types are
‘boost::unordered::unordered_map<std::__cxx11::basic_string<char>,
boost::numeric::ublas::vector_expression<int>,
boost::hash<std::__cxx11::basic_string<char> >,
std::equal_to<std::__cxx11::basic_string<char> >,
std::allocator<std::pair<const std::__cxx11::basic_string<char>,
boost::numeric::ublas::vector_expression<int> > > >::mapped_type {aka
boost::numeric::ublas::vector_expression<int>}’ and
‘boost::numeric::ublas::vector<int>’)
   columns <int>["first"] = v;

Please help.