Commit c7d6cb36 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#9 Remove an unused function.

parent f6271ac7
......@@ -196,30 +196,6 @@ namespace HappyHeart
LocalCoords ComputeMiddle(const Advanced::LocalCoords& coords1, const Advanced::LocalCoords& coords2)
assert(coords1.GetDimension() == coords2.GetDimension());
const std::vector<double>& coords_as_double_1 = coords1.GetCoordinates();
const std::vector<double>& coords_as_double_2 = coords2.GetCoordinates();
const std::size_t Ncomponent = coords_as_double_1.size();
std::vector<double> ret_values(Ncomponent);
for (std::size_t i = 0ul; i < Ncomponent; ++i)
ret_values[i] = 0.5 * (coords_as_double_1[i] + coords_as_double_2[i]);
LocalCoords ret(ret_values);
// Check here the result is the same as the one from ComputeCenterOfGravity().
// It is not implemented in term of this one as ComputeMiddle() avoid some copies; but the result should
// be identical.
assert(ret == ComputeCenterOfGravity(std::vector<Advanced::LocalCoords>({ coords1, coords2 })));
return ret;
double Distance(const LocalCoords& point1, const LocalCoords& point2)
double sum = 0.;
......@@ -147,13 +147,6 @@ namespace HappyHeart
bool operator==(const Advanced::LocalCoords& lhs, const Advanced::LocalCoords& rhs);
* \brief Return the middle of two LocalCoords.
* It is assumed here (and asserted in debug) that both arguments are the same dimension.
LocalCoords ComputeMiddle(const Advanced::LocalCoords& coords1, const Advanced::LocalCoords& coords2);
* \brief Return the center of gravity of several LocalCoords.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment