Chemical Data Processing Library C++ API - Version 1.1.1
FastGaussianShapeOverlapFunction.hpp
Go to the documentation of this file.
1 /*
2  * FastGaussianShapeOverlapFunction.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_FASTGAUSSIANSHAPEOVERLAPFUNCTION_HPP
30 #define CDPL_SHAPE_FASTGAUSSIANSHAPEOVERLAPFUNCTION_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 
47  {
48 
49  public:
50  static constexpr double DEF_RADIUS_SCALING_FACTOR = 1.4;
51 
52  typedef std::shared_ptr<FastGaussianShapeOverlapFunction> SharedPointer;
53 
55 
57 
59  const GaussianShapeFunction& ovl_shape_func);
60 
62 
63  void proximityOptimization(bool enable);
64 
65  bool proximityOptimization() const;
66 
67  void setRadiusScalingFactor(double factor);
68 
69  double getRadiusScalingFactor() const;
70 
71  void fastExpFunction(bool enable);
72 
73  bool fastExpFunction() const;
74 
75  void setShapeFunction(const GaussianShapeFunction& func, bool is_ref);
76 
77  const GaussianShapeFunction* getShapeFunction(bool ref) const;
78 
80 
82 
83  void setColorFilterFunction(const ColorFilterFunction& func);
84 
85  const ColorFilterFunction& getColorFilterFunction() const;
86 
87  double calcSelfOverlap(bool ref) const;
88 
89  double calcColorSelfOverlap(bool ref) const;
90 
91  double calcOverlap() const;
92 
93  double calcColorOverlap() const;
94 
95  double calcOverlap(const Math::Vector3DArray& coords) const;
96 
97  double calcColorOverlap(const Math::Vector3DArray& coords) const;
98 
99  double calcOverlapGradient(const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const;
100 
102 
103  private:
104  bool checkShapeFuncsNotNull() const;
105 
106  double calcOverlap(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
107  bool color) const;
108  double calcOverlapExact(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
109  bool color) const;
110  double calcOverlapFastExp(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
111  bool color) const;
112  double calcOverlapProxCheck(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
113  bool color) const;
114  double calcOverlapFastExpProxCheck(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
115  bool color) const;
116 
117  double calcOverlap(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
118  const Math::Vector3DArray& coords, bool color) const;
119  double calcOverlapExact(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
120  const Math::Vector3DArray& coords, bool color) const;
121  double calcOverlapFastExp(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
122  const Math::Vector3DArray& coords, bool color) const;
123  double calcOverlapProxCheck(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
124  const Math::Vector3DArray& coords, bool color) const;
125  double calcOverlapFastExpProxCheck(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
126  const Math::Vector3DArray& coords, bool color) const;
127 
128  double calcOverlapGradient(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
129  const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const;
130  double calcOverlapGradientExact(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
131  const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const;
132  double calcOverlapGradientFastExp(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
133  const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const;
134  double calcOverlapGradientProxCheck(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
135  const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const;
136  double calcOverlapGradientFastExpProxCheck(const GaussianProductList* ref_prod_list, const GaussianProductList* ovl_prod_list,
137  const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const;
138 
139  const GaussianShapeFunction* refShapeFunc;
140  const GaussianShapeFunction* ovlShapeFunc;
141  ColorMatchFunction colorMatchFunc;
142  ColorFilterFunction colorFilterFunc;
143  bool proximityOpt;
144  bool fastExpFunc;
145  double radScalingFact;
146  };
147  } // namespace Shape
148 } // namespace CDPL
149 
150 #endif // CDPL_SHAPE_FASTGAUSSIANSHAPEOVERLAPFUNCTION_HPP
CDPL::Shape::FastGaussianShapeOverlapFunction::SharedPointer
std::shared_ptr< FastGaussianShapeOverlapFunction > SharedPointer
Definition: FastGaussianShapeOverlapFunction.hpp:52
CDPL::Shape::FastGaussianShapeOverlapFunction::setRadiusScalingFactor
void setRadiusScalingFactor(double factor)
CDPL::Shape::FastGaussianShapeOverlapFunction::proximityOptimization
bool proximityOptimization() const
CDPL::Shape::FastGaussianShapeOverlapFunction::FastGaussianShapeOverlapFunction
FastGaussianShapeOverlapFunction(const FastGaussianShapeOverlapFunction &func)
CDPL::Shape::FastGaussianShapeOverlapFunction::fastExpFunction
bool fastExpFunction() const
CDPL::Shape::FastGaussianShapeOverlapFunction::setShapeFunction
void setShapeFunction(const GaussianShapeFunction &func, bool is_ref)
CDPL::Shape::FastGaussianShapeOverlapFunction::fastExpFunction
void fastExpFunction(bool enable)
CDPL::Shape::FastGaussianShapeOverlapFunction::calcColorSelfOverlap
double calcColorSelfOverlap(bool ref) const
GaussianShapeOverlapFunction.hpp
Definition of the class CDPL::Shape::GaussianShapeOverlapFunction.
CDPL::Shape::FastGaussianShapeOverlapFunction::getColorFilterFunction
const ColorFilterFunction & getColorFilterFunction() const
CDPL::Shape::FastGaussianShapeOverlapFunction::getRadiusScalingFactor
double getRadiusScalingFactor() const
CDPL::Shape::FastGaussianShapeOverlapFunction::calcSelfOverlap
double calcSelfOverlap(bool ref) const
CDPL::Shape::FastGaussianShapeOverlapFunction::calcOverlapGradient
double calcOverlapGradient(const Math::Vector3DArray &coords, Math::Vector3DArray &grad) const
CDPL::Shape::FastGaussianShapeOverlapFunction::calcOverlap
double calcOverlap(const Math::Vector3DArray &coords) const
CDPL::Shape::FastGaussianShapeOverlapFunction::FastGaussianShapeOverlapFunction
FastGaussianShapeOverlapFunction()
CDPL::Shape::GaussianShapeOverlapFunction::ColorMatchFunction
std::function< bool(std::size_t, std::size_t)> ColorMatchFunction
Definition: GaussianShapeOverlapFunction.hpp:55
CDPL::Shape::FastGaussianShapeOverlapFunction::proximityOptimization
void proximityOptimization(bool enable)
VectorArray< Vector3D >
CDPL::Shape::FastGaussianShapeOverlapFunction::operator=
FastGaussianShapeOverlapFunction & operator=(const FastGaussianShapeOverlapFunction &func)
CDPL::Shape::FastGaussianShapeOverlapFunction::calcColorOverlap
double calcColorOverlap() const
CDPL::Shape::GaussianShapeOverlapFunction
Definition: GaussianShapeOverlapFunction.hpp:49
CDPL::Shape::FastGaussianShapeOverlapFunction::calcOverlap
double calcOverlap() const
CDPL::Shape::GaussianShapeFunction
Definition: GaussianShapeFunction.hpp:53
CDPL_SHAPE_API
#define CDPL_SHAPE_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Shape::FastGaussianShapeOverlapFunction
Definition: FastGaussianShapeOverlapFunction.hpp:47
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Shape::FastGaussianShapeOverlapFunction::getShapeFunction
const GaussianShapeFunction * getShapeFunction(bool ref) const
APIPrefix.hpp
Definition of the preprocessor macro CDPL_SHAPE_API.
CDPL::Shape::FastGaussianShapeOverlapFunction::setColorMatchFunction
void setColorMatchFunction(const ColorMatchFunction &func)
CDPL::Shape::FastGaussianShapeOverlapFunction::getColorMatchFunction
const ColorMatchFunction & getColorMatchFunction() const
CDPL::Shape::FastGaussianShapeOverlapFunction::~FastGaussianShapeOverlapFunction
~FastGaussianShapeOverlapFunction()
CDPL::Shape::FastGaussianShapeOverlapFunction::setColorFilterFunction
void setColorFilterFunction(const ColorFilterFunction &func)
CDPL::Shape::FastGaussianShapeOverlapFunction::calcColorOverlap
double calcColorOverlap(const Math::Vector3DArray &coords) const
CDPL::Shape::FastGaussianShapeOverlapFunction::FastGaussianShapeOverlapFunction
FastGaussianShapeOverlapFunction(const GaussianShapeFunction &ref_shape_func, const GaussianShapeFunction &ovl_shape_func)