ggebbie / UnitfulLinearAlgebra.jl

Low-cost linear algebra functions for matrices with units
MIT License
6 stars 3 forks source link

Two definitions of transpose #54

Closed b-r-hamilton closed 1 year ago

b-r-hamilton commented 1 year ago

On the main branch, in src/base, there are two definitions of transpose (line 237 and 239)- I assume we want the second one?

(237) Base.transpose(a::AbstractUnitfulVector) = rebuild(a,transpose(parent(a)),(Units([unit(1.0)]), Units(unitrange(a).^-1))) # kludge for unitrange of row vector
(238) Base.transpose(A::AbstractUnitfulDimMatrix) = rebuild(A,transpose(parent(A)),(Units(unitdomain(A).^-1), Units(unitrange(A).^-1)),(last(dims(A)),first(dims(A))))
(239) Base.transpose(a::AbstractUnitfulVector) = rebuild(a,transpose(parent(a)),(Units([unit(1.0)]), Units(unitrange(a).^-1)),(last(dims(a)),))
ggebbie commented 1 year ago

L239 should apply for AbstractUnitfulDimVector not AbstractUnitfulVector

then both L237 and L239 are needed

ggebbie commented 1 year ago

fixed in pull request #55