Chemical Data Processing Library C++ API - Version 1.1.1
PrincipalAxesAlignmentStartGenerator.hpp
Go to the documentation of this file.
1 /*
2  * PrincipalAxesAlignmentStartGenerator.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_PRINCIPALAXESALIGNMENTSTARTGENERATOR_HPP
30 #define CDPL_SHAPE_PRINCIPALAXESALIGNMENTSTARTGENERATOR_HPP
31 
32 #include <vector>
33 
34 #include <boost/random/mersenne_twister.hpp>
35 
36 #include "CDPL/Shape/APIPrefix.hpp"
38 #include "CDPL/Math/Vector.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Shape
46  {
47 
49  {
50 
51  public:
52  static constexpr double DEF_SYMMETRY_THRESHOLD = 0.15;
53  static constexpr std::size_t DEF_NUM_RANDOM_STARTS = 4;
54  static constexpr double DEF_MAX_RANDOM_TRANSLATION = 2.0;
55 
57 
58  unsigned int setupReference(GaussianShapeFunction& func, Math::Matrix4D& xform) const;
59 
60  unsigned int setupAligned(GaussianShapeFunction& func, Math::Matrix4D& xform) const;
61 
62  void genShapeCenterStarts(bool generate);
63 
64  bool genShapeCenterStarts() const;
65 
66  void genColorCenterStarts(bool generate);
67 
68  bool genColorCenterStarts() const;
69 
70  void genNonColorCenterStarts(bool generate);
71 
73 
74  void genRandomStarts(bool generate);
75 
76  bool genRandomStarts() const;
77 
78  void genForAlignedShapeCenters(bool generate);
79 
81 
82  void genForReferenceShapeCenters(bool generate);
83 
85 
86  void genForLargerShapeCenters(bool generate);
87 
89 
90  void setSymmetryThreshold(double thresh);
91 
93 
94  void setMaxRandomTranslation(double max_trans);
95 
96  double getMaxRandomTranslation() const;
97 
98  void setNumRandomStarts(std::size_t num_starts);
99 
100  std::size_t getNumRandomStarts() const;
101 
102  void setRandomSeed(unsigned int seed);
103 
104  void setReference(const GaussianShapeFunction& func, unsigned int sym_class);
105 
106  bool generate(const GaussianShapeFunction& func, unsigned int sym_class);
107 
108  std::size_t getNumStartTransforms() const;
109 
110  std::size_t getNumStartSubTransforms() const;
111 
112  const QuaternionTransformation& getStartTransform(std::size_t idx) const;
113 
114  private:
115  void generateForElementCenters(const GaussianShapeFunction& func, unsigned int axes_swap_flags, bool ref_shape);
116  void generate(const Math::Vector3D& ctr_trans, unsigned int axes_swap_flags);
117 
118  template <typename QE>
119  void addStartTransform(Math::Vector3D::ConstPointer ctr_trans_data, const Math::QuaternionExpression<QE>& rot_quat);
120 
121  typedef std::vector<QuaternionTransformation> StartTransformList;
122  typedef boost::random::mt11213b RandomEngine;
123 
124  bool shapeCtrStarts;
125  bool colCtrStarts;
126  bool nonColCtrStarts;
127  bool randomStarts;
128  bool genForAlgdShape;
129  bool genForRefShape;
130  bool genForLargerShape;
131  StartTransformList startTransforms;
132  const GaussianShapeFunction* refShapeFunc;
133  double symThreshold;
134  double maxRandomTrans;
135  std::size_t numRandomStarts;
136  unsigned int refAxesSwapFlags;
137  std::size_t numSubTransforms;
138  RandomEngine randomEngine;
139  };
140  } // namespace Shape
141 } // namespace CDPL
142 
143 #endif // CDPL_SHAPE_PRINCIPALAXESALIGNMENTSTARTGENERATOR_HPP
CDPL::Shape::GaussianShapeAlignmentStartGenerator
Definition: GaussianShapeAlignmentStartGenerator.hpp:49
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setReference
void setReference(const GaussianShapeFunction &func, unsigned int sym_class)
CMatrix< double, 4, 4 >
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setupAligned
unsigned int setupAligned(GaussianShapeFunction &func, Math::Matrix4D &xform) const
CDPL::Math::Vector3D
CVector< double, 3 > Vector3D
A bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:1637
CDPL::Shape::PrincipalAxesAlignmentStartGenerator
Definition: PrincipalAxesAlignmentStartGenerator.hpp:49
GaussianShapeAlignmentStartGenerator.hpp
Definition of the class CDPL::Shape::GaussianShapeAlignmentStartGenerator.
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getStartTransform
const QuaternionTransformation & getStartTransform(std::size_t idx) const
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForLargerShapeCenters
bool genForLargerShapeCenters() const
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForReferenceShapeCenters
bool genForReferenceShapeCenters() const
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getSymmetryThreshold
double getSymmetryThreshold()
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setSymmetryThreshold
void setSymmetryThreshold(double thresh)
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genShapeCenterStarts
void genShapeCenterStarts(bool generate)
QuaternionExpression.hpp
Definition of various quaternion expression types and operations.
CDPL::Math::QuaternionExpression
Definition: Expression.hpp:98
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForAlignedShapeCenters
bool genForAlignedShapeCenters() const
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genRandomStarts
void genRandomStarts(bool generate)
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setRandomSeed
void setRandomSeed(unsigned int seed)
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getMaxRandomTranslation
double getMaxRandomTranslation() const
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setMaxRandomTranslation
void setMaxRandomTranslation(double max_trans)
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setNumRandomStarts
void setNumRandomStarts(std::size_t num_starts)
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genNonColorCenterStarts
void genNonColorCenterStarts(bool generate)
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getNumStartTransforms
std::size_t getNumStartTransforms() const
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setupReference
unsigned int setupReference(GaussianShapeFunction &func, Math::Matrix4D &xform) const
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForLargerShapeCenters
void genForLargerShapeCenters(bool generate)
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genRandomStarts
bool genRandomStarts() const
CDPL::Math::CVector
Definition: Vector.hpp:1053
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genNonColorCenterStarts
bool genNonColorCenterStarts() const
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getNumStartSubTransforms
std::size_t getNumStartSubTransforms() 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::PrincipalAxesAlignmentStartGenerator::getNumRandomStarts
std::size_t getNumRandomStarts() const
CDPL
The namespace of the Chemical Data Processing Library.
APIPrefix.hpp
Definition of the preprocessor macro CDPL_SHAPE_API.
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genColorCenterStarts
bool genColorCenterStarts() const
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genColorCenterStarts
void genColorCenterStarts(bool generate)
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genShapeCenterStarts
bool genShapeCenterStarts() const
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForAlignedShapeCenters
void genForAlignedShapeCenters(bool generate)
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::generate
bool generate(const GaussianShapeFunction &func, unsigned int sym_class)
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::PrincipalAxesAlignmentStartGenerator
PrincipalAxesAlignmentStartGenerator()
CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForReferenceShapeCenters
void genForReferenceShapeCenters(bool generate)
Vector.hpp
Definition of vector data types.