Boost logo

Ublas :

From: Benny Buerger (bbuerger_at_[hidden])
Date: 2008-02-12 11:51:09


I'm a ublas newbie and have a basic question about memory allocation
with ublas. Is it valid to assign a matrix in a local function and then
use it in other functions, or do I have to use pointers?

Here is a short example.

class X
        int sizex, sizey;
        void init();
        ublas::matrix<double> mat1;


void X::init()
        mat1 = ublas::matrix<double>(sizex,sizey);

void X::useMatrix()
        std::cout << mat1;

Is mat1 always defined after calling init() ?

thx in advance
Benny Bürger