Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/implementations/truncation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,17 @@
truncabove(atol) = TruncationKeepFiltered(≤(atol) ∘ abs)

"""
TruncationIntersection(trunc1::TruncationStrategy, trunc2::TruncationStrategy)
TruncationIntersection(trunc::TruncationStrategy, truncs::TruncationStrategy...)

Compose two truncation strategies, keeping values common between the two strategies.
Composition of multiple truncation strategies, keeping values common between them.
"""
struct TruncationIntersection{T<:Tuple{Vararg{TruncationStrategy}}} <:
TruncationStrategy
components::T
end
TruncationIntersection(trunc::TruncationStrategy, truncs::TruncationStrategy...) =

Check warning on line 101 in src/implementations/truncation.jl

View check run for this annotation

Codecov / codecov/patch

src/implementations/truncation.jl#L101

Added line #L101 was not covered by tests
TruncationIntersection((trunc, truncs...))

function Base.:&(trunc1::TruncationStrategy, trunc2::TruncationStrategy)
return TruncationIntersection((trunc1, trunc2))
end
Expand Down
Loading