@@ -49,21 +49,22 @@ struct DynamicTruncation{T1<:RealOrNothing,T2<:RealOrNothing,T3<:RealOrNothing,T
4949 tol_factor:: T6
5050 rank_factor:: T7
5151 function DynamicTruncation (;
52- atol= nothing ,
53- atol_min = isnothing (atol) ? nothing : zero (atol),
54- rtol= nothing ,
55- rtol_min = isnothing (rtol) ? nothing : zero (rtol),
56- maxrank= nothing ,
57- maxrank_max = isnothing (maxrank) ? nothing : typemax (Int),
58- maxerror= nothing ,
59- maxerror_min = isnothing (maxerror) ? nothing : zero (maxerror),
60- filter= nothing ,
61- tol_factor= 1.0 ,
62- rank_factor= 1.0
63- )
64- @assert isnothing (tol_factor) || 1 >= tol_factor > 0 " tol_factor must be in (0, 1]"
65- @assert isnothing (rank_factor) || rank_factor >= 0 " rank_factor must be positive"
66- return new (atol, atol_min, rtol, rtol_min, maxrank, maxrank_max, maxerror, maxerror_min, filter, tol_factor, rank_factor)
52+ atol= nothing ,
53+ atol_min = isnothing (atol) ? nothing : zero (atol),
54+ rtol= nothing ,
55+ rtol_min = isnothing (rtol) ? nothing : zero (rtol),
56+ maxrank= nothing ,
57+ maxrank_max = isnothing (maxrank) ? nothing : typemax (Int),
58+ maxerror= nothing ,
59+ maxerror_min = isnothing (maxerror) ? nothing : zero (maxerror),
60+ filter= nothing ,
61+ tol_factor= 1.0 ,
62+ rank_factor= 1.0
63+ )
64+ @assert isnothing (tol_factor) || 1 >= tol_factor > 0 " tol_factor must be in (0, 1]"
65+ @assert isnothing (rank_factor) || rank_factor >= 0 " rank_factor must be positive"
66+ return new (atol, atol_min, rtol, rtol_min, maxrank, maxrank_max, maxerror, maxerror_min, filter, tol_factor, rank_factor)
67+ end
6768end
6869
6970function _clamp (a:: Nothing ,b,c,factor)
@@ -108,3 +109,6 @@ function updatetruncation(alg::DynamicTruncation; iter::Integer=0, current_rank:
108109 maxrank = new_maxrank,
109110 )
110111end
112+
113+
114+ end
0 commit comments