Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | Static Public Attributes | List of all members
CDPL::Shape::FastGaussianShapeOverlapFunction Class Reference

Shape::GaussianShapeOverlapFunction implementation that uses two approximation techniques to trade some accuracy for a substantial speedup compared to Shape::ExactGaussianShapeOverlapFunction. More...

#include <FastGaussianShapeOverlapFunction.hpp>

+ Inheritance diagram for CDPL::Shape::FastGaussianShapeOverlapFunction:

Public Types

typedef std::shared_ptr< FastGaussianShapeOverlapFunctionSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated FastGaussianShapeOverlapFunction instances. More...
 
- Public Types inherited from CDPL::Shape::GaussianShapeOverlapFunction
typedef std::shared_ptr< GaussianShapeOverlapFunctionSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated GaussianShapeOverlapFunction instances. More...
 
typedef std::function< bool(std::size_t)> ColorFilterFunction
 Type of the function used to filter color (pharmacophore) features by type. More...
 
typedef std::function< bool(std::size_t, std::size_t)> ColorMatchFunction
 Type of the function used to decide whether two color features match. More...
 

Public Member Functions

 FastGaussianShapeOverlapFunction ()
 Constructs the FastGaussianShapeOverlapFunction instance without associated shape functions. More...
 
 FastGaussianShapeOverlapFunction (const FastGaussianShapeOverlapFunction &func)
 Constructs a copy of the FastGaussianShapeOverlapFunction instance func. More...
 
 FastGaussianShapeOverlapFunction (const GaussianShapeFunction &ref_shape_func, const GaussianShapeFunction &ovl_shape_func)
 Constructs the FastGaussianShapeOverlapFunction instance with the given reference and aligned shape functions. More...
 
 ~FastGaussianShapeOverlapFunction ()
 Destructor. More...
 
void proximityOptimization (bool enable)
 Enables or disables the proximity-check pruning of Gaussian-product pair contributions. More...
 
bool proximityOptimization () const
 Tells whether the proximity-check pruning is enabled. More...
 
void setRadiusScalingFactor (double factor)
 Sets the scaling factor applied to Van der Waals radii during the proximity check. More...
 
double getRadiusScalingFactor () const
 Returns the currently configured radius scaling factor. More...
 
void fastExpFunction (bool enable)
 Enables or disables the use of a fast approximation for the exponential function. More...
 
bool fastExpFunction () const
 Tells whether the fast-exponential approximation is enabled. More...
 
void setShapeFunction (const GaussianShapeFunction &func, bool is_ref)
 Specifies the reference or aligned shape function used by the overlap evaluation. More...
 
const GaussianShapeFunctiongetShapeFunction (bool ref) const
 Returns the reference or aligned shape function. More...
 
void setColorMatchFunction (const ColorMatchFunction &func)
 Specifies the function used to decide whether two color features match. More...
 
const ColorMatchFunctiongetColorMatchFunction () const
 Returns the currently configured color-match function. More...
 
void setColorFilterFunction (const ColorFilterFunction &func)
 Specifies the function used to filter color features by type. More...
 
const ColorFilterFunctiongetColorFilterFunction () const
 Returns the currently configured color-filter function. More...
 
double calcSelfOverlap (bool ref) const
 Calculates the shape-only self-overlap of the reference or aligned shape function. More...
 
double calcColorSelfOverlap (bool ref) const
 Calculates the color self-overlap of the reference or aligned shape function. More...
 
double calcOverlap () const
 Calculates the shape-only overlap of the reference and aligned shape functions. More...
 
double calcColorOverlap () const
 Calculates the color overlap of the reference and aligned shape functions. More...
 
double calcOverlap (const Math::Vector3DArray &coords) const
 Calculates the shape-only overlap with the aligned shape element positions taken from coords. More...
 
double calcColorOverlap (const Math::Vector3DArray &coords) const
 Calculates the color overlap with the aligned shape element positions taken from coords. More...
 
double calcOverlapGradient (const Math::Vector3DArray &coords, Math::Vector3DArray &grad) const
 Calculates the shape overlap with the aligned shape element positions taken from coords and returns the gradient with respect to those positions. More...
 
FastGaussianShapeOverlapFunctionoperator= (const FastGaussianShapeOverlapFunction &func)
 Copy assignment operator. More...
 
- Public Member Functions inherited from CDPL::Shape::GaussianShapeOverlapFunction
virtual ~GaussianShapeOverlapFunction ()
 Virtual destructor. More...
 

Static Public Attributes

static constexpr double DEF_RADIUS_SCALING_FACTOR = 1.4
 Default scaling factor applied to Van der Waals radii for the proximity-check pruning. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Shape::GaussianShapeOverlapFunction
 GaussianShapeOverlapFunction ()
 
 GaussianShapeOverlapFunction (const GaussianShapeOverlapFunction &func)
 
GaussianShapeOverlapFunctionoperator= (const GaussianShapeOverlapFunction &func)
 

Detailed Description

Shape::GaussianShapeOverlapFunction implementation that uses two approximation techniques to trade some accuracy for a substantial speedup compared to Shape::ExactGaussianShapeOverlapFunction.

Two independent acceleration features can be enabled:

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated FastGaussianShapeOverlapFunction instances.

Constructor & Destructor Documentation

◆ FastGaussianShapeOverlapFunction() [1/3]

CDPL::Shape::FastGaussianShapeOverlapFunction::FastGaussianShapeOverlapFunction ( )

Constructs the FastGaussianShapeOverlapFunction instance without associated shape functions.

◆ FastGaussianShapeOverlapFunction() [2/3]

CDPL::Shape::FastGaussianShapeOverlapFunction::FastGaussianShapeOverlapFunction ( const FastGaussianShapeOverlapFunction func)

Constructs a copy of the FastGaussianShapeOverlapFunction instance func.

Parameters
funcThe FastGaussianShapeOverlapFunction to copy.

◆ FastGaussianShapeOverlapFunction() [3/3]

CDPL::Shape::FastGaussianShapeOverlapFunction::FastGaussianShapeOverlapFunction ( const GaussianShapeFunction ref_shape_func,
const GaussianShapeFunction ovl_shape_func 
)

Constructs the FastGaussianShapeOverlapFunction instance with the given reference and aligned shape functions.

Parameters
ref_shape_funcThe reference shape function.
ovl_shape_funcThe aligned shape function.

◆ ~FastGaussianShapeOverlapFunction()

CDPL::Shape::FastGaussianShapeOverlapFunction::~FastGaussianShapeOverlapFunction ( )

Destructor.

Member Function Documentation

◆ proximityOptimization() [1/2]

void CDPL::Shape::FastGaussianShapeOverlapFunction::proximityOptimization ( bool  enable)

Enables or disables the proximity-check pruning of Gaussian-product pair contributions.

Parameters
enabletrue to enable the proximity check, and false to disable it.

◆ proximityOptimization() [2/2]

bool CDPL::Shape::FastGaussianShapeOverlapFunction::proximityOptimization ( ) const

Tells whether the proximity-check pruning is enabled.

Returns
true if the proximity check is enabled, and false otherwise.

◆ setRadiusScalingFactor()

void CDPL::Shape::FastGaussianShapeOverlapFunction::setRadiusScalingFactor ( double  factor)

Sets the scaling factor applied to Van der Waals radii during the proximity check.

Parameters
factorThe new radius scaling factor.

◆ getRadiusScalingFactor()

double CDPL::Shape::FastGaussianShapeOverlapFunction::getRadiusScalingFactor ( ) const

Returns the currently configured radius scaling factor.

Returns
The radius scaling factor.

◆ fastExpFunction() [1/2]

void CDPL::Shape::FastGaussianShapeOverlapFunction::fastExpFunction ( bool  enable)

Enables or disables the use of a fast approximation for the exponential function.

Parameters
enabletrue to enable the fast-exponential approximation, and false to use the standard exponential.

◆ fastExpFunction() [2/2]

bool CDPL::Shape::FastGaussianShapeOverlapFunction::fastExpFunction ( ) const

Tells whether the fast-exponential approximation is enabled.

Returns
true if the fast-exponential approximation is enabled, and false otherwise.

◆ setShapeFunction()

void CDPL::Shape::FastGaussianShapeOverlapFunction::setShapeFunction ( const GaussianShapeFunction func,
bool  is_ref 
)
virtual

Specifies the reference or aligned shape function used by the overlap evaluation.

Parameters
funcThe shape function.
is_refIf true, func is the reference shape function; otherwise the aligned shape function.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ getShapeFunction()

const GaussianShapeFunction* CDPL::Shape::FastGaussianShapeOverlapFunction::getShapeFunction ( bool  ref) const
virtual

Returns the reference or aligned shape function.

Parameters
refIf true, the reference shape function is returned; otherwise the aligned shape function.
Returns
A pointer to the requested shape function (or nullptr if none is associated).

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ setColorMatchFunction()

void CDPL::Shape::FastGaussianShapeOverlapFunction::setColorMatchFunction ( const ColorMatchFunction func)
virtual

Specifies the function used to decide whether two color features match.

Parameters
funcThe color-match function.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ getColorMatchFunction()

const ColorMatchFunction& CDPL::Shape::FastGaussianShapeOverlapFunction::getColorMatchFunction ( ) const
virtual

Returns the currently configured color-match function.

Returns
A const reference to the color-match function.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ setColorFilterFunction()

void CDPL::Shape::FastGaussianShapeOverlapFunction::setColorFilterFunction ( const ColorFilterFunction func)
virtual

Specifies the function used to filter color features by type.

Parameters
funcThe color-filter function.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ getColorFilterFunction()

const ColorFilterFunction& CDPL::Shape::FastGaussianShapeOverlapFunction::getColorFilterFunction ( ) const
virtual

Returns the currently configured color-filter function.

Returns
A const reference to the color-filter function.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ calcSelfOverlap()

double CDPL::Shape::FastGaussianShapeOverlapFunction::calcSelfOverlap ( bool  ref) const
virtual

Calculates the shape-only self-overlap of the reference or aligned shape function.

Parameters
refIf true, the reference self-overlap is returned; otherwise the aligned self-overlap.
Returns
The self-overlap value.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ calcColorSelfOverlap()

double CDPL::Shape::FastGaussianShapeOverlapFunction::calcColorSelfOverlap ( bool  ref) const
virtual

Calculates the color self-overlap of the reference or aligned shape function.

Parameters
refIf true, the reference color self-overlap is returned; otherwise the aligned color self-overlap.
Returns
The color self-overlap value.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ calcOverlap() [1/2]

double CDPL::Shape::FastGaussianShapeOverlapFunction::calcOverlap ( ) const
virtual

Calculates the shape-only overlap of the reference and aligned shape functions.

Returns
The shape overlap value.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ calcColorOverlap() [1/2]

double CDPL::Shape::FastGaussianShapeOverlapFunction::calcColorOverlap ( ) const
virtual

Calculates the color overlap of the reference and aligned shape functions.

Returns
The color overlap value.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ calcOverlap() [2/2]

double CDPL::Shape::FastGaussianShapeOverlapFunction::calcOverlap ( const Math::Vector3DArray coords) const
virtual

Calculates the shape-only overlap with the aligned shape element positions taken from coords.

Parameters
coordsThe element 3D positions of the aligned shape.
Returns
The shape overlap value.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ calcColorOverlap() [2/2]

double CDPL::Shape::FastGaussianShapeOverlapFunction::calcColorOverlap ( const Math::Vector3DArray coords) const
virtual

Calculates the color overlap with the aligned shape element positions taken from coords.

Parameters
coordsThe element 3D positions of the aligned shape.
Returns
The color overlap value.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ calcOverlapGradient()

double CDPL::Shape::FastGaussianShapeOverlapFunction::calcOverlapGradient ( const Math::Vector3DArray coords,
Math::Vector3DArray grad 
) const
virtual

Calculates the shape overlap with the aligned shape element positions taken from coords and returns the gradient with respect to those positions.

Parameters
coordsThe element 3D positions of the aligned shape.
gradThe output element-wise gradient of the overlap.
Returns
The shape overlap value.

Implements CDPL::Shape::GaussianShapeOverlapFunction.

◆ operator=()

FastGaussianShapeOverlapFunction& CDPL::Shape::FastGaussianShapeOverlapFunction::operator= ( const FastGaussianShapeOverlapFunction func)

Copy assignment operator.

Parameters
funcThe other FastGaussianShapeOverlapFunction instance.
Returns
A reference to itself.

Member Data Documentation

◆ DEF_RADIUS_SCALING_FACTOR

constexpr double CDPL::Shape::FastGaussianShapeOverlapFunction::DEF_RADIUS_SCALING_FACTOR = 1.4
staticconstexpr

Default scaling factor applied to Van der Waals radii for the proximity-check pruning.


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