1 #ifndef TIL_RANGE_TOOLS_H 2 #define TIL_RANGE_TOOLS_H 12 template <
typename T, std::
size_t D>
20 range.
set_bounds(center - halfSize, center + halfSize);
24 template <
typename T, std::
size_t D>
32 for (
int i = 0; i < D; ++i) { assert(size[i]%2); }
33 range.
set_bounds(center - size/2, center + size/2);
void set_bounds(const numeric_array< T, D > &minBounds, const numeric_array< T, D > &maxBounds)
Set min and max bounds.
Belongs to package Box Do not include directly, include til/Box.h instead.
numeric_array< T, D > size(const Box< T, D > &box)
Return the size of a box.
void setCenterAndHalfSizes(Range< T, D > &range, const numeric_array< T, D > ¢er, const numeric_array< T, D > &halfSize)
Set range using its center and half sizes.
void setCenterAndSizes(Range< T, D > &range, const numeric_array< T, D > ¢er, const numeric_array< T, D > &size)
Set range using its center and its size.
Describe integer cube ranges (e.g.