Skip to content

Commit

Permalink
Add promotion for AntonSchmidt & BreenanStacey
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Oct 10, 2019
1 parent 4b2ec52 commit 6e5f287
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Collections.jl
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ struct AntonSchmidt{T} <: EquationOfState{T}
n::T
e∞::T
end
function AntonSchmidt(v0, β, n, e∞)
T = Base.promote_typeof(v0, β, n, e∞)
return AntonSchmidt{T}(convert.(T, [v0, β, n, e∞])...)
end
AntonSchmidt(v0::Real, β::Real, n::Real) = AntonSchmidt(v0, β, n, 0)

struct BreenanStacey{T} <: EquationOfState{T}
Expand All @@ -272,6 +276,10 @@ struct BreenanStacey{T} <: EquationOfState{T}
γ0::T
e0::T
end
function BreenanStacey(v0, b0, γ0, e0)
T = Base.promote_typeof(v0, b0, γ0, e0)
return BreenanStacey{T}(convert.(T, [v0, b0, γ0, e0])...)
end
BreenanStacey(v0::Real, b0::Real, γ0::Real) = BreenanStacey(v0, b0, γ0, 0)
# =================================== Types ================================== #

Expand Down

0 comments on commit 6e5f287

Please sign in to comment.