Skip to content

Commit

Permalink
minor cosmetic improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Slaedr committed Mar 8, 2021
1 parent 598f529 commit dcb26c8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
16 changes: 8 additions & 8 deletions core/test/base/range_accessors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,23 +287,23 @@ class BlockColMajorAccessor3d : public ::testing::Test {
int data[2 * 3 * 4]{
1, 3, 5,
2, 4, 6,
-1,-2,-3,
11,12,13,
-1,-2,-3,
11,12,13,

21,25,29,
22,26,30,
23,27,31,
24,28,32
21,25,29,
22,26,30,
23,27,31,
24,28,32

/* This matrix actually looks like
/* This matrix actually looks like
1, 2, -1, 11,
3, 4, -2, 12,
5, 6, -3, 13,
21, 22, 23, 24,
25, 26, 27, 28,
29, 30, 31, 32
*/
*/
};
// clang-format on
const gko::dim<dimensionality> dim1{2, 3, 4};
Expand Down
12 changes: 7 additions & 5 deletions include/ginkgo/core/base/range_accessors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,12 @@ class row_major<ValueType, 2> {
};


namespace detail {
/**
* Namespace for helper functions and structs for
* the block column major accessor.
*/
namespace detail_block_col_major {
namespace blk_col_major {


/**
Expand Down Expand Up @@ -747,7 +748,8 @@ constexpr GKO_ATTRIBUTES
}


} // namespace detail_block_col_major
} // namespace blk_col_major
} // namespace detail


/**
Expand Down Expand Up @@ -824,7 +826,7 @@ class block_col_major {
dim<dimensionality> size)
: data{data},
lengths(detail::to_array<const size_type>(size)),
stride(detail_block_col_major::default_stride_array(lengths))
stride(detail::blk_col_major::default_stride_array(lengths))
{}

public:
Expand Down Expand Up @@ -853,7 +855,7 @@ class block_col_major {
std::enable_if_t<are_all_integral<Indices...>::value, value_type &>
operator()(Indices &&... indices) const
{
return data[detail_block_col_major::compute_index(
return data[detail::blk_col_major::compute_index(
lengths, stride, std::forward<Indices>(indices)...)];
}

Expand All @@ -873,7 +875,7 @@ class block_col_major {
{
return detail::validate_spans(lengths, spans...),
range<block_col_major>{
data + detail_block_col_major::compute_index(
data + detail::blk_col_major::compute_index(
lengths, stride, (span{spans}.begin)...),
dim<dimensionality>{
(span{spans}.end - span{spans}.begin)...},
Expand Down

0 comments on commit dcb26c8

Please sign in to comment.