Chemical Data Processing Library C++ API - Version 1.4.0
ExactGaussianShapeOverlapFunction.hpp
Go to the documentation of this file.
1 /*
2  * ExactGaussianShapeOverlapFunction.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_SHAPE_EXACTGAUSSIANSHAPEOVERLAPFUNCTION_HPP
30 #define CDPL_SHAPE_EXACTGAUSSIANSHAPEOVERLAPFUNCTION_HPP
31 
32 #include <memory>
33 
34 #include "CDPL/Shape/APIPrefix.hpp"
36 
37 
38 namespace CDPL
39 {
40 
41  namespace Shape
42  {
43 
44  class GaussianProductList;
45 
54  {
55 
56  public:
58  typedef std::shared_ptr<ExactGaussianShapeOverlapFunction> SharedPointer;
59 
62 
68 
75  const GaussianShapeFunction& ovl_shape_func);
76 
79 
85  void setShapeFunction(const GaussianShapeFunction& func, bool is_ref);
86 
92  const GaussianShapeFunction* getShapeFunction(bool ref) const;
93 
99 
105 
111 
117 
123  double calcSelfOverlap(bool ref) const;
124 
130  double calcColorSelfOverlap(bool ref) const;
131 
136  double calcOverlap() const;
137 
142  double calcColorOverlap() const;
143 
149  double calcOverlap(const Math::Vector3DArray& coords) const;
150 
156  double calcColorOverlap(const Math::Vector3DArray& coords) const;
157 
164  double calcOverlapGradient(const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const;
165 
172 
173  private:
174  bool checkShapeFuncsNotNull() const;
175 
176  double calcOverlap(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
177  bool color) const;
178  double calcOverlap(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
179  const Math::Vector3DArray& coords,
180  bool color) const;
181  double calcOverlapGradient(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
182  const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const;
183 
184  const GaussianShapeFunction* refShapeFunc;
185  const GaussianShapeFunction* ovlShapeFunc;
186  ColorMatchFunction colorMatchFunc;
187  ColorFilterFunction colorFilterFunc;
188  };
189  } // namespace Shape
190 } // namespace CDPL
191 
192 #endif // CDPL_SHAPE_EXACTGAUSSIANSHAPEOVERLAPFUNCTION_HPP
Definition of class CDPL::Shape::GaussianShapeOverlapFunction.
Definition of the preprocessor macro CDPL_SHAPE_API.
#define CDPL_SHAPE_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Shape::GaussianShapeOverlapFunction implementation that evaluates the overlap analytically using the ...
Definition: ExactGaussianShapeOverlapFunction.hpp:54
const ColorFilterFunction & getColorFilterFunction() const
Returns the currently configured color-filter function.
double calcColorSelfOverlap(bool ref) const
Calculates the color self-overlap of the reference or aligned shape function.
double calcSelfOverlap(bool ref) const
Calculates the shape-only self-overlap of the reference or aligned shape function.
void setColorMatchFunction(const ColorMatchFunction &func)
Specifies the function used to decide whether two color features match.
const GaussianShapeFunction * getShapeFunction(bool ref) const
Returns the reference or aligned shape function.
double calcColorOverlap() const
Calculates the color overlap of the reference and aligned shape functions.
double calcOverlap(const Math::Vector3DArray &coords) const
Calculates the shape-only overlap with the aligned shape element positions taken from coords.
ExactGaussianShapeOverlapFunction(const ExactGaussianShapeOverlapFunction &func)
Constructs a copy of the ExactGaussianShapeOverlapFunction instance func.
ExactGaussianShapeOverlapFunction()
Constructs the ExactGaussianShapeOverlapFunction instance without associated shape functions.
void setColorFilterFunction(const ColorFilterFunction &func)
Specifies the function used to filter color features by type.
const ColorMatchFunction & getColorMatchFunction() const
Returns the currently configured color-match function.
double calcColorOverlap(const Math::Vector3DArray &coords) const
Calculates the color overlap with the aligned shape element positions taken from coords.
ExactGaussianShapeOverlapFunction(const GaussianShapeFunction &ref_shape_func, const GaussianShapeFunction &ovl_shape_func)
Constructs the ExactGaussianShapeOverlapFunction instance with the given reference and aligned shape ...
void setShapeFunction(const GaussianShapeFunction &func, bool is_ref)
Specifies the reference or aligned shape function used by the overlap evaluation.
std::shared_ptr< ExactGaussianShapeOverlapFunction > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ExactGaussianShapeOverlapFunction...
Definition: ExactGaussianShapeOverlapFunction.hpp:58
ExactGaussianShapeOverlapFunction & operator=(const ExactGaussianShapeOverlapFunction &func)
Copy assignment operator.
double calcOverlap() const
Calculates the shape-only overlap of the reference and aligned shape functions.
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 t...
Function representation of a Gaussian shape, used to evaluate the shape's density,...
Definition: GaussianShapeFunction.hpp:61
Abstract base class for functions evaluating the overlap between two Gaussian shape functions.
Definition: GaussianShapeOverlapFunction.hpp:56
std::function< bool(std::size_t)> ColorFilterFunction
Type of the function used to filter color (pharmacophore) features by type.
Definition: GaussianShapeOverlapFunction.hpp:63
std::function< bool(std::size_t, std::size_t)> ColorMatchFunction
Type of the function used to decide whether two color features match.
Definition: GaussianShapeOverlapFunction.hpp:66
VectorArray< Vector3D > Vector3DArray
Array storing vectors of type Math::Vector3D.
Definition: VectorArray.hpp:85
The namespace of the Chemical Data Processing Library.