Skip to content

Commit

Permalink
Update src/transformations.jl
Browse files Browse the repository at this point in the history
Co-Authored-By: Milan Bouchet-Valat <[email protected]>
Update src/transformations.jl

Co-Authored-By: Milan Bouchet-Valat <[email protected]>
Update src/transformations.jl

Co-Authored-By: Milan Bouchet-Valat <[email protected]>
Update src/transformations.jl

Co-Authored-By: Milan Bouchet-Valat <[email protected]>
Refactor
  • Loading branch information
yuehhua committed Jul 8, 2019
1 parent 9fe549c commit 434c556
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/transformations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end

function transform!(t::AbstractDataTransform, x::AbstractVector{<:Real})
transform!(t, reshape(x, :, 1))
return vec(x)
return x
end

"""
Expand All @@ -36,8 +36,7 @@ function transform(t::AbstractDataTransform, x::AbstractMatrix{<:Real})
end

function transform(t::AbstractDataTransform, x::AbstractVector{<:Real})
xmat = transform(t, reshape(x, :, 1))
return vec(xmat)
return vec(transform(t, reshape(x, :, 1)))
end

# reconstruct the original data from transformed values
Expand All @@ -58,7 +57,7 @@ end

function reconstruct!(t::AbstractDataTransform, y::AbstractVector{<:Real})
reconstruct!(t, reshape(y, :, 1))
return vec(y)
return y
end

"""
Expand All @@ -76,8 +75,7 @@ function reconstruct(t::AbstractDataTransform, y::AbstractMatrix{<:Real})
end

function reconstruct(t::AbstractDataTransform, y::AbstractVector{<:Real})
ymat = reconstruct(t, reshape(y, :, 1))
return vec(ymat)
return vec(reconstruct(t, reshape(y, :, 1)))
end

"""
Expand Down

0 comments on commit 434c556

Please sign in to comment.