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
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.
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)
Returns the centroid of a set of vectors.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
A nullptr-initialized pointer to an IMP Object.
A shared base class to help in debugging and things.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.