Hi Luc,
That sounds great, thank you.
Cheers
-- David
On 6 June 2014 15:06, Luc Bourhis
On 6 Jun 2014, at 15:40, David Waterman
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 [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb