Skip to content

Commit d9ad1e9

Browse files
devmotiontheogfwilltebbutt
authored
Apply suggestions from code review
Co-Authored-By: Théo Galy-Fajou <[email protected]> Co-Authored-By: willtebbutt <[email protected]>
1 parent 462c43f commit d9ad1e9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/transform/lineartransform.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@ struct LinearTransform{T<:AbstractMatrix{<:Real}} <: Transform
1818
end
1919

2020
function set!(t::LinearTransform{<:AbstractMatrix{T}}, A::AbstractMatrix{T}) where {T<:Real}
21-
@assert size(t.A) == size(A) "Size of the given matrix $(size(A)) and the transformation matrix $(size(t.A)) are not the same"
21+
size(t.A) == size(A) ||
22+
error("Size of the given matrix $(size(A)) and the transformation matrix $(size(t.A)) are not the same")
2223
t.A .= A
2324
end
2425

2526
(t::LinearTransform)(x::Real) = vec(t.A * x)
2627
(t::LinearTransform)(x::AbstractVector{<:Real}) = t.A * x
2728

28-
function Base.map(t::LinearTransform, x::AbstractVector{<:Real})
29-
return ColVecs(t.A * x')
30-
end
29+
Base.map(t::LinearTransform, x::AbstractVector{<:Real}) = ColVecs(t.A * x')
3130
Base.map(t::LinearTransform, x::ColVecs) = ColVecs(t.A * x.X)
3231
Base.map(t::LinearTransform, x::RowVecs) = RowVecs(x.X * t.A')
3332

0 commit comments

Comments
 (0)