1
1
"""
2
2
struct BatchedInterface{S <: AbstractVector, I}
3
- function BatchedInterface(syssyms ::Tuple...)
3
+ function BatchedInterface(indp_syms ::Tuple...)
4
4
5
5
A struct which stores information for batched calls to [`getu`](@ref) or [`setu`](@ref).
6
- Given `Tuple`s, where the first element of each tuple is a system and the second an
7
- array of symbols (either variables or parameters) in the system, `BatchedInterface` will
8
- compute the union of all symbols and associate each symbol with the first system with
9
- which it occurs.
6
+ Given `Tuple`s, where the first element of each tuple is an index provider and the second
7
+ an array of symbolic variables (either states or parameters) in the index provider,
8
+ `BatchedInterface` will compute the union of all symbols and associate each symbol with
9
+ the first index provider with which it occurs.
10
10
11
- For example, given two systems `s1 = SymbolCache([:x, :y, :z])` and
11
+ For example, given two index providers `s1 = SymbolCache([:x, :y, :z])` and
12
12
`s2 = SymbolCache([:y, :z, :w])`, `BatchedInterface((s1, [:x, :y]), (s2, [:y, :z]))` will
13
13
associate `:x` and `:y` with `s1` and `:z` with `s2`. The information that `s1` had
14
14
associated symbols `:x` and `:y` and `s2` had associated symbols `:y` and `:z` will also
@@ -24,17 +24,17 @@ See also: [`associated_systems`](@ref).
24
24
struct BatchedInterface{S <: AbstractVector , I, T}
25
25
" Order of symbols in the union."
26
26
symbol_order:: S
27
- " Index of the system each symbol in the union is associated with."
27
+ " Index of the index provider each symbol in the union is associated with."
28
28
associated_systems:: Vector{Int}
29
- " Index of symbol in the system it is associated with."
29
+ " Index of symbol in the index provider it is associated with."
30
30
associated_indexes:: I
31
- " Whether the symbol is a state in the system it is associated with."
31
+ " Whether the symbol is a state in the index provider it is associated with."
32
32
isstate:: BitVector
33
- " Map from system to indexes of its symbols in the union."
33
+ " Map from index provider to indexes of its symbols in the union."
34
34
system_to_symbol_subset:: Vector{Vector{Int}}
35
- " Map from system to indexes of its symbols in the system ."
35
+ " Map from index provider to indexes of its symbols in the index provider ."
36
36
system_to_symbol_indexes:: Vector{Vector{T}}
37
- " Map from system to whether each of its symbols is a state in the system ."
37
+ " Map from index provider to whether each of its symbols is a state in the index provider ."
38
38
system_to_isstate:: Vector{BitVector}
39
39
end
40
40
@@ -102,26 +102,27 @@ is_variable(bi::BatchedInterface, sym) = variable_index(bi, sym) !== nothing
102
102
associated_systems(bi::BatchedInterface)
103
103
104
104
Return an array of integers of the same length as `variable_symbols(bi)` where each value
105
- is the index of the system associated with the corresponding symbol in
105
+ is the index of the index provider associated with the corresponding symbol in
106
106
`variable_symbols(bi)`.
107
107
"""
108
108
associated_systems (bi:: BatchedInterface ) = bi. associated_systems
109
109
110
110
"""
111
111
getu(bi::BatchedInterface)
112
112
113
- Given a [`BatchedInterface`](@ref) composed from `n` systems (and corresponding symbols),
114
- return a function which takes `n` corresponding problems and returns an array of the values
115
- of the symbols in the union. The returned function can also be passed an `AbstractArray` of
116
- the appropriate `eltype` and size as its first argument, in which case the operation will
117
- populate the array in-place with the values of the symbols in the union.
113
+ Given a [`BatchedInterface`](@ref) composed from `n` index providers (and corresponding
114
+ symbols), return a function which takes `n` corresponding value providers and returns an
115
+ array of the values of the symbols in the union. The returned function can also be passed
116
+ an `AbstractArray` of the appropriate `eltype` and size as its first argument, in which
117
+ case the operation will populate the array in-place with the values of the symbols in the
118
+ union.
118
119
119
- Note that all of the problems passed to the function returned by `getu` must satisfy
120
+ Note that all of the value providers passed to the function returned by `getu` must satisfy
120
121
`is_timeseries(prob) === NotTimeseries()`.
121
122
122
123
The value of the `i`th symbol in the union (obtained through `variable_symbols(bi)[i]`) is
123
- obtained from the problem corresponding to the associated system (i.e. the problem at
124
- index `associated_systems(bi)[i]`).
124
+ obtained from the problem corresponding to the associated index provider (i.e. the value
125
+ provider at index `associated_systems(bi)[i]`).
125
126
126
127
See also: [`variable_symbols`](@ref), [`associated_systems`](@ref), [`is_timeseries`](@ref),
127
128
[`NotTimeseries`](@ref).
@@ -180,16 +181,16 @@ end
180
181
"""
181
182
setu(bi::BatchedInterface)
182
183
183
- Given a [`BatchedInterface`](@ref) composed from `n` systems (and corresponding symbols),
184
- return a function which takes `n` corresponding problems and an array of the values, and
185
- updates each of the problems with the values of the corresponding symbols.
184
+ Given a [`BatchedInterface`](@ref) composed from `n` index providers (and corresponding
185
+ symbols), return a function which takes `n` corresponding problems and an array of the
186
+ values, and updates each of the problems with the values of the corresponding symbols.
186
187
187
- Note that all of the problems passed to the function returned by `setu` must satisfy
188
+ Note that all of the value providers passed to the function returned by `setu` must satisfy
188
189
`is_timeseries(prob) === NotTimeseries()`.
189
190
190
- Note that if any subset of the `n` systems share common symbols (among those passed to
191
- `BatchedInterface`) then all of the corresponding problems in the subset will be updated
192
- with the values of the common symbols.
191
+ Note that if any subset of the `n` index providers share common symbols (among those passed
192
+ to `BatchedInterface`) then all of the corresponding value providers in the subset will be
193
+ updated with the values of the common symbols.
193
194
194
195
See also: [`is_timeseries`](@ref), [`NotTimeseries`](@ref).
195
196
"""
0 commit comments