[gmx-developers] add a new autocorrelation function.

Xavier Periole X.Periole at rug.nl
Fri Jan 11 18:36:08 CET 2008



> I'm presuming you know what the bitwise-left-shift << and bitwise-or | 
>operators do.

Well I don't. but your explanation help.

The use of
#define eacNewOption (1<<9)
worked (I actually put the option at position zero and shifted the others).

Then I realized that the autocorrelation function was done through the
ft loop which I was not expecting. Then after fixing some bugs the thins
is now running smoothly ...

Thanks.
XAvier

> 
> You can see in autocorr.c that these get used in a macro test 
>"MODE(eacVector)", which is defined in that file and expands to "(mode & 
>(eacVector)) == (eacVector)". If eacVector contains particular bits set 
>(often only one, as here in the definition from gstat.h), then the test 
>evaluates as true if and only if mode has the bits defined in eacVector set. 
>This is called "masking" and eacVector is a "bitmask". mode can also have 
>other bits set, and from the gstat.h definition, you might infer that 
>eacRcross and eacP* are particular instances of eacVector. So MODE(eacVector) 
>will be true if mode == eacP4, but not if mode == eacCos. This kind of thing 
>is a commonly-used strategy in C to have a single flag variable that controls 
>the detail of an operation, and GROMACS uses it all over the place. Here's 
>some info which might be helpful 
>http://de-coded.blogspot.com/2006/05/basic-bit-masks.html
> 
> Since mode is an unsigned long, there are many more bits to play around 
>with, and you can try
> 
> #define eacNewOption (1<<9)
> 
> and see if it works. You may or may not want the "| eacVector", but you'll 
>have to judge that from understanding the detail of the code, which I don't.
> 
> Cheers,
> 
> Mark
> _______________________________________________
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the www interface 
>or send it to gmx-developers-request at gromacs.org.

-----------------------------------------------------
XAvier Periole - PhD

NMR & Molecular Dynamics Group
University of Groningen
The Netherlands
http://md.chem.rug.nl/~periole
-----------------------------------------------------



More information about the gromacs.org_gmx-developers mailing list