Skip to content

Commit

Permalink
some documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Slaedr committed Mar 5, 2021
1 parent aa2fc87 commit 86805a7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions include/ginkgo/core/base/range_accessors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ struct row_major_helper_s<ValueType, total_dim, total_dim> {

/**
* Computes the storage index for the given indices with respect to the given
* stride array
* stride array for row-major access
*
* @param size the multi-dimensional sizes of the range of values
* @param stride the stride array
* @param idxs the multi-dimensional indices of the desired entry
*/
template <typename ValueType, size_type total_dim, typename... Indices>
constexpr GKO_ATTRIBUTES ValueType compute_storage_index(
Expand Down Expand Up @@ -639,13 +643,14 @@ namespace detail_block_col_major {


/**
* This helper runs from first to last dimension in order to compute the index.
* Runs from first to last dimension in order to compute the index.
*
* The index is computed like this:
* indices: x1, x2, x3, ..., xn
* compute(stride, x1, x2, x3, ..., x(n-1), xn) ->
* x1 * stride[0] + x2 * stride[1] + ...
* + x(n-2) * stride[n-3] + x(n-1) + xn * stride[n-2]
* Note that swap of the last two strides, making this 'column major'.
* Note that swap of the last two strides, making this 'block column major'.
*/
template <typename ValueType, size_type total_dim, size_type current_iter = 1>
struct index_helper_s {
Expand Down Expand Up @@ -695,8 +700,11 @@ struct index_helper_s<ValueType, total_dim, total_dim> {
};

/**
* Computes the storage index for the given indices with respect to the given
* stride array
* Computes the flat storage index for block-column-major access.
*
* @param size the multi-dimensional sizes of the range of values
* @param stride the stride array
* @param idxs the multi-dimensional indices of the desired entry
*/
template <typename ValueType, size_type total_dim, typename... Indices>
constexpr GKO_ATTRIBUTES ValueType compute_index(
Expand Down

0 comments on commit 86805a7

Please sign in to comment.