I have a templated sparse_vector<T> class, and I am also using Boost UBLAS. How would I provide implicit conversions between sparse_vector<double> and boost::numeric::ublas::compressed_vector<double>?
I would also like to provide similar conversions between std::vector<double> and boost::numeric::ublas::vector<double>.
(I am using gcc 4.4 with C++0x enabled.)
I’d assume that there’s an iterator constructor for these types. If that assumption is accurate then it would be as simple as writing something like so:
Use like:
compressed_vector<double> vect = vector_cast<compressed_vector<double> >(my_sparse_vector);