Boost logo

Boost Users :

From: Ed (linux_at_[hidden])
Date: 2008-08-06 13:26:15


 From an example on teh Boost website, I can use matrix as follows:

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>

int main () {
    using namespace boost::numeric::ublas;
    matrix<double> m (3, 3);

    for (unsigned i = 0; i < m.size1 (); ++ i)
        for (unsigned j = 0; j < m.size2 (); ++ j)
            m (i, j) = 3 * i + j;
    std::cout << m << std::endl;
}

But I want to use Boost matrix where I don't know the size at the time
the matrix is declared.
I want to do something like

matrix<double> *m;

then later

m=new matrix<double>

How do I do this?

Ed


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