|
10 | 10 | A bunch of tools for using tuples (mostly homogeneous tuples `NTuple{N}`) as a collection and performing a number of operations with an inferrable result, typically also an `NTuple{M}` with inferrable length `M`. Type inference breaks down if some of the final or intermediate tuples exceed `MAX_TUPLETYPE_LEN`, meaning inference typically works up to output tuples of length `13` or `14`. Chosen implementations are typically faster than the corresponding functions in base for those small tuple lengths, but can be slower for larger tuples. Inference also breaks down for most functions in case of inhomogeneous tuples.
|
11 | 11 |
|
12 | 12 |
|
| 13 | +Note that none of the following functions are exported, since their name often collides with the equivalent from `Base`. |
| 14 | + |
| 15 | + |
13 | 16 | <a id='Types-1'></a>
|
14 | 17 |
|
15 | 18 | ## Types
|
@@ -140,16 +143,72 @@ prod(t::Tuple)
|
140 | 143 |
|
141 | 144 | Returns the product of the elements of a tuple, or `1` for an empty tuple.
|
142 | 145 |
|
| 146 | +<a id='TupleTools.minimum' href='#TupleTools.minimum'>#</a> |
| 147 | +**`TupleTools.minimum`** — *Function*. |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | +``` |
| 152 | +minimum(t::Tuple) |
| 153 | +``` |
| 154 | + |
| 155 | +Returns the smallest element of a tuple |
| 156 | + |
| 157 | +<a id='TupleTools.maximum' href='#TupleTools.maximum'>#</a> |
| 158 | +**`TupleTools.maximum`** — *Function*. |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | +``` |
| 163 | +maximum(t::Tuple) |
| 164 | +``` |
| 165 | + |
| 166 | +Returns the largest element of a tuple |
| 167 | + |
| 168 | +<a id='TupleTools.findmin' href='#TupleTools.findmin'>#</a> |
| 169 | +**`TupleTools.findmin`** — *Function*. |
| 170 | + |
| 171 | + |
| 172 | + |
| 173 | +``` |
| 174 | +findmin(t::Tuple) |
| 175 | +``` |
| 176 | + |
| 177 | +Returns the value and index of the minimum element in a tuple. If there are multiple minimal elements, then the first one will be returned. |
| 178 | + |
| 179 | +<a id='TupleTools.findmax' href='#TupleTools.findmax'>#</a> |
| 180 | +**`TupleTools.findmax`** — *Function*. |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | +``` |
| 185 | +findmax(t::Tuple) |
| 186 | +``` |
| 187 | + |
| 188 | +Returns the value and index of the maximum element in a tuple. If there are multiple maximal elements, then the first one will be returned. |
| 189 | + |
| 190 | +<a id='TupleTools.indmin' href='#TupleTools.indmin'>#</a> |
| 191 | +**`TupleTools.indmin`** — *Function*. |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | +``` |
| 196 | +indmin(t::Tuple) |
| 197 | +``` |
| 198 | + |
| 199 | +Returns the index of the minimum element in a tuple. If there are multiple minimal elements, then the first one will be returned. |
| 200 | + |
| 201 | +<a id='TupleTools.indmax' href='#TupleTools.indmax'>#</a> |
| 202 | +**`TupleTools.indmax`** — *Function*. |
| 203 | + |
| 204 | + |
143 | 205 |
|
144 | 206 | ```
|
145 |
| -TupleTools.minimum |
146 |
| -TupleTools.maximum |
147 |
| -TupleTools.findmin |
148 |
| -TupleTools.findmax |
149 |
| -TupleTools.indmin |
150 |
| -TupleTools.indmax |
| 207 | +indmax(t::Tuple) |
151 | 208 | ```
|
152 | 209 |
|
| 210 | +Returns the index of the maximum element in a tuple. If there are multiple minimal elements, then the first one will be returned. |
| 211 | + |
153 | 212 | <a id='TupleTools.sort' href='#TupleTools.sort'>#</a>
|
154 | 213 | **`TupleTools.sort`** — *Function*.
|
155 | 214 |
|
|
0 commit comments