Scine::Readuct  6.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 "MSVCCompatibility.h"
12 #include <Utils/Typenames.h>
13 #include <Eigen/Core>
14 #include <vector>
15 
16 // TODO: Improve documentation
17 
18 namespace Scine {
19 
20 namespace Core {
21 class Calculator;
22 }
23 
24 namespace Utils {
25 namespace BSplines {
26 class BSpline;
27 }
28 } // namespace Utils
29 
30 namespace Readuct {
31 
32 namespace ElementaryStepOptimization {
33 
37 class SCINE_DLLEXPORT BSplineProfileCalculator {
38  public:
39  explicit BSplineProfileCalculator(Core::Calculator& calculator);
40 
41  void calculateAllEnergies(const Utils::BSplines::BSpline& spline, const std::vector<double>& uValues,
42  std::vector<double>& energies);
43  void calculateAllEnergiesAndGradients(const Utils::BSplines::BSpline& spline, const std::vector<double>& uValues,
44  std::vector<double>& energies, std::vector<Utils::GradientCollection>& gradients);
45  void calculateAllUpToSecondDerivative(const Utils::BSplines::BSpline& spline, const std::vector<double>& uValues,
46  std::vector<double>& energies, std::vector<Utils::GradientCollection>& gradients,
47  std::vector<Eigen::MatrixXd>& hessians);
48 
49  void calculateEnergy(const Utils::BSplines::BSpline& spline, double u, double& energy);
50  void calculateEnergyAndGradients(const Utils::BSplines::BSpline& spline, double u, double& energy,
51  Utils::GradientCollection& gradients);
52  void calculateUpToSecondDerivatives(const Utils::BSplines::BSpline& spline, double u, double& energy,
53  Utils::GradientCollection& gradients, Eigen::MatrixXd& hessians);
54 
55  Utils::PositionCollection positionsForUValue(const Utils::BSplines::BSpline& spline, double u) const;
56 
57  private:
58  Core::Calculator& calculator_;
59 };
60 
61 } // namespace ElementaryStepOptimization
62 
63 } // namespace Readuct
64 } // namespace Scine
65 #endif // ELEMENTARYSTEPOPTIMIZATION_BSPLINEPROFILECALCULATOR_H