Skip to content

Commit 38724b2

Browse files
fix: allow specifying floating point type in MTKParameters
1 parent 8d2482c commit 38724b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/systems/parameter_buffer.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ the default behavior).
2828
"""
2929
function MTKParameters(
3030
sys::AbstractSystem, p, u0 = Dict(); tofloat = false,
31-
t0 = nothing, substitution_limit = 1000)
31+
t0 = nothing, substitution_limit = 1000, floatT = nothing)
3232
ic = if has_index_cache(sys) && get_index_cache(sys) !== nothing
3333
get_index_cache(sys)
3434
else
@@ -111,6 +111,9 @@ function MTKParameters(
111111
if ctype <: FnType
112112
ctype = fntype_to_function_type(ctype)
113113
end
114+
if ctype == Real && floatT !== nothing
115+
ctype = floatT
116+
end
114117
val = symconvert(ctype, val)
115118
done = set_value(sym, val)
116119
if !done && Symbolics.isarraysymbolic(sym)

0 commit comments

Comments
 (0)