Scine::Readuct  6.0.0
This is the SCINE module ReaDuct.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
CommonTerms.h
Go to the documentation of this file.
1 
8 #ifndef READUCT_ELEMENTARYSTEPOPTIMIZATION_COSTCALCULATORS_COMMONTERMS_H
9 #define READUCT_ELEMENTARYSTEPOPTIMIZATION_COSTCALCULATORS_COMMONTERMS_H
10 
11 #include "../MSVCCompatibility.h"
12 #include <Eigen/Core>
13 #include <vector>
14 
15 // TODO: Improve documentation
16 
17 namespace Scine {
18 
19 namespace Utils {
20 namespace AutomaticDifferentiation {
21 class FirstND;
22 }
23 } // namespace Utils
24 
25 namespace Utils {
26 namespace BSplines {
27 class BSpline;
28 }
29 } // namespace Utils
30 
31 namespace Readuct {
32 
33 namespace ElementaryStepOptimization {
34 class RecurringProfileCalculator;
35 
36 namespace CostBasedOptimization {
37 
42 class SCINE_DLLEXPORT CommonTerms {
43  public:
44  static Utils::AutomaticDifferentiation::FirstND squaredNormOfSplineDerivative(const Utils::BSplines::BSpline& spline,
45  double u);
46  static Utils::AutomaticDifferentiation::FirstND singlePointEnergy(const Utils::BSplines::BSpline& spline, double u,
47  double energy, const Eigen::VectorXd& gradients);
48  static Utils::AutomaticDifferentiation::FirstND squaredNormOfGradient(const Utils::BSplines::BSpline& spline,
49  double u, const Eigen::VectorXd& gradients,
50  const Eigen::MatrixXd& hessian);
52  dotProductOfGradientAndSplineDerivative(const Utils::BSplines::BSpline& spline, double u,
53  const Eigen::VectorXd& gradients, const Eigen::MatrixXd& hessian);
55  dotProductOfPositionAndSplineDerivative(const Utils::BSplines::BSpline& spline, double uPosition, double uTangent);
56  static Utils::AutomaticDifferentiation::FirstND distanceSquared(const Utils::BSplines::BSpline& spline, double uA, double uB);
57  static Utils::AutomaticDifferentiation::FirstND distanceSquaredToPosition(const Utils::BSplines::BSpline& spline,
58  double u, const Eigen::VectorXd& pos);
59 
60  static Utils::AutomaticDifferentiation::FirstND dotProductOfPositions(const Utils::BSplines::BSpline& spline,
61  double uA, double uB);
62 
64  energyOfHighestPointFromQuadraticInterpolation(RecurringProfileCalculator& profileCalculator,
65  const std::vector<double>& energies, const Utils::BSplines::BSpline& spline);
66 
67  static Utils::AutomaticDifferentiation::FirstND energyAlongSpline(RecurringProfileCalculator& profileCalculator,
68  const Utils::BSplines::BSpline& spline, double u);
70  static Utils::AutomaticDifferentiation::FirstND derivativeOfSquaredTangentNorm(const Utils::BSplines::BSpline& spline,
71  double u);
72 
73  private:
74  static double interpolateExtremumUValue(double u0, double u1, double u2, double e0, double e1, double e2);
75  static int getIndexForHighestEnergy(const std::vector<double>& energies);
76  static double getUValueWithMaxEnergy(const std::vector<double>& coordinates, const std::vector<double>& energies, int maxIndex);
77 };
78 
79 } // namespace CostBasedOptimization
80 
81 } // namespace ElementaryStepOptimization
82 
83 } // namespace Readuct
84 } // namespace Scine
85 #endif // READUCT_ELEMENTARYSTEPOPTIMIZATION_COSTCALCULATORS_COMMONTERMS_H
double distanceSquared(const PositionCollection &p1, const PositionCollection &p2)