Hi Zhang, you wrote:
the following code generates a compile error raising from a macro in /ublas/traits.hpp: BOOST_STATIC_ASSERT ((boost::is_same
::value)); Because I'm trying to prod on a vector of size_t and a matrix of unsigned char.
Because I want to save memory (the matrix is really huge) and I know the value in m will never exceed 255. The expression is ok to me (of course the result value is size_t). But the ASSERT prevent me from doing this.
Is there a workaround that permits me doing this kind of case without sacrificing the memory efficiency?
I'd try to add specializations of the form
template<>
struct promote_traits
Using size_t in the matrix will use three times more memory.
Looks like you're working on an interesting problem :-)
ublas::vector
v1(5); matrix<unsigned char> m(5,5); prod(m,v1); the same problem arises when I do prod(m,v2); here v2 is a vector<double>
The same solution should apply here. HTH, Joerg