Skip to content

Commit db9e99b

Browse files
authored
Merge pull request #329 from dglaeser/fix/image-grid-lower-left
[imagegrid][cleanup] Fix local variable name
2 parents 302e762 + 3c282f8 commit db9e99b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

gridformat/grid/image_grid.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ class ImageGrid {
9494
ImageGrid(std::array<CoordinateType, dim> origin,
9595
std::array<CoordinateType, dim> size,
9696
std::array<std::size_t, dim> cells)
97-
: _lower_right{std::move(origin)}
98-
, _upper_right{Ranges::apply_pairwise<CoordinateType>(std::plus{}, _lower_right, size)}
97+
: _lower_left{std::move(origin)}
98+
, _upper_right{Ranges::apply_pairwise<CoordinateType>(std::plus{}, _lower_left, size)}
9999
, _spacing{_compute_spacing(cells)}
100100
, _cell_index_tuples{MDLayout{cells}}
101101
, _point_index_tuples{MDLayout{Ranges::incremented(cells, 1)}}
@@ -109,7 +109,7 @@ class ImageGrid {
109109
std::size_t number_of_points() const { return _point_index_tuples.size(); }
110110
std::size_t number_of_cells(unsigned int direction) const { return _cell_index_tuples.size(direction); }
111111
std::size_t number_of_points(unsigned int direction) const { return _point_index_tuples.size(direction); }
112-
const auto& origin() const { return _lower_right; }
112+
const auto& origin() const { return _lower_left; }
113113
const auto& spacing() const { return _spacing; }
114114

115115
//! Return an array containing the number of cells in all directions
@@ -187,14 +187,14 @@ class ImageGrid {
187187

188188
private:
189189
CoordinateType _ordinate_at(std::size_t i, int direction) const {
190-
return _lower_right[direction] + _spacing[direction]*static_cast<CoordinateType>(i);
190+
return _lower_left[direction] + _spacing[direction]*static_cast<CoordinateType>(i);
191191
}
192192

193193
template<Concepts::StaticallySizedMDRange<1> Cells>
194194
auto _compute_spacing(Cells&& cells) const {
195195
return Ranges::apply_pairwise(
196196
std::divides{},
197-
Ranges::apply_pairwise(std::minus{}, _upper_right, _lower_right),
197+
Ranges::apply_pairwise(std::minus{}, _upper_right, _lower_left),
198198
cells
199199
);
200200
}
@@ -209,7 +209,7 @@ class ImageGrid {
209209
return result;
210210
}
211211

212-
std::array<CoordinateType, dim> _lower_right;
212+
std::array<CoordinateType, dim> _lower_left;
213213
std::array<CoordinateType, dim> _upper_right;
214214
std::array<CoordinateType, dim> _spacing;
215215
MDIndexRange _cell_index_tuples;

0 commit comments

Comments
 (0)