Skip to content

Commit c60fdc0

Browse files
committed
Algorithms should be good to go
1 parent 0ac8105 commit c60fdc0

27 files changed

+410
-313
lines changed

include/kumi/algorithm/apply.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ namespace kumi
1111
{
1212
//====================================================================================================================
1313
//! @ingroup transforms
14-
//! @brief Invoke the Callable object f with the elements of product type unrolled as arguments.
14+
//! @brief Invoke the Callable object f with the elements of the product type unrolled as arguments.
1515
//!
16-
//! @note f is applied on the underlying values when the input `t` is a record type
16+
//! `f` is applied on the underlying values when the input `t` is a record type
1717
//!
1818
//! @param f Callable object to be invoked
1919
//! @param t Product Type whose elements are used as arguments to f

include/kumi/algorithm/cast.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace kumi
3535
//!
3636
//! @tparam Target destination type to associate to each member of the product type `t`
3737
//! @param t Product type to convert
38-
//! @return A Product type containing the values of t where each member is of type Target
38+
//! @return A Product type containing the values of `t` where each member is of type Target
3939
//!
4040
//! ## Helper type
4141
//! @code

include/kumi/algorithm/contains.hpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ namespace kumi
1616
}
1717

1818
//====================================================================================================================
19-
//! @ingroup queries
20-
//! @brief Checks if a product type contains a given identifier
19+
//! @ingroup queries
20+
//! @brief Checks if a product type contains a given identifier
2121
//!
22-
//! @param t the product type to inspect.
22+
//! @param t the product type to inspect.
2323
//! @param id Identifier to check
24-
//! @return `true` if the current product_type contains a field named with the `id` identifier, and `false` otherwise.
24+
//! @return `true` if the `t` contains a field labeled with the `id` identifier, `false` otherwise.
2525
//!
2626
//! ## Examples:
2727
//! @include doc/tuple/algo/contains.cpp
@@ -45,12 +45,12 @@ namespace kumi
4545
}
4646

4747
//====================================================================================================================
48-
//! @ingroup queries
49-
//! @brief Checks if a product type contains at least one of many identifiers
48+
//! @ingroup queries
49+
//! @brief Checks if a product type contains at least one of many identifiers
5050
//!
51-
//! @param t the product type to inspect.
52-
//! @param ids Identifiers to check
53-
//! @return `true` if current product_type contains a field based on the `ids`, and `false` otherwise.
51+
//! @param t the product type to inspect.
52+
//! @param ids Identifiers to check
53+
//! @return `true` if `t` contains a field labeld by one of the `ids`, and `false` otherwise.
5454
//!
5555
//! ## Examples:
5656
//! @include doc/tuple/algo/contains_any.cpp
@@ -65,12 +65,12 @@ namespace kumi
6565
}
6666

6767
//==================================================================================================================
68-
//! @ingroup queries
69-
//! @brief Checks if a product type contains fields based only on selected identifiers
68+
//! @ingroup queries
69+
//! @brief Checks if a product type contains fields based only on selected identifiers
7070
//!
71-
//! @param t the product type to inspect.
72-
//! @param ids Identifiers to check
73-
//! @return `true` if current the product_type contains a field based on any of the `ids`, and `false` otherwise.
71+
//! @param t the product type to inspect.
72+
//! @param ids Identifiers to check
73+
//! @return `true` if `t` contains a field labeled by any of the `ids`, and `false` otherwise.
7474
//!
7575
//! ## Examples:
7676
//! @include doc/tuple/algo/contains_only.cpp
@@ -89,12 +89,12 @@ namespace kumi
8989
}
9090

9191
//==================================================================================================================
92-
//! @ingroup queries
93-
//! @brief Checks if a product type contains no fields based on any of the selected identifiers
92+
//! @ingroup queries
93+
//! @brief Checks if a product type contains no fields based on any of the selected identifiers
9494
//!
95-
//! @param t the product type to inspect.
96-
//! @param ids Identifiers to check
97-
//! @return `true` if the current product_type contains no field based on any of the `ids`, and `false` otherwise.
95+
//! @param t the product type to inspect.
96+
//! @param ids Identifiers to check
97+
//! @return `true` if `t` contains no field labeled by any of the `ids`, and `false` otherwise.
9898
//!
9999
//! ## Examples:
100100
//! @include doc/tuple/algo/contains_none.cpp

include/kumi/algorithm/extract.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
namespace kumi
1111
{
1212
//====================================================================================================================
13-
//! @ingroup generators
14-
//! @brief Extracts a sub product type from a product type
13+
//! @ingroup generators
14+
//! @brief Extracts a sub product type from a product type
1515
//!
16-
//! On record types, this function operates structurally and extract elements as if they were ordered. The considered
17-
//! order is the order of declaration.
16+
//! On record types, this function operates on elements as if they were ordered. The considered order is the order
17+
//! of declaration.
1818
//!
1919
//! @note Does not participate in overload resolution if `I0` and `I1` do not verify that
2020
//! `0 <= I0 <= I1 <= size_v<T>`.
2121
//! @param t Product Type to extract from
2222
//! @param i0 Compile-time index of the first element to extract.
2323
//! @param i1 Compile-time index past the last element to extract. By default, `i1` is equal to
2424
//! `size_v<T>`.
25-
//! @return A new product type containing to the selected elements of the input product type.
25+
//! @return A new product type containing the selected elements of `t`.
2626
//!
2727
//! ## Helper type
2828
//! @code
@@ -62,18 +62,18 @@ namespace kumi
6262
}
6363

6464
//====================================================================================================================
65-
//! @ingroup generators
66-
//! @brief Split a product type into two
65+
//! @ingroup generators
66+
//! @brief Split a product type into two
6767
//!
6868
//! Split a product type in two product_type containing all the elements before and after a given index.
69-
//! On record types, this function operates structurally and extract elements as if they were ordered. The considered
70-
//! order is the order of declaration.
69+
//! On record types, this function operates on elements as if they were ordered. The considered order is the order
70+
//! of declaration.
7171
//!
7272
//! @note Does not participate in overload resolution if `I0` is not in `[0, sizeof...(Ts)[`.
7373
//!
7474
//! @param t Product Type to split.
7575
//! @param i0 Compile-time index of the split pivot.
76-
//! @return A new tuple containing the two sub product types cut at index I.
76+
//! @return A new tuple containing the two sub parts of `t` cut at index I.
7777
//!
7878
//! ## Helper type
7979
//! @code

include/kumi/algorithm/find.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@
1010
namespace kumi
1111
{
1212
//====================================================================================================================
13-
//! @ingroup queries
14-
//! @brief Return the index of a value which type satisfies a given predicate
13+
//! @ingroup queries
14+
//! @brief Return the index of a value which type satisfies a given predicate
1515
//!
1616
//! On record types, this function operates as if the elements are ordered. The considered order is the order of
1717
//! declaration.
1818
//!
1919
//! @param t Product Type to process
2020
//! @param p Unary predicate. p must return a value convertible to `bool` for every element of t.
21-
//! @return Integral index of the element inside the product type if present, kumi::size<T>::value
22-
//! otherwise.
21+
//! @return Integral index of the element inside `t` if present, kumi::size<T>::value otherwise.
2322
//!
2423
//! ## Examples:
2524
//! @include doc/tuple/algo/locate.cpp

include/kumi/algorithm/flatten.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ namespace kumi
8282
}
8383

8484
//====================================================================================================================
85-
//! @ingroup generators
86-
//! @brief Converts a product type of product types into a product type of all elements.
85+
//! @ingroup generators
86+
//! @brief Converts a product type of product types into a product type of all elements.
8787
//!
8888
//! On record types, the names of the outer record are concatenated to the inner ones ultimately constructing names
8989
//! such as "outer.inner". If the input is a product type containing record types or vice versa only the inner types
9090
//! matching the outer semantic will be flattened. Thus a record inside a tuple will not be flattened.
9191
//!
9292
//! @param t Product type to flatten
93-
//! @return A product type composed of all elements of t flattened non-recursively
93+
//! @return A product type composed of all elements of `t` flattened non-recursively
9494
//!
9595
//! ## Helper type
9696
//! @code
@@ -127,8 +127,8 @@ namespace kumi
127127
}
128128

129129
//====================================================================================================================
130-
//! @ingroup generators
131-
//! @brief Recursively converts a product type of product types into a product type of all elements.
130+
//! @ingroup generators
131+
//! @brief Recursively converts a product type of product types into a product type of all elements.
132132
//!
133133
//! Recursively converts a product type of product types `t` into a product type of all elements of
134134
//! said product types.
@@ -142,7 +142,7 @@ namespace kumi
142142
//!
143143
//! @param t Product type to flatten
144144
//! @param f Optional Callable object to apply when a sub-tuple is flattened
145-
//! @return A product type composed of all elements of t flattened recursively
145+
//! @return A product type composed of all elements of `t` flattened recursively
146146
//!
147147
//! ## Helper type
148148
//! @code
@@ -196,15 +196,15 @@ namespace kumi
196196
}
197197

198198
//====================================================================================================================
199-
//! @ingroup generators
200-
//! @brief Convert a product type to a flat product type of pointers to each its components.
199+
//! @ingroup generators
200+
//! @brief Convert a product type to a flat product type of pointers to each its components.
201201
//!
202202
//! On record types, the names of the outer record are concatenated to the inner ones ultimately constructing names
203203
//! such as "outer.inner". If the input is a product type containing record types or vice versa only the inner types
204204
//! matching the outer semantic will be flattened. Thus a record inside a tuple will not be flattened.
205205
//!
206206
//! @param t Product type to convert
207-
//! @return A flat product type composed of pointers to each elements of t.
207+
//! @return A flat product type composed of pointers to each elements of `t`.
208208
//!
209209
//! ## Helper type
210210
//! @code

include/kumi/algorithm/fold.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
namespace kumi
1111
{
1212
//====================================================================================================================
13-
//! @ingroup reductions
14-
//! @brief Computes the generalized combination of all elements using a tail recursive call.
13+
//! @ingroup reductions
14+
//! @brief Computes the generalized combination of all elements using a tail recursive call.
1515
//!
1616
//! On record types, this function operates on the underlying values, not on the fields themselves.
1717
//!
@@ -51,8 +51,8 @@ namespace kumi
5151
}
5252

5353
//====================================================================================================================
54-
//! @ingroup reductions
55-
//! @brief Computes the generalized associative combination of all elements using a tail recursive call.
54+
//! @ingroup reductions
55+
//! @brief Computes the generalized associative combination of all elements using a tail recursive call.
5656
//!
5757
//! On record types, this function operates on the underlying values, not on the fields themselves.
5858
//!
@@ -90,8 +90,8 @@ namespace kumi
9090
}
9191

9292
//====================================================================================================================
93-
//! @ingroup reductions
94-
//! @brief Computes the generalized combination of all elements using a non-tail recursive call.
93+
//! @ingroup reductions
94+
//! @brief Computes the generalized combination of all elements using a non-tail recursive call.
9595
//!
9696
//! On record types, this function operates on the underlying values, not on the fields themselves.
9797
//!
@@ -131,8 +131,8 @@ namespace kumi
131131
}
132132

133133
//====================================================================================================================
134-
//! @ingroup reductions
135-
//! @brief Computes the generalized associative combinationof all elements using a non-tail recursive call.
134+
//! @ingroup reductions
135+
//! @brief Computes the generalized associative combinationof all elements using a non-tail recursive call.
136136
//!
137137
//! On record types, this function operates on the underlying values, not on the fields themselves.
138138
//!

include/kumi/algorithm/for_each.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
namespace kumi
1111
{
1212
//====================================================================================================================
13-
//! @ingroup transforms
14-
//! @brief Applies the Callable object f on each element of a product type. f is applied on the
15-
//! values if the given product_type is a record type.
13+
//! @ingroup transforms
14+
//! @brief Applies the Callable object f on each element of a product type. `f` is applied on the values if the
15+
//! given product_type is a record type.
1616
//!
1717
//! @note This function does not take part in overload resolution if `f` can't be applied to the
1818
//! elements of `t` and/or `ts`.
@@ -58,8 +58,8 @@ namespace kumi
5858
}
5959

6060
//================================================================================================
61-
//! @ingroup tuple_transforms
62-
//! @brief Applies the Callable object f on each element of a product type and its index.
61+
//! @ingroup tuple_transforms
62+
//! @brief Applies the Callable object `f` on each element of a product type and its index.
6363
//!
6464
//! @note This function does not take part in overload resolution if `f` can't be applied to the
6565
//! elements of `t` and/or `ts` and an integral constant. This function cannot be applied
@@ -92,11 +92,11 @@ namespace kumi
9292

9393
//================================================================================================
9494
//! @ingroup record_transforms
95-
//! @brief Applies the Callable object f on each element of a record type and its field.
95+
//! @brief Applies the Callable object `f` on each element of a record type and its field.
9696
//!
9797
//! @note This function does not take part in overload resolution if `f` can't be applied to the
9898
//! elements of `t` and those of `ts`. This function can only be applied to record types.
99-
//! The function needs to be define to handle types modeling kumi::concepts::field.
99+
//! The function needs to be defined to handle types modeling kumi::concepts::field.
100100
//!
101101
//! @param f Callable object to be invoked
102102
//! @param r Record type whose fields are used as arguments to f

include/kumi/algorithm/generate.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
namespace kumi
1111
{
1212
//====================================================================================================================
13-
//! @ingroup generators
14-
//! @brief Creates a kumi::tuple containing `N` copies of `v`.
13+
//! @ingroup generators
14+
//! @brief Creates a kumi::tuple containing `N` copies of `v`.
1515
//!
1616
//! @tparam N Number of replications
1717
//! @param v Value to replicate
@@ -42,8 +42,8 @@ namespace kumi
4242
}
4343

4444
//====================================================================================================================
45-
//! @ingroup generators
46-
//! @brief Creates a kumi::tuple containing `N` applications of the `f` Callable.
45+
//! @ingroup generators
46+
//! @brief Creates a kumi::tuple containing `N` applications of the `f` Callable.
4747
//!
4848
//! @tparam N Number of replications
4949
//! @param f Callable to apply
@@ -73,8 +73,8 @@ namespace kumi
7373
}
7474

7575
//====================================================================================================================
76-
//! @ingroup generators
77-
//! @brief Creates a kumi::tuple containing an increasing ramp of values.
76+
//! @ingroup generators
77+
//! @brief Creates a kumi::tuple containing an increasing ramp of values.
7878
//!
7979
//! @tparam N Number of replications
8080
//! @param v Seed value

include/kumi/algorithm/inner_product.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ namespace kumi
3434
}
3535

3636
//====================================================================================================================
37-
//! @ingroup reductions
38-
//! @brief Computes inner product (i.e. sum of products)
37+
//! @ingroup reductions
38+
//! @brief Computes inner product (i.e. sum of products)
3939
//!
4040
//! Computes the generalized sum of products of the elements of two product types. By default,
4141
//! `+` and `*` is used.
4242
//!
43-
//! On record types, operates by pair of fields sharing the same name.
43+
//! On record types, operates by pair of fields sharing the same label.
4444
//!
4545
//! @note Does not participate in overload resolution if product types' size are not equal or if any of
4646
//! the binary operations can't be applied on the product types' elements. Similarily, doesn't participate

0 commit comments

Comments
 (0)