Chemical Data Processing Library C++ API - Version 1.1.1
|
Implementation of the Kabsch algorithm [KABA]. More...
#include <KabschAlgorithm.hpp>
Public Types | |
typedef T | ValueType |
typedef Matrix< T > | MatrixType |
typedef Vector< T > | VectorType |
Public Member Functions | |
template<typename M1 , typename M2 , typename V > | |
bool | align (const MatrixExpression< M1 > &points, const MatrixExpression< M2 > &ref_points, const VectorExpression< V > &weights, bool do_center=true, std::size_t max_svd_iter=0) |
Computes the rigid body transformation that aligns a set of \( N \) \( D \)-dimensional points points with a corresponding set of reference points ref_points at a minimum RMSD. More... | |
template<typename M1 , typename M2 > | |
bool | align (const MatrixExpression< M1 > &points, const MatrixExpression< M2 > &ref_points, bool do_center=true, std::size_t max_svd_iter=0) |
Computes the rigid body transformation that aligns a set of \( N \) \( D \)-dimensional points points with a corresponding set of reference points ref_points at a minimum RMSD. More... | |
const MatrixType & | getTransform () const |
Implementation of the Kabsch algorithm [KABA].
Finds the least Root Mean Square Distance between two sets of \( N \) points in \( D \) dimensions and the rigid transformation (i.e. translation and rotation) to employ in order to bring one set that close to the other.
Note that the points are paired, i.e. it is known which point in one set should be compared to a given point in the other set. It is possible to give weights to the points. Those weights are determined a priori and do not depend on the distances.
The convention is used that points are column vectors of the input matrices.
typedef T CDPL::Math::KabschAlgorithm< T >::ValueType |
typedef Matrix<T> CDPL::Math::KabschAlgorithm< T >::MatrixType |
typedef Vector<T> CDPL::Math::KabschAlgorithm< T >::VectorType |
|
inline |
Computes the rigid body transformation that aligns a set of \( N \) \( D \)-dimensional points points with a corresponding set of reference points ref_points at a minimum RMSD.
points | A \( D \times N \)-matrix storing the points to align as column vectors. |
ref_points | A \( D \times N \)-matrix storing the reference points as column vectors. |
weights | A \( N \)-dimensional vector storing the non-negative weights that are assigned to the points. |
do_center | true if centering of the data points needs to be performed, and false if not. |
max_svd_iter | The maximum number of iterations to perform in the SV-decomposition, or 0 if no limit. |
true
if convergence in the internal SV-decomposition has been reached in max_svd_iter iterations, and false
otherwise. points().getSize1() == ref_points().getSize1()
points().getSize2() == ref_points().getSize2()
weights().getSize() == points().getSize2()
weights()(i) >= 0 && sum(weights) > 0
Base::SizeError | or Base::ValueError if preconditions got violated. |
|
inline |
Computes the rigid body transformation that aligns a set of \( N \) \( D \)-dimensional points points with a corresponding set of reference points ref_points at a minimum RMSD.
points | A \( D \times N \)-matrix storing the points to align as column vectors. |
ref_points | A \( D \times N \)-matrix storing the reference points as column vectors. |
do_center | true if centering of the data points needs to be performed, and false if not. |
max_svd_iter | The maximum number of iterations to perform in the SV-decomposition, or 0 if no limit. |
true
if convergence in the internal SV-decomposition has been reached in max_svd_iter iterations, and false
otherwise. points().getSize1() == ref_points().getSize1()
points().getSize2() == ref_points().getSize2()
Base::SizeError | if preconditions got violated. |
|
inline |