19 return v.binaryExpr(box.
lowerbound, binary_real_f(std::fmax))
20 .binaryExpr(box.
upperbound, binary_real_f(std::fmin));
55 return d.dot(
Σ.asDiagonal() *
d);
auto project(const Vec &v, const Box &box)
Project a vector onto a box.
Eigen::Ref< const vec > crvec
Default type for immutable references to vectors.
realvec vec
Default type for vectors.
double real_t
Default floating point type.
real_t dist_squared(crvec v, const Box &box)
Get the distance squared between the given vector and its projection.
auto projecting_difference(const Vec &v, const Box &box)
Get the difference between the given vector and its projection.