Skip to content

Commit 2cb48c9

Browse files
committed
Add docstrings truncation
1 parent a22910c commit 2cb48c9

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
# Truncations
2+
3+
Currently, truncations are supported through the following different methods:
4+
5+
```@docs; canonical=false
6+
truncrank
7+
trunctol
8+
truncabove
9+
```

src/implementations/truncation.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,25 @@ end
6161
TruncationKeepBelow(atol::Real, rtol::Real) = TruncationKeepBelow(promote(atol, rtol)...)
6262

6363
# TODO: better names for these functions of the above types
64+
"""
65+
truncrank(howmany::Int, by=abs, rev=true)
66+
67+
Truncation strategy to keep the first `howmany` values when sorted according to `by` or the last `howmany` if `rev` is true.
68+
"""
6469
truncrank(howmany::Int, by=abs, rev=true) = TruncationKeepSorted(howmany, by, rev)
70+
71+
"""
72+
trunctol(atol::Real)
73+
74+
Truncation strategy to discard the values that are smaller than `atol` in absolute value.
75+
"""
6576
trunctol(atol) = TruncationKeepFiltered((atol) abs)
77+
78+
"""
79+
truncabove(atol::Real)
80+
81+
Truncation strategy to discard the values that are larger than `atol` in absolute value.
82+
"""
6683
truncabove(atol) = TruncationKeepFiltered((atol) abs)
6784

6885
# truncate!

0 commit comments

Comments
 (0)