+ do files
This commit is contained in:
parent
d55182a8b0
commit
a038586edb
27 changed files with 1439 additions and 0 deletions
28
src/doUniformCenter.h
Normal file
28
src/doUniformCenter.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue