Skip to content

Commit

Permalink
Make internals private
Browse files Browse the repository at this point in the history
  • Loading branch information
yuehhua committed Jul 15, 2019
1 parent 434c556 commit 5b20b40
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/transformations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Apply transformation `t` to vector or matrix `x` in place.
"""
function transform!(t::AbstractDataTransform, x::AbstractMatrix{<:Real})
if t.dims == 1
transform!(x, t, x)
_transform!(x, t, x)
elseif t.dims == 2
transform!(x', t, x')
_transform!(x', t, x')
end
return x
end
Expand All @@ -29,9 +29,9 @@ Return a standardized vector or matrix `x` using `t` transformation.
"""
function transform(t::AbstractDataTransform, x::AbstractMatrix{<:Real})
if t.dims == 1
return transform!(similar(x), t, x)
return _transform!(similar(x), t, x)
elseif t.dims == 2
return transform!(similar(x)', t, x')'
return _transform!(similar(x)', t, x')'
end
end

Expand All @@ -48,9 +48,9 @@ vector or matrix `y` using `t` transformation.
"""
function reconstruct!(t::AbstractDataTransform, y::AbstractMatrix{<:Real})
if t.dims == 1
reconstruct!(y, t, y)
_reconstruct!(y, t, y)
elseif t.dims == 2
reconstruct!(y', t, y')
_reconstruct!(y', t, y')
end
return y
end
Expand All @@ -68,9 +68,9 @@ or matrix `y` using `t` transformation.
"""
function reconstruct(t::AbstractDataTransform, y::AbstractMatrix{<:Real})
if t.dims == 1
return reconstruct!(similar(y), t, y)
return _reconstruct!(similar(y), t, y)
elseif t.dims == 2
return reconstruct!(similar(y)', t, y')'
return _reconstruct!(similar(y)', t, y')'
end
end

Expand Down Expand Up @@ -176,7 +176,7 @@ function fit(::Type{ZScoreTransform}, X::AbstractVector{<:Real};
(scale ? [s] : zeros(T, 0)))
end

function transform!(y::AbstractMatrix{<:Real}, t::ZScoreTransform, x::AbstractMatrix{<:Real})
function _transform!(y::AbstractMatrix{<:Real}, t::ZScoreTransform, x::AbstractMatrix{<:Real})
l = t.len
size(x,2) == size(y,2) == l || throw(DimensionMismatch("Inconsistent dimensions."))
n = size(y,1)
Expand All @@ -203,7 +203,7 @@ function transform!(y::AbstractMatrix{<:Real}, t::ZScoreTransform, x::AbstractMa
return y
end

function reconstruct!(x::AbstractMatrix{<:Real}, t::ZScoreTransform, y::AbstractMatrix{<:Real})
function _reconstruct!(x::AbstractMatrix{<:Real}, t::ZScoreTransform, y::AbstractMatrix{<:Real})
l = t.len
size(x,2) == size(y,2) == l || throw(DimensionMismatch("Inconsistent dimensions."))
n = size(y,1)
Expand Down Expand Up @@ -350,7 +350,7 @@ function fit(::Type{UnitRangeTransform}, X::AbstractVector{<:Real};
return UnitRangeTransform(1, dims, unit, [tmin], [tmax])
end

function transform!(y::AbstractMatrix{<:Real}, t::UnitRangeTransform, x::AbstractMatrix{<:Real})
function _transform!(y::AbstractMatrix{<:Real}, t::UnitRangeTransform, x::AbstractMatrix{<:Real})
l = t.len
size(x,2) == size(y,2) == l || throw(DimensionMismatch("Inconsistent dimensions."))
n = size(x,1)
Expand All @@ -367,7 +367,7 @@ function transform!(y::AbstractMatrix{<:Real}, t::UnitRangeTransform, x::Abstrac
return y
end

function reconstruct!(x::AbstractMatrix{<:Real}, t::UnitRangeTransform, y::AbstractMatrix{<:Real})
function _reconstruct!(x::AbstractMatrix{<:Real}, t::UnitRangeTransform, y::AbstractMatrix{<:Real})
l = t.len
size(x,2) == size(y,2) == l || throw(DimensionMismatch("Inconsistent dimensions."))
n = size(y,1)
Expand Down

0 comments on commit 5b20b40

Please sign in to comment.