<div dir="ltr">Hi,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 4, 2013 at 5:51 PM, Roland Schulz <span dir="ltr">&lt;<a href="mailto:roland@utk.edu" target="_blank">roland@utk.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="im">On Mon, Feb 4, 2013 at 4:00 AM, Alexey Shvetsov <span dir="ltr">&lt;<a href="mailto:alexxy@omrb.pnpi.spb.ru" target="_blank">alexxy@omrb.pnpi.spb.ru</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">1. Its incompatible with most functions in old gmxlib (e.g. Cannot use<br>

functions like reset_x, do_fit, calc_xcm etc.).<br></blockquote></div><div>You can convert sel to atom_id by:</div><div>sel_[i].atomIndices().data()<br></div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
For #1 may be its time to reimplement needed functions using new api.<br></blockquote></div><div style="color:rgb(34,34,34)">Any help with that is greatly appreciated :-)</div><div class="im"></div></div></div></div></blockquote>
<div></div></div></div></div></div></blockquote><div><br></div><div style>It is also possible to add a few methods to the Selection class that give out the data as raw arrays (or rather, as ConstArrayRef&lt;&gt;), similar to the atomIndices() example. That should make it possible to pass the data into any function that expects a C array. Having accessors like this places some restrictions on the internal implementation (since the implementation needs to be able to produce such continuous arrays, preferably without copying), but right now, that is not a problem.</div>
<div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


2. It may be easyer to work with atomdata if selections will not be marked<br>
static. E.g. sel.position(i).x()<br></blockquote></div><div>I suppose you mean const? I think it makes sense that they are const. I think you should make a copy of them before modifying them.</div></div></div></div></blockquote>
<div><br></div><div style>It makes a lot of sense for them to be const, as it makes the structure of the code a lot clearer. The selection code is responsible for evaluating the selections in any way it sees fit (including sharing the memory that is used for the results), and giving any caller the possibility to change the internals makes the code more difficult to understand and maintain. As Roland says, you can always copy them into a separate array (will comment on the mechanism for that separately).</div>
<div style><br></div><div style>Teemu</div><div style><br></div></div></div></div>