template < typename T > \
sparse_vector<T> \
operator op (const sparse_vector<T> & a, typename boost::call_traits<T>::param_type value) \
{ \
sparse_vector<T> res(a.size()); \
typename sparse_vector<T>::Map::const_iterator i = a.getMap().begin(); \
typename sparse_vector<T>::Map::const_iterator end = a.getMap().end(); \
for (; i != end; ++i) \
{ \
res[i->first] = i->second op value; \
} \
return res; \
} \
\
template < typename T > \
sparse_vector<T> \
operator op (typename boost::call_traits<T>::param_type value, const sparse_vector<T> & a) \
{ \
sparse_vector<T> res(a.size()); \
typename sparse_vector<T>::Map::const_iterator i = a.getMap().begin(); \
typename sparse_vector<T>::Map::const_iterator end = a.getMap().end(); \
for (; i != end; ++i) \
{ \
res[i->first] = value op i->second; \
} \
return res; \
} \