@@ -32,26 +32,24 @@ similar "traits": When using [custom structs](@extref Julia
3232operators, even if those structs are not defined as `mutable`, they may still
3333define the in-place interface (typically because their *components* are
3434mutable). Conversely, even types that are "mutable" may want to opt out
35- `evaluate!` for performance reasons.
35+ of `evaluate!` for performance reasons.
3636
3737Mutable abstract arrays ([`ArrayInterface.ismutable`](@extref)) without
3838considerable performance issues
3939([`ArrayInterface.fast_scalar_indexing`](@extref))
4040should support in-place operations.
4141"""
4242supports_inplace (:: Type{<:Vector{ComplexF64}} ) = true
43- supports_inplace (:: Type{T} ) where {T<: AbstractVector } = ismutabletype (T) # fallback
44- # The fallback doesn't actually guarantee that the required interface implied
45- # by `supports_inplace` is fulfilled, but it's a reasonable expectation to
46- # have, and the `check_state` function will test it.
4743
4844supports_inplace (:: Type{<:Matrix} ) = true
4945supports_inplace (:: Type{<:Operator} ) = true
5046supports_inplace (:: Type{<:LinearAlgebra.Diagonal} ) = true
5147supports_inplace (:: Type{<:SparseMatrixCSC} ) = true # XXX is this a good idea?
5248supports_inplace (:: Type{<:ScaledOperator{<:Any,OT}} ) where {OT} = supports_inplace (OT)
49+
50+ # Fallback (both for operators and states)
5351supports_inplace (:: Type{T} ) where {T<: AbstractArray } =
54- ArrayInterface. ismutable (T) && ArrayInterface. fast_scalar_indexing (T) # fallback
52+ ArrayInterface. ismutable (T) && ArrayInterface. fast_scalar_indexing (T)
5553
5654# Generic catch-all for types without a specific method (prevents StackOverflow
5755# from the value→type fallback below)
0 commit comments