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