@@ -4,36 +4,30 @@ struct WrappedMap{T, A<:MapOrVecOrMat} <: LinearMap{T}
44 _ishermitian:: Bool
55 _isposdef:: Bool
66end
7- function WrappedMap {T} (lmap:: MapOrMatrix ;
7+ function WrappedMap {T} (lmap:: MapOrVecOrMat ;
88 issymmetric:: Bool = _issymmetric (lmap),
99 ishermitian:: Bool = _ishermitian (lmap),
1010 isposdef:: Bool = _isposdef (lmap)) where {T}
1111 WrappedMap {T, typeof(lmap)} (lmap, issymmetric, ishermitian, isposdef)
1212end
13- function WrappedMap {T} (lmap:: AbstractVector ;
14- issym:: Bool = false ,
15- isherm:: Bool = false ,
16- ispd:: Bool = false ) where {T}
17- WrappedMap {T, typeof(lmap)} (lmap,
18- length (lmap) == 1 && issymmetric (first (lmap)),
19- length (lmap) == 1 && ishermitian (first (lmap)),
20- length (lmap) == 1 && isposdef (first (lmap)))
21- end
2213WrappedMap (lmap:: MapOrVecOrMat{T} ; kwargs... ) where {T} = WrappedMap {T} (lmap; kwargs... )
2314
2415# cheap property checks (usually by type)
16+ _issymmetric (A:: AbstractVector ) = length (A) == 1 && issymmetric (first (A))
2517_issymmetric (A:: AbstractMatrix ) = false
2618_issymmetric (A:: AbstractQ ) = false
2719_issymmetric (A:: LinearMap ) = issymmetric (A)
2820_issymmetric (A:: LinearAlgebra.RealHermSymComplexSym ) = issymmetric (A)
2921_issymmetric (A:: Union{Bidiagonal,Diagonal,SymTridiagonal,Tridiagonal} ) = issymmetric (A)
3022
23+ _ishermitian (A:: AbstractVector ) = length (A) == 1 && ishermitian (first (A))
3124_ishermitian (A:: AbstractMatrix ) = false
3225_ishermitian (A:: AbstractQ ) = false
3326_ishermitian (A:: LinearMap ) = ishermitian (A)
3427_ishermitian (A:: LinearAlgebra.RealHermSymComplexHerm ) = ishermitian (A)
3528_ishermitian (A:: Union{Bidiagonal,Diagonal,SymTridiagonal,Tridiagonal} ) = ishermitian (A)
3629
30+ _isposdef (A:: AbstractVector ) = length (A) == 1 && isposdef (first (A))
3731_isposdef (A:: AbstractMatrix ) = false
3832_isposdef (A:: AbstractQ ) = false
3933_isposdef (A:: LinearMap ) = isposdef (A)
0 commit comments