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.
Common base class for heavy weight IMP objects.
A bounding box in D dimensions.
A weak pointer to an Object or RefCountedObject.
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.
double get_distance(const Line3D &s, const Vector3D &p)
Get closest distance between a line and a point.