Boost logo

Boost :

From: Joerg Walter (jhr.walter_at_[hidden])
Date: 2002-12-03 02:46:06

----- Original Message -----
From: "Stas Fomin" <stas_at_[hidden]>
To: "Boost mailing list" <boost_at_[hidden]>
Sent: Monday, December 02, 2002 9:31 PM
Subject: Re: [boost] UBLAS: preserving matrix resize.

> Thanks for the answer!
> > > I have to make matrix resize with preserving of the content of the
> > > (add rows, columns...)
> >
> > I've just tested the following program under GCC 3.1:
> >
> > ----------
> > #include <boost/numeric/ublas/vector.hpp>
> ....
> >
> > typedef ublas::matrix<double> Mat;
> This sample works if "typedef ublas::matrix<double> Mat;"
> and does not work with "typedef
ublas::sparse_matrix<double,ublas::column_major> Mat";

I understand. This is probably a bug in the 1_29_0 release: I've just tested
that change against the CVS version and see the same results as in the dense

> > > 2. How to do "preserving matrix resize" efficiently?
> >
> > I.e. without copying/swapping? Why don't you start with your final
> > referencing the smaller sub matrices via matrix_range<>?
> This isn't clear to me. What do you mean?
> I write reading matrices from files in some sparsed formats
(MatrixMarket, MPS).
> I will implement one-pass reading, so the number of rows, columns and
> are not known in advance.
> I use "sparse_matrix<double,column_major,std::map>" for fast random
> and I will to know how implement "preserving matrix resize" efficiently.
> The only way I found does not work :(.

Sorry for inconvenience. If you upgrade to the CVS version, you may also
consider to use the new coordinate_matrix implementing Fortran COO storage

> Also I plan to use uBLAS in some linear programming algorithms,
> so adding/deleting rows/columns in sparse matrices will be very



Boost list run by bdawes at, gregod at, cpdaniel at, john at