<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 6 Jun 2014, at 15:40, David Waterman &lt;<a href="mailto:dgwaterman@gmail.com">dgwaterman@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">I don't intend to assign any particular index in the matrix_column</span><br style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">more than once. I'm not sure if that perhaps gives me the upper hand</span><br style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">wrt the trade-offs you mention?</span></blockquote></div><br><div>That's the other way around actually: I designed the sparse columns so as to make operations like&nbsp;</div><div>x(i) += 1.0 or x(i) = 2.0<span class="Apple-tab-span" style="white-space:pre">                        </span>(a)</div><div>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).</div><div><br></div><div>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.&nbsp;</div><div><br></div><div>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.&nbsp;</div><div><br></div><div>Best wishes,</div><div><br></div><div>Luc</div><div><br></div></body></html>