Boost logo

Boost Users :

From: agiatojon (JonAgiato_at_[hidden])
Date: 2002-11-13 20:51:27


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 <boost/numeric/ublas/matrix_expression.hpp>

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;
}

Thanks!

Jon Agiato
JonAgiato_at_[hidden]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net