Loading...
Searching...
No Matches
absOrientation.hpp
Go to the documentation of this file.
1//-----------------------------------------------------------------------------------
2// d-SEAMS - Deferred Structural Elucidation Analysis for Molecular Simulations
3//
4// Copyright (c) 2018--present d-SEAMS core team
5//
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the MIT License as published by
8// the Open Source Initiative.
9//
10// A copy of the MIT License is included in the LICENSE file of this repository.
11// You should have received a copy of the MIT License along with this program.
12// If not, see <https://opensource.org/licenses/MIT>.
13//-----------------------------------------------------------------------------------
14
15#ifndef SEAMS_ABSORIENTATION_H_
16#define SEAMS_ABSORIENTATION_H_
17
18#include <algorithm>
19#include <array>
20#include <fstream>
21#include <iostream>
22#include <iterator>
23#include <cmath>
24#include <memory>
25#include <sstream>
26#include <string>
27#include <vector>
28
29// Eigen (SelfAdjointEigenSolver replaces Spectra for 4x4 symmetric matrices)
30#include <Eigen/Core>
31#include <Eigen/Dense>
32#include <Eigen/Eigenvalues>
33
34#include <mol_sys.hpp>
35#include <ring.hpp>
36#include <seams_input.hpp>
37#include <seams_output.hpp>
38
39// Inspired by AStar_Dual_Tree_HandPose by jsupancic
40
41namespace absor {
42
46[[nodiscard]] int hornAbsOrientation(const Eigen::MatrixXd &refPoints,
47 const Eigen::MatrixXd &targetPoints,
48 std::vector<double> &quat, double &rmsd,
49 std::vector<double> &rmsdList, double &scale);
50
53Eigen::MatrixXd calcMatrixS(const Eigen::MatrixXd &centeredRefPnts,
54 const Eigen::MatrixXd &centeredTargetPnts, int nop,
55 int dim);
56
59Eigen::MatrixXd calcMatrixN(const Eigen::MatrixXd &S);
60
62Eigen::MatrixXd centerWRTcentroid(const Eigen::MatrixXd &pointSet);
63
65double calcScaleFactor(const Eigen::MatrixXd &rightSys,
66 const Eigen::MatrixXd &leftSys, int n);
67
69Eigen::MatrixXd quat2RotMatrix(const Eigen::VectorXd &quat);
70
72double getRMSD(const Eigen::MatrixXd &centeredRefPnts,
73 const Eigen::MatrixXd &centeredTargetPnts,
74 const Eigen::VectorXd &quat, std::vector<double> &rmsdList,
75 int nop, double scale);
76
77} // namespace absor
78
79#endif // SEAMS_ABSORIENTATION_H_
The main molecular system handler.
int hornAbsOrientation(const Eigen::MatrixXd &refPoints, const Eigen::MatrixXd &targetPoints, std::vector< double > &quat, double &rmsd, std::vector< double > &rmsdList, double &scale)
Get the absolute orientation using Horn's algorithm (with quaternions).
Eigen::MatrixXd calcMatrixS(const Eigen::MatrixXd &centeredRefPnts, const Eigen::MatrixXd &centeredTargetPnts, int nop, int dim)
double calcScaleFactor(const Eigen::MatrixXd &rightSys, const Eigen::MatrixXd &leftSys, int n)
Calculate the scale factor from the centered left and right point sets.
Eigen::MatrixXd centerWRTcentroid(const Eigen::MatrixXd &pointSet)
Center a point set wrt the centroid.
Eigen::MatrixXd calcMatrixN(const Eigen::MatrixXd &S)
Eigen::MatrixXd quat2RotMatrix(const Eigen::VectorXd &quat)
Get a rotation matrix from a unit quaternion.
double getRMSD(const Eigen::MatrixXd &centeredRefPnts, const Eigen::MatrixXd &centeredTargetPnts, const Eigen::VectorXd &quat, std::vector< double > &rmsdList, int nop, double scale)
Calculate the RMSD.
File containing common functions used by bulk and confined topological network critera.
File for functions that read in files).