Skip to content

Commit

Permalink
Add boilerplate outer constrcutors to EossParams as in #45
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Aug 17, 2020
1 parent 4290e52 commit 47e7839
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/Collections.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,7 @@ function Base.show(io::IO, eos::EossParam) # Ref: https://github.com/mauro3/Par
end
end # function Base.show

for T in (
:Murnaghan,
:BirchMurnaghan2nd,
:BirchMurnaghan3rd,
:PoirierTarantola2nd,
:PoirierTarantola3rd,
:Vinet,
)
eval(quote
$T(arr::AbstractVector) = $T{eltype(arr)}(arr...)
$T(args...) = $T([args...])
end)
end
(::Type{T})(arr::AbstractVector) where {T<:EossParam} = T{eltype(arr)}(arr...)
(::Type{T})(args...) where {T<:EossParam} = T([args...])

end

0 comments on commit 47e7839

Please sign in to comment.