Skip to content

Commit

Permalink
Remove redundant transpose
Browse files Browse the repository at this point in the history
  • Loading branch information
yuehhua committed Jul 7, 2019
1 parent fa4d81b commit 9fe549c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/transformations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Apply transformation `t` to vector or matrix `x` in place.
"""
function transform!(t::AbstractDataTransform, x::AbstractMatrix{<:Real})
if t.dims == 1
return transform!(x, t, x)
transform!(x, t, x)
elseif t.dims == 2
return transform!(x', t, x')'
transform!(x', t, x')
end
return x
end

function transform!(t::AbstractDataTransform, x::AbstractVector{<:Real})
Expand Down Expand Up @@ -48,10 +49,11 @@ vector or matrix `y` using `t` transformation.
"""
function reconstruct!(t::AbstractDataTransform, y::AbstractMatrix{<:Real})
if t.dims == 1
return reconstruct!(y, t, y)
reconstruct!(y, t, y)
elseif t.dims == 2
return reconstruct!(y', t, y')'
reconstruct!(y', t, y')
end
return y
end

function reconstruct!(t::AbstractDataTransform, y::AbstractVector{<:Real})
Expand Down

0 comments on commit 9fe549c

Please sign in to comment.