Skip to content

Commit 7b5ed26

Browse files
author
Will Tebbutt
committed
Sort ard promotion
1 parent 90db327 commit 7b5ed26

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/transform/ardtransform.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ dim(t::ARDTransform) = length(t.v)
3737

3838
# Quite specific implementations required to pass correctness and performance tests.
3939
_map(t::ARDTransform, x::AbstractVector{<:Real}) = x * only(t.v)
40-
_map(t::ARDTransform, x::ColVecs) = ColVecs((t.v * ones(1, size(x.X, 2))) .* x.X)
41-
_map(t::ARDTransform, x::RowVecs) = RowVecs(x.X .* (ones(size(x.X, 1)) * collect(t.v')))
40+
function _map(t::ARDTransform, x::ColVecs)
41+
return ColVecs((t.v * ones(eltype(t.v), 1, size(x.X, 2))) .* x.X)
42+
end
43+
function _map(t::ARDTransform, x::RowVecs)
44+
return RowVecs(x.X .* (ones(eltype(t.v), size(x.X, 1)) * collect(t.v')))
45+
end
4246

4347
Base.isequal(t::ARDTransform, t2::ARDTransform) = isequal(t.v, t2.v)
4448

0 commit comments

Comments
 (0)