8 #ifndef IMPALGEBRA_VECTOR_METRICS_H
9 #define IMPALGEBRA_VECTOR_METRICS_H
21 IMPALGEBRA_BEGIN_NAMESPACE
38 return get_l2_norm(a - b);
42 VectorKD sum = std::accumulate(vs.begin(), vs.end(),
44 return sum / vs.size();
56 return get_linf_norm(a - b);
62 return .5 * (bb.get_corner(0) + bb.get_corner(1));
67 IMPALGEBRA_END_NAMESPACE
BoundingBoxD<-1 > BoundingBoxKD
Typedef for Python.
VectorD< D > get_zero_vector_kd(int Di)
Return a dynamically sized vector of zeros.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
The l2 norm on the distance vector.
double get_distance(const Plane3D &pln, const Vector3D &p)
Return the distance between a plane and a point in 3D.
Common base class for heavy weight IMP objects.
A bounding box in D dimensions.
A nullptr-initialized pointer to an Object.
An axis-aligned bounding box.
Vector3D get_centroid(const Vector3Ds &ps)
Return the centroid of a set of vectors.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
A nullptr-initialized pointer to an IMP Object.
A shared base class to help in debugging and things.
The base class for a metric on VectorKDs.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.