class gpr::geometry::InternalCoordinateSet¶
Overview¶
#include <gpr/auxiliary/InternalCoordinates.h>
class InternalCoordinateSet {
public:
// structs
struct RetractionReport;
// construction
InternalCoordinateSet(int n_atoms, std::vector<char> moving_atoms, std::vector<PrimitiveInternal> primitives, std::array<double, 9> cell = {});
// methods
bool hasSameDefinition(const InternalCoordinateSet& other) const;
int numAtoms() const;
const std::vector<char>& movingAtoms() const;
const std::vector<PrimitiveInternal>& primitives() const;
const std::vector<Eigen::Index>& activeColumns() const;
const std::array<double, 9>& cell() const;
Eigen::VectorXd values(const Eigen::VectorXd& positions) const;
Eigen::MatrixXd jacobian(const Eigen::VectorXd& positions) const;
Eigen::MatrixXd directionalJacobian(const Eigen::VectorXd& positions, const Eigen::VectorXd& direction) const;
Eigen::MatrixXd activeJacobian(const Eigen::VectorXd& positions) const;
Eigen::VectorXd activeStep(const Eigen::VectorXd& full_step) const;
Eigen::VectorXd linearizedChange(const Eigen::VectorXd& positions, const Eigen::VectorXd& direction) const;
RetractionReport retractLinearizedReport(const Eigen::VectorXd& positions, const Eigen::VectorXd& cartesian_step) const;
Eigen::VectorXd retractLinearized(const Eigen::VectorXd& positions, const Eigen::VectorXd& cartesian_step) const;
};
Detailed Documentation¶
Methods¶
bool hasSameDefinition(const InternalCoordinateSet& other) const
Exact coordinate definition, including primitive order and bend axes. Equal definitions share a chart at the same Cartesian anchor.
Eigen::MatrixXd directionalJacobian(const Eigen::VectorXd& positions, const Eigen::VectorXd& direction) const
Derivative of jacobian(positions) along a Cartesian direction, exact by forward-over-forward AutoDiff of each primitive. Throws UndefinedInternalCoordinate where a primitive has no curvature, including a valence angle at collinearity.
Eigen::VectorXd linearizedChange(const Eigen::VectorXd& positions, const Eigen::VectorXd& direction) const
Primitive changes B * direction without forming the dense Wilson matrix. Rows are the primitive order of this set.
RetractionReport retractLinearizedReport(const Eigen::VectorXd& positions, const Eigen::VectorXd& cartesian_step) const
Gauss-Newton retraction onto the linearized internal-coordinate target. Retracted requires an accepted step whose residual improved, a constraint residual within tolerance, or least-squares stationarity of a usable Jacobian. A correction below the coordinate resolution does not succeed on its own. That resolution is the spread of the involved atoms about their centroid, so a translation of the molecule does not change it. An undefined primitive gradient fails the retraction. Redundant primitives make the linearized target inconsistent, so the residual floor is generally far above epsilon and stationarity of a usable Jacobian ends the iteration. The anchor row space comes from the chart’s sparse QR and compact-R SVD. A wide Wilson matrix refines the unresolved tail of B^T B with that SVD, because a left-looking QR of the Gabriel complex does not fit the retraction budget. Rows below the dense retraction’s relative cutoff stay in the reported rank and are not inverted.