9 #ifndef IMPALGEBRA_DISTANCE_H
10 #define IMPALGEBRA_DISTANCE_H
12 #include <IMP/algebra/algebra_config.h>
17 IMPALGEBRA_BEGIN_NAMESPACE
26 template <
class Vector3DsOrXYZs0,
class Vector3DsOrXYZs1>
28 const Vector3DsOrXYZs0& m1,
29 const Vector3DsOrXYZs1& m2) {
30 using algebra::get_vector_geometry;
32 std::distance(m2.begin(), m2.end()),
33 "The input sets of XYZ points "
34 <<
"should be of the same size");
36 typename Vector3DsOrXYZs0::const_iterator it0 = m1.begin();
37 typename Vector3DsOrXYZs1::const_iterator it1 = m2.begin();
38 for (; it0 != m1.end(); ++it0, ++it1) {
42 return std::sqrt(rmsd / m1.size());
46 template <
class Vector3DsOrXYZs0,
class Vector3DsOrXYZs1>
47 inline double get_rmsd(
const Vector3DsOrXYZs0& m1,
const Vector3DsOrXYZs1& m2) {
51 IMPALGEBRA_END_NAMESPACE
Import IMP/kernel/base_types.h in the namespace.
double get_squared_distance(const VectorD< D > &v1, const VectorD< D > &v2)
compute the squared distance between two vectors
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
double get_rmsd(const Vector3DsOrXYZs0 &m1, const Vector3DsOrXYZs1 &m2)
Transformation3D get_identity_transformation_3d()
Return a transformation that does not do anything.
double get_rmsd_transforming_first(const Transformation3D &tr, const Vector3DsOrXYZs0 &m1, const Vector3DsOrXYZs1 &m2)
Calculate the root mean square deviation between two sets of 3D points.