+ do files

This commit is contained in:
Caner Candan 2010-07-05 19:04:35 +02:00
commit a038586edb
27 changed files with 1439 additions and 0 deletions

28
src/doUniformCenter.h Normal file
View file

@ -0,0 +1,28 @@
#ifndef _doUniformCenter_h
#define _doUniformCenter_h
#include "doModifierMass.h"
#include "doUniform.h"
template < typename EOT >
class doUniformCenter : public doModifierMass< doUniform< EOT > >
{
public:
typedef typename EOT::AtomType AtomType;
void operator() ( doUniform< EOT >& distrib, EOT& mass )
{
for (unsigned int i = 0, n = mass.size(); i < n; ++i)
{
AtomType& min = distrib.min()[i];
AtomType& max = distrib.max()[i];
AtomType range = (max - min) / 2;
min = mass[i] - range;
max = mass[i] + range;
}
}
};
#endif // !_doUniformCenter_h