I have two matrices, m1 and m2. So long as they are the same size (currently both are 2x2) then the following statement works just fine:

cout << prod(m1, m2) << endl;


However, when I change the size of either matrices I get the following error at compile time:

Assertion failed in file /usr/include/boost/numeric/ublas/functional.hpp at line 1212:
size1 == size2
terminate called after throwing an instance of 'boost::numeric::ublas::bad_argument'
  what():  bad argument
Aborted


Does anyone know what I am doing wrong?