Skip to content

Commit 796f596

Browse files
committed
[doc] Minor documentation updates
1 parent 80c8606 commit 796f596

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

c++/itertools/range.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ namespace itertools {
4444
/**
4545
* @brief A lazy range of integers that mimics a Python range.
4646
*
47-
* @details It stores the first value, the last value (excluded) and the step size between two indices.
48-
* By default, the step size is set to 1.
47+
* @details It stores the first value, the last value (excluded) and the step size between two indices. By default,
48+
* the step size is set to 1.
4949
*
5050
* This function returns an iterable lazy object, which can be used in range-based for loops:
5151
*
@@ -164,9 +164,9 @@ namespace itertools {
164164
[[nodiscard]] range operator+(long shift) const { return {first_ + shift, last_ + shift, step_}; }
165165

166166
/**
167-
* @brief Write the range details to std::ostream.
167+
* @brief Write the range details to `std::ostream`.
168168
*
169-
* @param os std::ostream object.
169+
* @param os `std::ostream` object.
170170
* @param rg range object.
171171
* @return Reference to os.
172172
*/

c++/itertools/utils.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace itertools {
6464
*
6565
* @tparam R Range type.
6666
* @param rg Range.
67-
* @return std::vector<T> containing the elements of the range, where T denotes the value type of the range.
67+
* @return `std::vector<T>` containing the elements of the range, where T denotes the value type of the range.
6868
*/
6969
template <typename R> [[nodiscard]] auto make_vector_from_range(R const &rg) {
7070
std::vector<std::decay_t<decltype(*(std::begin(rg)))>> vec{};
@@ -80,14 +80,15 @@ namespace itertools {
8080
/**
8181
* @brief Given an integer range `[first, last)`, divide it as equally as possible into N chunks.
8282
*
83-
* @details It is intended to divide a range among different processes. If the size of the range is not
84-
* divisible by N without a remainder, i.e. `r = (last - first) % N`, then the first `r` chunks have one more element.
83+
* @details It is intended to divide a range among different processes. If the size of the range is not divisible by
84+
* \f$ N \f$ without a remainder, i.e. `r = (last - first) % N`, then the first `r` chunks have one more element.
8585
*
8686
* @param first First value of the range.
8787
* @param last Last value of the range (excluded).
8888
* @param n_chunks Number of chunks to divide the range into.
8989
* @param rank Rank of the calling process.
90-
* @return Pair of indices specifying the first and last (excluded) value of the chunk assigned to the calling process.
90+
* @return Pair of indices specifying the first and last (excluded) value of the chunk assigned to the calling
91+
* process.
9192
*/
9293
[[nodiscard]] inline std::pair<std::ptrdiff_t, std::ptrdiff_t> chunk_range(std::ptrdiff_t first, std::ptrdiff_t last, long n_chunks, long rank) {
9394
auto total_size = last - first;

0 commit comments

Comments
 (0)