Open stevengj opened 2 years ago
I will transform these functions now.
@stevengj , if I am correct, this will ask to create a new file trying to mimic the following file: https://github.com/JuliaLang/julia/blob/master/stdlib/LinearAlgebra/src/adjtrans.jl
No, you shouldn't need to mimic that whole file — that defines lots of methods for Adjoint{<:AbstractMatrix}
that should automatically apply to Adjoint{<:SkewHermitian}
.
What is needed is that whenever you have a specialized matrix method for SkewHermitian
, you might need to also define one for Adjoint{<:SkewHermitian}
that just flips the sign of the result (e.g. for multiplying two matrices).
Still requires a fair amount of code, so I'm not 100% sure if it's worth it. On the other hand, the usual expectation in Julia is that A'
doesn't make a copy.
Currently we override
transpose
andadjoint
to make copies here: https://github.com/JuliaLinearAlgebra/SkewLinearAlgebra.jl/blob/main/src/skewhermitian.jl#L115-L116Instead, the right thing to do is to use the default definitions of these functions, which create
Transpose
andAdjoint
wrappers around the matrix without making a copy.Ideally, one then defines specialized methods for
Adjoint{<:SkewHermitian}
which exploit the fact that it is merely a sign flip.