8 #ifndef MMPARAMETRIZATION_UPDATEFUNCTIONMANAGER_H
9 #define MMPARAMETRIZATION_UPDATEFUNCTIONMANAGER_H
21 namespace MMParametrization {
22 struct ParametrizationData;
28 enum class ParameterToOptimize { Bond = (1 << 0), Angle = (1 << 1), Dihedral = (1 << 2), ImproperDihedral = (1 << 3) };
32 constexpr
inline ParameterToOptimize operator|(ParameterToOptimize p1, ParameterToOptimize p2) {
33 using utype = std::underlying_type<ParameterToOptimize>::type;
34 return static_cast<ParameterToOptimize
>(
static_cast<utype
>(p1) | static_cast<utype>(p2));
41 ParameterToOptimize typeOfParameter);
45 void updateErrors(
const Eigen::VectorXd& parameters, Eigen::VectorXd& errors)
override;
70 std::shared_ptr<Utils::Settings> settings_;
72 std::vector<int> getAtomsToConsiderForHessian()
const;
74 ParameterToOptimize typeOfParameter_;
76 std::unique_ptr<MolecularMechanics::SfamMolecularMechanicsCalculator> mmCalculator_;
78 bool typeOfParameterShouldBeOptimized(
const ParameterToOptimize& typeToCheck)
const {
79 auto combined = typeToCheck | typeOfParameter_;
80 return combined == typeOfParameter_;
83 Eigen::VectorXd initialParameters_;
87 Eigen::VectorXd minimumParameters_;
88 Eigen::VectorXd maximumParameters_;
94 #endif // MMPARAMETRIZATION_UPDATEFUNCTIONMANAGER_H
void updateErrors(const Eigen::VectorXd ¶meters, Eigen::VectorXd &errors) override
Update the errors vector for the least squares optimization for a given parameter.
Definition: UpdateFunctionManager.cpp:38
int getNumberOfDataPoints(const Eigen::VectorXd ¶meters) const override
This function returns the number of data points present in the least squares optimization, i.e., the number of Hessian elements for the parameter to be optimized and optionally 2 data points to implement constraints on the parameter.
Definition: UpdateFunctionManager.cpp:216
MolecularMechanics::SfamParameters vectorToParameters(const Eigen::VectorXd ¶meters)
Function that converts the variables of the optimization to the parameters object.
Definition: UpdateFunctionManager.cpp:100
void setInitialParameters(Eigen::VectorXd initialParameters)
Set the initial variables of the optimization (variables are MM parameters).
Definition: UpdateFunctionManager.cpp:228
Eigen::VectorXd parametersToVector(const MolecularMechanics::SfamParameters ¶meters)
Function that converts the parameters object to the variables of the optimization.
Definition: UpdateFunctionManager.cpp:167
Definition: UpdateFunctionManager.h:37
This struct holds all objects used inside the MM parametrization algorithm.
Definition: ParametrizationData.h:29
Class containing the parameters for SFAM's MM model obtained after parsing a SFAM parameter file...
Definition: SfamParameters.h:37