11"""
22 fcenter(X, v)
3- fcenter!(X::Matrix {Q}, v::Vector{Q}) where Q <: AbstractFloat
3+ fcenter!(X::AbstractMatrix {Q}, v::Vector{Q}) where Q <: AbstractFloat
44Center each column of a matrix.
55* `X` : Data (n, p).
66* `v` : Centering vector (p).
@@ -21,15 +21,15 @@ function fcenter(X, v)
2121 zX
2222end
2323
24- function fcenter! (X:: Matrix {Q} , v:: Vector{Q} ) where Q <: AbstractFloat
24+ function fcenter! (X:: AbstractMatrix {Q} , v:: Vector{Q} ) where Q <: AbstractFloat
2525 @inbounds for j in axes (X, 2 ), i in axes (X, 1 )
2626 X[i, j] -= v[j]
2727 end
2828end
2929
3030"""
3131 fscale(X, v)
32- fscale!(X::Matrix {Q}, v::Vector{Q}) where Q <: AbstractFloat
32+ fscale!(X::AbstractMatrix {Q}, v::Vector{Q}) where Q <: AbstractFloat
3333Scale each column of a matrix.
3434* `X` : Data (n, p).
3535* `v` : Scaling vector (p).
@@ -48,15 +48,15 @@ function fscale(X, v)
4848 zX
4949end
5050
51- function fscale! (X:: Matrix {Q} , v:: Vector{Q} ) where Q <: AbstractFloat
51+ function fscale! (X:: AbstractMatrix {Q} , v:: Vector{Q} ) where Q <: AbstractFloat
5252 @inbounds for j in axes (X, 2 ), i in axes (X, 1 )
5353 X[i, j] /= v[j]
5454 end
5555end
5656
5757"""
5858 fcscale(X, u, v)
59- fcscale!(X::Matrix {Q}, u::Vector{Q}, v::Vector{Q}) where Q <: AbstractFloat
59+ fcscale!(X::AbstractMatrix {Q}, u::Vector{Q}, v::Vector{Q}) where Q <: AbstractFloat
6060Center and scale each column of a matrix.
6161* `X` : Data (n, p).
6262* `u` : Centering vector (p).
@@ -79,7 +79,7 @@ function fcscale(X, u, v)
7979 zX
8080end
8181
82- function fcscale! (X:: Matrix {Q} , u:: Vector{Q} , v:: Vector{Q} ) where Q <: AbstractFloat
82+ function fcscale! (X:: AbstractMatrix {Q} , u:: Vector{Q} , v:: Vector{Q} ) where Q <: AbstractFloat
8383 @inbounds for j in axes (X, 2 ), i in axes (X, 1 )
8484 X[i, j] = (X[i, j] - u[j]) / v[j]
8585 end
0 commit comments