add the Eigen library implementations of normal distributions computations
This commit is contained in:
parent
3eefe9cd25
commit
f3e1562a14
5 changed files with 301 additions and 106 deletions
|
|
@ -31,7 +31,6 @@ Authors:
|
|||
#include "edoModifierMass.h"
|
||||
#include "edoNormalMulti.h"
|
||||
|
||||
|
||||
#ifdef WITH_BOOST
|
||||
|
||||
//! edoNormalMultiCenter< EOT >
|
||||
|
|
@ -44,15 +43,29 @@ public:
|
|||
|
||||
void operator() ( edoNormalMulti< EOT >& distrib, EOT& mass )
|
||||
{
|
||||
ublas::vector< AtomType > mean( distrib.size() );
|
||||
std::copy( mass.begin(), mass.end(), mean.begin() );
|
||||
distrib.mean() = mean;
|
||||
ublas::vector< AtomType > mean( distrib.size() );
|
||||
std::copy( mass.begin(), mass.end(), mean.begin() );
|
||||
distrib.mean() = mean;
|
||||
}
|
||||
};
|
||||
|
||||
#else
|
||||
#ifdef WITH_EIGEN
|
||||
|
||||
template < typename EOT >
|
||||
class edoNormalMultiCenter : public edoModifierMass< edoNormalMulti< EOT > >
|
||||
{
|
||||
public:
|
||||
typedef typename EOT::AtomType AtomType;
|
||||
|
||||
void operator() ( edoNormalMulti< EOT >& distrib, EOT& mass )
|
||||
{
|
||||
assert( distrib.size() == mass.innerSize() );
|
||||
Eigen::Matrix< AtomType, Eigen::Dynamic, 1 > mean( mass );
|
||||
distrib.mean() = mean;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // WITH_EIGEN
|
||||
#endif // WITH_BOOST
|
||||
|
||||
|
|
|
|||
Reference in a new issue