On Thursday 14 November 2002 02:51, agiatojon wrote:
Hello all,
I am trying to compile the following code snippet from the documentation of matrix_expressions in which two matrices are used to display the use of addition and subtraction operations. I am not really sure how to post the error messages as there are literally hundreds of them, so here is the code as I am am pretty sure this is going to be one of those well known bugs kind of things. Compiled using VS.NET, debug mode.
#include <iostream>
// include matrix.hpp instead of matrix_expression.hpp
#include
int main() { using namespace boost::numeric::ublas;
matrix<double> m1(3, 3), m2(3, 3);
for(int i = 0; i < std::min(m1.size1(), m2.size1()); ++i) for(int j = 0; j < std::min(m1.size2(), m2.size2()); ++j) m1(i, j) = m2(i, j) = 3 * i + j;
std::cout << m1 + m2 << std::endl; std::cout << m1 - m2 << std::endl;
std::cin.get(); return EXIT_SUCCESS; }
With these two changes, it should work (at least on my linux box)