absOrientation.hpp
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------------
2 // d-SEAMS is free software: you can redistribute it and/or modify
3 // it under the terms of the GNU General Public License as published by
4 // the Free Software Foundation, either version 3 of the License, or
5 // (at your option) any later version.
6 //
7 // A copy of the GNU General Public License is available at
8 // http://www.gnu.org/licenses/
9 //-----------------------------------------------------------------------------------
10 
11 #ifndef __ABSORIENTATION_H_
12 #define __ABSORIENTATION_H_
13 
14 #include <algorithm>
15 #include <array>
16 #include <fstream>
17 #include <iostream>
18 #include <iterator>
19 #include <math.h>
20 #include <memory>
21 #include <sstream>
22 #include <string>
23 #include <sys/stat.h>
24 #include <vector>
25 
26 // External
27 #include <Spectra/SymEigsShiftSolver.h>
28 #include <Spectra/SymEigsSolver.h>
29 #include <eigen3/Eigen/Core>
30 #include <eigen3/Eigen/Dense>
31 
32 #include <mol_sys.hpp>
33 #include <ring.hpp>
34 #include <seams_input.hpp>
35 #include <seams_output.hpp>
36 
37 // Inspired by AStar_Dual_Tree_HandPose by jsupancic
38 
39 namespace absor {
40 
44 int hornAbsOrientation(const Eigen::MatrixXd &refPoints,
45  const Eigen::MatrixXd &targetPoints,
46  std::vector<double> *quat, double *rmsd,
47  std::vector<double> *rmsdList, double *scale);
48 
51 Eigen::MatrixXd calcMatrixS(const Eigen::MatrixXd &centeredRefPnts,
52  const Eigen::MatrixXd &centeredTargetPnts, int nop,
53  int dim);
54 
57 Eigen::MatrixXd calcMatrixN(const Eigen::MatrixXd &S);
58 
60 Eigen::MatrixXd centerWRTcentroid(const Eigen::MatrixXd &pointSet);
61 
63 double calcScaleFactor(const Eigen::MatrixXd &rightSys,
64  const Eigen::MatrixXd &leftSys, int n);
65 
67 Eigen::MatrixXd quat2RotMatrix(const Eigen::VectorXd &quat);
68 
70 double getRMSD(const Eigen::MatrixXd &centeredRefPnts,
71  const Eigen::MatrixXd &centeredTargetPnts,
72  const Eigen::VectorXd &quat, std::vector<double> *rmsdList,
73  int nop, double scale);
74 
75 } // namespace absor
76 
77 #endif // __ABSORIENTATION_H_
The main molecular system handler.
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.
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.
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 calcMatrixN(const Eigen::MatrixXd &S)
Eigen::MatrixXd quat2RotMatrix(const Eigen::VectorXd &quat)
Get a rotation matrix from a unit quaternion.
File containing common functions used by bulk and confined topological network critera.
File for functions that read in files).