Skip to content

Commit a700074

Browse files
refactor: store buffer index in ParameterIndex type
1 parent c2ff784 commit a700074

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/systems/index_cache.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ end
1111
struct Nonnumeric <: SciMLStructures.AbstractPortion end
1212
const NONNUMERIC_PORTION = Nonnumeric()
1313

14-
struct ParameterIndex{P, I}
14+
struct ParameterIndex{P, B, I}
1515
portion::P
1616
idx::I
1717
validate_size::Bool
1818
end
1919

20-
ParameterIndex(portion, idx) = ParameterIndex(portion, idx, false)
20+
ParameterIndex(portion, idx, val = false) = ParameterIndex{typeof(portion), idx[1], typeof(idx)}(portion, idx, val)
21+
ParameterIndex(portion::Union{SciMLStructures.Tunable, SciMLStructures.Initials}, idx, val = false) = ParameterIndex{typeof(portion), idx, typeof(idx)}(portion, idx, val)
2122
ParameterIndex(p::ParameterIndex) = ParameterIndex(p.portion, p.idx, false)
2223

2324
struct DiscreteIndex

0 commit comments

Comments
 (0)