File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,7 +201,13 @@ macro functiondef(f)
201201 # define default algorithm fallbacks for out-of-place functions
202202 # in terms of the corresponding in-place function for types,
203203 # in principle this is covered by the definition above but
204- # it is necessary to avoid ambiguity errors
204+ # it is necessary to avoid ambiguity errors with the generic definitions:
205+ # ```julia
206+ # default_algorithm(f::F, A; kwargs...) where {F} = default_algorithm(f, typeof(A); kwargs...)
207+ # function default_algorithm(f::F, ::Type{T}; kwargs...) where {F,T}
208+ # throw(MethodError(default_algorithm, (f, T)))
209+ # end
210+ # ```
205211 @inline function default_algorithm (:: typeof ($ f), :: Type{A} ; kwargs... ) where {A}
206212 return default_algorithm ($ f!, A; kwargs... )
207213 end
Original file line number Diff line number Diff line change 6363 ComplexF64)
6464 rng = StableRNG (123 )
6565 m = 4
66- V = qr_compact ( randn (rng, T, m, m))[ 1 ]
66+ V = randn (rng, T, m, m)
6767 D = Diagonal ([0.9 , 0.3 , 0.1 , 0.01 ])
68- A = V * D * V '
68+ A = V * D * inv (V)
6969 alg = TruncatedAlgorithm (LAPACK_Simple (), truncrank (2 ))
7070 D2, V2 = @constinferred eig_trunc (A; alg)
7171 @test diagview (D2) ≈ diagview (D)[1 : 2 ] rtol = sqrt (eps (real (T)))
You can’t perform that action at this time.
0 commit comments