Umut,
although not well advertised you may want to try to construct your matrices using a generalized_vector_of_vectors and then copy it to the final format (I think this is the fastest in Guntler's examples). It usually works better in random assignments, but I am not sure this will work for you.
Your timings suggest that you do, but I would like to remind to use -NDEBUG in your compilation options.
Best
Nasos
> Date: Mon, 9 Aug 2010 12:35:02 +0200
> From: u.tabak@tudelft.nl
> To: ublas@lists.boost.org
> Subject: Re: [ublas] recommendation for submatrix assignment
>
> On 08/09/2010 12:23 PM, Umut Tabak wrote:
> > Dear all,
> >
> > I was looking for some ways to assign submatrices efficiently in
> > ublas(I am using the precompiled binaries provided by Debian testing,
> > not the latest version of ublas), I have some questions on this and
> > would be glad if some experienced ones can help me:
> >
> > + which sparse matrix type is best suited for assignment(submatrix
> > assignment) and extraction? \
> As a follow up to my own question, using a compressed matrix in subrange
> assingment decreased the time substantially
>
> ...matrix is loading into boost sparse matrix...
> ...patience...
> ...matrix interfaced to boost in : 0.43
> ...matrix is being ported to PETSc sparseAIJ format...
> ...patience...
> ...matrix ported to PETSc in : 0.38
> starting subrange assignments
> ...patience...
> subrange assignments completed in : 0.43
>
> There is more to test, I guess, but would still appreciate pointers ;-)
>
> _______________________________________________
> ublas mailing list
> ublas@lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: nasos_i@hotmail.com