What's the proper way of dealing with Adjoint?

During upgrade of some libraries to Julia 0.7 I’ve met many situations where package developers use DenseMatrix{T} as an abstract class for a matrix data. But after new release, all code, which use transpose stopped working, as now it returns Adjoint, which is subtype of AbstractArray{T,2}. What is a proper way to upgrade such places?
Replacement of all DenseMatrix{T} with AbstractArray{T,2} would significantly increase class of accepted subtypes. Wrapping each occurrence of transposition (m') with Array(m') looks too verbose as well as replacement of DenseMatrix with Union{DenseMatrix, Adjoint}.

copy to materialize the adjoint and it should work like before.

1 Like

Thanks for the reply!
Isn’t it as long as Array(m')? Do you really mean to use it each time with ' operator?

Before it was exactly doing this, creating a copy. So putting copy everywhere would kind of reproduce old behavior. However, by doing so, you might realize in some places why a lazy adjoint might be a better idea (performance wise).

1 Like

You might not want to create an Array.

1 Like

Ok, got it, thank you!

I am new to Julia, may I know what is the issue of creating an Array vs using copy?