Matrix initialization at run-time

Jaime Ambrus <[email protected]> Mon, 20 Feb 2006 09:49:21 -0300
Newsgroups gmane.comp.lib.mtl.devel
Message-ID <[email protected]>
Hi...

I'm developing a code to calculate heat transfer problems in linux and I would
like to use a sparse matrix to store the linear system elements.
I was giving a look in the MTL examples and the sparse initilization is done
using  arrays, but that is known at compilation time. I also tried pointers but
the compilation failed. In ITL examles (Blas interface) there's some
initialization using std::vectors but how do it at run time if there's no
function to initialize the matrix and I can not call the constructor later??? I
could use a dense matrix and copy it to a sparse one, but for large linear
systems it is too slow...

My basic idea is something like this..

Matrix A(); // initialization in some header file..  in some class for example
            //I don't know the size at this point
//read files and calculate some
//stuff  to initilize the matrix - vector or pointer ...

A.Initilize(...); // or
A.sparse_matrix(n,nn,nnz,*vec, /*or whatever i need */);//call in some way the
constructor again

Does someone have an idea ???

Thanks

___________________________________________________________
Jaime Ambrus.

SINMEC - Computational Fluid Dynamics Laboratory.
                www.sinmec.ufsc.br

Florianópolis - SC - Brazil.

_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/