Boost logo

Glas :

Re: [glas] A few more thoughts about return type of operator[](size_type) for sparse vectors

From: Peter Gottschling (pgottsch_at_[hidden])
Date: 2006-04-27 11:04:00

On 26.04.2006, at 15:03, Toon Knapen wrote:

> Christophe Sanz wrote:
>> I think I could see that the MTL deserve no room for changing nnz,
> [snip]
No, it does change. In MTL 2 (the last released version) the structure
is modified implicitly each time a zero matrix element is changed.
This behavior is very handy but not very efficient.

In the new, not yet released version, matrices are per se constant. To
change a matrix, an inserter object has to be defined which enables
efficient insertion. Upon destruction of the inserter the matrix is
compressed. Other libraries use this insertion-only, read-only
approach too. The difference is that one can have more than one
insertion phase by defining another inserter later. The question
whether we will allow reading (less efficient) during the insertion
phase is still under consideration. However, I will write this down in
detail and provide some performance comparisons.


Peter Gottschling
Research Associate
Open Systems Laboratory
Indiana University
301i Lindley Hall
Bloomington, IN 47405
Tel.: +1 812 855-8898 Fax: +1 812 856 0853