[cctbxbb] sparse matrix

David Waterman dgwaterman at gmail.com
Fri Jun 6 08:23:33 PDT 2014


Hi Luc,

That sounds great, thank you.

Cheers
-- David


On 6 June 2014 15:06, Luc Bourhis <luc_j_bourhis at mac.com> wrote:
>
> On 6 Jun 2014, at 15:40, David Waterman <dgwaterman at gmail.com> wrote:
>
> I don't intend to assign any particular index in the matrix_column
> more than once. I'm not sure if that perhaps gives me the upper hand
> wrt the trade-offs you mention?
>
>
> That's the other way around actually: I designed the sparse columns so as to
> make operations like
> x(i) += 1.0 or x(i) = 2.0 (a)
> basically O(1), at the price of wasting some memory, and the necessity of
> calling x.compact() when the construction of the vector is finished. On the
> contrary, reading x(i) is O(log n) where n is the number of non-zero
> elements in x. I chose that because operations (a) are repeated many times
> to build a Jacobian by pieces and composition (the aim was constraints for
> small molecule crystallography). On the contrary, all sparse algorithms can
> be written so as to avoid indexing (by iterating through the known non-zero
> elements).
>
> Actually, looking at my code, I realise that I designed it so that compact()
> is called as needed! You don't need to do it explicitly.
>
> In any case, it looks like the right structure if you want to deal with
> sparse Jacobian indeed. Ok, no problem, I'll add selection then.
>
> Best wishes,
>
> Luc
>
>
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb
>


More information about the cctbxbb mailing list