[gmx-developers] Some thoughts about new trajectory analisys api

David van der Spoel spoel at xray.bmc.uu.se
Tue Feb 5 20:07:38 CET 2013


On 2013-02-05 01:17, Roland Schulz wrote:
>
>
>
> On Mon, Feb 4, 2013 at 3:41 PM, Schulz, Roland <rschulz3 at utk.edu
> <mailto:rschulz3 at utk.edu>> wrote:
>
>
>
>
>     On Mon, Feb 4, 2013 at 2:35 PM, Alexey Shvetsov
>     <alexxy at omrb.pnpi.spb.ru <mailto:alexxy at omrb.pnpi.spb.ru>> wrote:
>
>         В письме от 4 февраля 2013 10:51:29 пользователь Roland Schulz
>         написал:
>          > On Mon, Feb 4, 2013 at 4:00 AM, Alexey Shvetsov
>
>          >
>
>          > > 2. It may be easyer to work with atomdata if selections
>         will not be marked
>          > > static. E.g. sel.position(i).x()
>          >
>          > 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.
>          >
>
>         Ghmm may be there should be some kind of helper function to copy
>         sel class?
>
>     Why would you want to copy sel? I thought it would be sufficient to
>     copy x. angle.cpp has a copy_pos. It might be nice to have that in
>     Selection, e.g.:
>     void copy_x(int first, int last, rvec x[]) const;
>
>
> Actually that suggestion is very non-std like. It combines access to the
> complete range of coordinates ,with the algorithm (copy), and thus is
> less flexible because these two things can't be combined differently.
> So it might be better to provide: "iterator xBegin()" and "iterator
> xEnd()". That would allow to copy using:
> "std::copy(sel.xBegin(),sel.xEnd(),out)".
> But I'm not sure we discussed how much we want to make use of iterators.
> Our modified version changes that mpp uses iterators and we think it got
> better/more flexible by doing that. I think Teemu tried to avoid them.
> So this is probably something we should discuss.

Iterators are not mentioned at all on 
http://www.gromacs.org/index.php?title=Developer_Zone/Programming_Guide/Allowed_C%2B%2B_Features

I thought this was the purpose of the C++ move to use smart features in 
the language. I'm coding a bit of C++ in OpenBabel and also for some new 
features in gromacs and was planning to use iterators there too. Even 
though they are a bit tedious to implement they make the code very 
clear. By the way, I'm talking about std iterators, as in

typedef std::vector<MyClass>::iterator MyClassIterator;



>
> Roland
>
>
>          > > For #1 may be its time to reimplement needed functions
>         using new api.
>          >
>          > Any help with that is greatly appreciated :-)
>         Well I'll reimplement some needed functions like i did in
>         https://gerrit.gromacs.org/#/c/2108/
>
>
>     Great! But given that those functions are general they shouldn't be
>     in the ProteinFilamentGeometry class.
>
>     Roland
>
>
>          >
>
>          > > Is there a way to mark output or input files non optional
>         with predefined
>          > > value
>          > > like it was possible with old api?
>          >
>          > See defaultBasename and required
>          >
>          > Roland
>          >
>
>         --
>         Best Regards,
>         Alexey 'Alexxy' Shvetsov
>         Petersburg Nuclear Physics Institute, NRC Kurchatov Institute,
>         Gatchina, Russia
>         Department of Molecular and Radiation Biophysics
>         Gentoo Team Ru
>         Gentoo Linux Dev
>         mailto:alexxyum at gmail.com <mailto:alexxyum at gmail.com>
>         mailto:alexxy at gentoo.org <mailto:alexxy at gentoo.org>
>         mailto:alexxy at omrb.pnpi.spb.ru <mailto:alexxy at omrb.pnpi.spb.ru>
>
>
>
>
>     --
>     ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
>     <http://cmb.ornl.gov>
>     865-241-1537 <tel:865-241-1537>, ORNL PO BOX 2008 MS6309
>
>
>
>
> --
> ORNL/UT Center for Molecular Biophysics cmb.ornl.gov <http://cmb.ornl.gov>
> 865-241-1537, ORNL PO BOX 2008 MS6309
>
>


-- 
David van der Spoel, Ph.D., Professor of Biology
Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:	+46184714205.
spoel at xray.bmc.uu.se    http://folding.bmc.uu.se



More information about the gromacs.org_gmx-developers mailing list