Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | List of all members
CDPL::Descr::RDFCodeCalculator< T > Class Template Reference

RDFCodeCalculator. More...

#include <RDFCodeCalculator.hpp>

+ Inheritance diagram for CDPL::Descr::RDFCodeCalculator< T >:

Public Types

typedef T EntityType
 
typedef std::function< double(const EntityType &, const EntityType &)> EntityPairWeightFunction
 Type of the generic functor class used to store a user-defined entity pair weight function. More...
 
typedef std::function< const Math::Vector3D &(const EntityType &)> Entity3DCoordinatesFunction
 Type of the generic functor class used to store a user-defined entity 3D coordinates function. More...
 

Public Member Functions

 RDFCodeCalculator ()
 Constructs the RDFCodeCalculator instance. More...
 
void setSmoothingFactor (double factor)
 Allows to specify the smoothing factor used in the calculation of entity pair RDF contributions. More...
 
double getSmoothingFactor () const
 Returns the smoothing factor used in the calculation of entity pair RDF contributions. More...
 
void setScalingFactor (double factor)
 Allows to specify the scaling factor for the RDF code elements. More...
 
double getScalingFactor () const
 Returns the scaling factor applied to the RDF code elements. More...
 
void setStartRadius (double start_radius)
 Sets the starting value of the radius. More...
 
double getStartRadius () const
 Returns the starting value of the radius. More...
 
void setRadiusIncrement (double radius_inc)
 Sets the radius step size between successive RDF code elements. More...
 
double getRadiusIncrement () const
 Returns the radius step size between successive RDF code elements. More...
 
void setNumSteps (std::size_t num_steps)
 Sets the number of desired radius incrementation steps. More...
 
std::size_t getNumSteps () const
 Returns the number of performed radius incrementation steps. More...
 
void setEntityPairWeightFunction (const EntityPairWeightFunction &func)
 Allows to specify a custom entity pair weight function. More...
 
void setEntity3DCoordinatesFunction (const Entity3DCoordinatesFunction &func)
 Allows to specify the entity 3D coordinates function. More...
 
void enableDistanceToIntervalCenterRounding (bool enable)
 Allows to specify whether entity pair distances should be rounded to the nearest radius interval center. More...
 
bool distanceToIntervalsCenterRoundingEnabled () const
 Tells whether entity pair distances get rounded to the nearest radius interval centers. More...
 
template<typename Iter , typename Vec >
void calculate (Iter beg, Iter end, Vec &rdf_code)
 Calculates the RDF code of an entity sequence. More...
 

Detailed Description

template<typename T>
class CDPL::Descr::RDFCodeCalculator< T >

RDFCodeCalculator.

See also
[CITB, HBMD]

Member Typedef Documentation

◆ EntityType

template<typename T >
typedef T CDPL::Descr::RDFCodeCalculator< T >::EntityType

◆ EntityPairWeightFunction

template<typename T >
typedef std::function<double(const EntityType&, const EntityType&)> CDPL::Descr::RDFCodeCalculator< T >::EntityPairWeightFunction

Type of the generic functor class used to store a user-defined entity pair weight function.

The specified function (or function object) is required to take the two entitys (as a const reference to EntityType) as its arguments and return the weight of the entity pair as a floating-point value of type double (see [FUNWRP]).

◆ Entity3DCoordinatesFunction

template<typename T >
typedef std::function<const Math::Vector3D&(const EntityType&)> CDPL::Descr::RDFCodeCalculator< T >::Entity3DCoordinatesFunction

Type of the generic functor class used to store a user-defined entity 3D coordinates function.

The provided specified function (or function object) is required to take the entity (as a const reference to EntityType) as its argument and return the coordinates of the entity as a const reference to Math::Vector3D (see [FUNWRP]).

Constructor & Destructor Documentation

◆ RDFCodeCalculator()

Constructs the RDFCodeCalculator instance.

Member Function Documentation

◆ setSmoothingFactor()

template<typename T >
void CDPL::Descr::RDFCodeCalculator< T >::setSmoothingFactor ( double  factor)

Allows to specify the smoothing factor used in the calculation of entity pair RDF contributions.

Parameters
factorThe smoothing factor.
Note
The default value of the smoothing factor is 1.0.

◆ getSmoothingFactor()

template<typename T >
double CDPL::Descr::RDFCodeCalculator< T >::getSmoothingFactor

Returns the smoothing factor used in the calculation of entity pair RDF contributions.

Returns
The applied smoothing factor.

◆ setScalingFactor()

template<typename T >
void CDPL::Descr::RDFCodeCalculator< T >::setScalingFactor ( double  factor)

Allows to specify the scaling factor for the RDF code elements.

Parameters
factorThe scaling factor.
Note
The default scaling factor is 1.0.

◆ getScalingFactor()

template<typename T >
double CDPL::Descr::RDFCodeCalculator< T >::getScalingFactor

Returns the scaling factor applied to the RDF code elements.

Returns
The applied scaling factor.

◆ setStartRadius()

template<typename T >
void CDPL::Descr::RDFCodeCalculator< T >::setStartRadius ( double  start_radius)

Sets the starting value of the radius.

Parameters
start_radiusThe starting value of the radius.
Note
The default starting radius is 0.0Å.

◆ getStartRadius()

template<typename T >
double CDPL::Descr::RDFCodeCalculator< T >::getStartRadius

Returns the starting value of the radius.

Returns
The current radius starting value.

◆ setRadiusIncrement()

template<typename T >
void CDPL::Descr::RDFCodeCalculator< T >::setRadiusIncrement ( double  radius_inc)

Sets the radius step size between successive RDF code elements.

Parameters
radius_incThe radius step size.
Note
The default radius step size is 0.1Å.

◆ getRadiusIncrement()

template<typename T >
double CDPL::Descr::RDFCodeCalculator< T >::getRadiusIncrement

Returns the radius step size between successive RDF code elements.

Returns
The applied radius step size.

◆ setNumSteps()

template<typename T >
void CDPL::Descr::RDFCodeCalculator< T >::setNumSteps ( std::size_t  num_steps)

Sets the number of desired radius incrementation steps.

The number of performed radius incrementation steps defines the size of the calculated RDF code vector which is equal to the number of steps plus 1.

Parameters
num_stepsThe number of radius incrementation steps.
Note
The default number of steps is 99.

◆ getNumSteps()

template<typename T >
std::size_t CDPL::Descr::RDFCodeCalculator< T >::getNumSteps

Returns the number of performed radius incrementation steps.

Returns
The number of performed radius incrementation steps.

◆ setEntityPairWeightFunction()

template<typename T >
void CDPL::Descr::RDFCodeCalculator< T >::setEntityPairWeightFunction ( const EntityPairWeightFunction func)

Allows to specify a custom entity pair weight function.

Parameters
funcA RDFCodeCalculator::EntityPairWeightFunction instance that wraps the target function.
Note
The default entity pair weight function returns the value 1.

◆ setEntity3DCoordinatesFunction()

template<typename T >
void CDPL::Descr::RDFCodeCalculator< T >::setEntity3DCoordinatesFunction ( const Entity3DCoordinatesFunction func)

Allows to specify the entity 3D coordinates function.

Parameters
funcA RDFCodeCalculator::Entity3DCoordinatesFunction instance that wraps the target function.
Note
The coordinates function must be specified before calling calculate(), otherwise a zero distance for each entity pair will be used for the calculation.

◆ enableDistanceToIntervalCenterRounding()

template<typename T >
void CDPL::Descr::RDFCodeCalculator< T >::enableDistanceToIntervalCenterRounding ( bool  enable)

Allows to specify whether entity pair distances should be rounded to the nearest radius interval center.

Parameters
enabletrue if pair distances should be rounded, and false otherwise.
Note
The default setting is not to round the entity pair distances.

◆ distanceToIntervalsCenterRoundingEnabled()

template<typename T >
bool CDPL::Descr::RDFCodeCalculator< T >::distanceToIntervalsCenterRoundingEnabled

Tells whether entity pair distances get rounded to the nearest radius interval centers.

Returns
true if pair distances get rounded, and false otherwise.

◆ calculate()

template<typename T >
template<typename Iter , typename Vec >
void CDPL::Descr::RDFCodeCalculator< T >::calculate ( Iter  beg,
Iter  end,
Vec &  rdf_code 
)

Calculates the RDF code of an entity sequence.

The elements of the returned RDF code vector correspond to the values of the radial distribution function at different radii. The first element provides the RDF value at the start radius (see setStartRadius()) which gets incremented by the radius step size (see setRadiusIncrement()) for each successive element. The total number of calculated RDF values (corresponds to the RDF code vector's length) is given by the specified number of incrementation steps (see setNumSteps()) plus 1.

Parameters
begAn iterator pointing to the beginning of the entity sequence.
endAn iterator pointing one past the end of the entity sequence.
rdf_codeThe calculated RDF code vector.

The documentation for this class was generated from the following file: