Skip to content

Commit

Permalink
Simplify cat_outputs(::SVector, ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Jun 22, 2018
1 parent 1a6cd5a commit 4e6a883
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/codim2/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,5 @@ function output_vars(H)
end

cat_outputs(H1, H2, H3) = vcat(H1, H2, H3)

function cat_outputs(H1::SVector{S, T1},
H2::SVector{S, T2},
H3::T3) where {S, T1, T2, T3}
values = [
[:(H1[$i]) for i in 1:S]
[:(H2[$i]) for i in 1:S]
:(H3)
]
T = promote_type(T1, T2, T3)
return Expr(:call :(SVector{eq_dim(S), T}), values...)
end
cat_outputs(H1::SVector, H2::SVector, H3::Number) :: SVector =
vcat(H1, H2, SVector(H3))

0 comments on commit 4e6a883

Please sign in to comment.