From 30f3a76ddf66f6fee9480d9506cd8b66e25747ce Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Thu, 17 Apr 2025 11:52:55 -0400 Subject: [PATCH] Fix docstring `TruncationIntersection` Small change to docstring and add missing constructor. --- src/implementations/truncation.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/implementations/truncation.jl b/src/implementations/truncation.jl index 6088ed7ec..ac0917870 100644 --- a/src/implementations/truncation.jl +++ b/src/implementations/truncation.jl @@ -90,14 +90,17 @@ Truncation strategy to discard the values that are larger than `atol` in absolut 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...) = + TruncationIntersection((trunc, truncs...)) + function Base.:&(trunc1::TruncationStrategy, trunc2::TruncationStrategy) return TruncationIntersection((trunc1, trunc2)) end