Scine::Readuct  5.0.0
This is the SCINE module ReaDuct.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
BSplineProfileCalculator.h
Go to the documentation of this file.
1 
8 #ifndef READUCT_ELEMENTARYSTEPOPTIMIZATION_BSPLINEPROFILECALCULATOR_H
9 #define READUCT_ELEMENTARYSTEPOPTIMIZATION_BSPLINEPROFILECALCULATOR_H
10 
11 #include <Utils/Typenames.h>
12 #include <Eigen/Core>
13 #include <vector>
14 
15 // TODO: Improve documentation
16 
17 namespace Scine {
18 
19 namespace Core {
20 class Calculator;
21 }
22 
23 namespace Utils {
24 namespace BSplines {
25 class BSpline;
26 }
27 } // namespace Utils
28 
29 namespace Readuct {
30 
31 namespace ElementaryStepOptimization {
32 
37  public:
38  explicit BSplineProfileCalculator(Core::Calculator& calculator);
39 
40  void calculateAllEnergies(const Utils::BSplines::BSpline& spline, const std::vector<double>& uValues,
41  std::vector<double>& energies);
42  void calculateAllEnergiesAndGradients(const Utils::BSplines::BSpline& spline, const std::vector<double>& uValues,
43  std::vector<double>& energies, std::vector<Utils::GradientCollection>& gradients);
44  void calculateAllUpToSecondDerivative(const Utils::BSplines::BSpline& spline, const std::vector<double>& uValues,
45  std::vector<double>& energies, std::vector<Utils::GradientCollection>& gradients,
46  std::vector<Eigen::MatrixXd>& hessians);
47 
48  void calculateEnergy(const Utils::BSplines::BSpline& spline, double u, double& energy);
49  void calculateEnergyAndGradients(const Utils::BSplines::BSpline& spline, double u, double& energy,
50  Utils::GradientCollection& gradients);
51  void calculateUpToSecondDerivatives(const Utils::BSplines::BSpline& spline, double u, double& energy,
52  Utils::GradientCollection& gradients, Eigen::MatrixXd& hessians);
53 
54  Utils::PositionCollection positionsForUValue(const Utils::BSplines::BSpline& spline, double u) const;
55 
56  private:
57  Core::Calculator& calculator_;
58 };
59 
60 } // namespace ElementaryStepOptimization
61 
62 } // namespace Readuct
63 } // namespace Scine
64 #endif // ELEMENTARYSTEPOPTIMIZATION_BSPLINEPROFILECALCULATOR_H