* dimension to a coordinate index in dim + 1 dimensions.
*
* @param locked_coordinate should be in the range [0, dim+1).
- * @param coordiante_in_dim should be in the range [0, dim).
+ * @param coordinate_in_dim should be in the range [0, dim).
* @return A coordinate index in the range [0, dim+1)
*
* @relates BoundingBox
*/
template <int dim>
- inline unsigned int
- coordinate_to_one_dim_higher(const unsigned int locked_coordinate,
- const unsigned int coordiante_in_dim)
+ inline int
+ coordinate_to_one_dim_higher(const int locked_coordinate,
+ const int coordinate_in_dim)
{
AssertIndexRange(locked_coordinate, dim + 1);
- AssertIndexRange(coordiante_in_dim, dim);
- return (locked_coordinate + coordiante_in_dim + 1) % (dim + 1);
+ AssertIndexRange(coordinate_in_dim, dim);
+ return (locked_coordinate + coordinate_in_dim + 1) % (dim + 1);
}
} // namespace internal
}
// Finding the intersection's dimension
-
- unsigned int intersect_dim = spacedim;
+ int intersect_dim = spacedim;
for (unsigned int d = 0; d < spacedim; ++d)
if (std::abs(intersect_bbox_min[d] - intersect_bbox_max[d]) <=
std::numeric_limits<Number>::epsilon() *
std::abs(intersect_bbox_max[d])))
--intersect_dim;
- if (intersect_dim == 0 || intersect_dim + 2 == spacedim)
+ if (intersect_dim == 0 || intersect_dim == spacedim - 2)
return NeighborType::simple_neighbors;
// Checking the two mergeable cases: first if the boxes are aligned so