maybe you have to use boost::numeric::ublas::prod in order to force the
use of the correct namespace.
Since they have a higher algorithmic complexity, nested matrix products without the use of a temporary are not supported in uBLAS. You will not be able to use the following code
R = prod(A, prod(B,C)); //Does not compile
Instead, uBLAS provides 3 alternative syntaxes for this purpose given a user chosen temp_type:
temp_type T = prod(B,C); R = prod(A,T); //Manual use of a temporary
prod(A, temp_type(prod(B,C)); //Constructs a temp_type with the prod(B,C) expression
prod(A, prod(B,C,T)); //Uses the T value as a temporary for calculation in preallocated T.
Users will want to manage their own temporary matrix types for nested matrix products to ensure maximum efficiency. For example:
matrix<double> A(2,2), B(2,2), C(2,2); //... fill in
matrix<double> T(2,2); //A natural, preallocated temporary
prod(A, prod(B,C,T));
or to have dynamic allocation:
prod(A, matrix<double>(prod(B,C))); //Dynamically allocates temporary
or use a more efficient matrix type given the structure of A,B,C:
bounded_matrix<double, 2, 2> A, B, C; //... fill in
prod(A, bounded_matrix<double, 2, 2>(prod(B, C));