11"""
22 struct BatchedInterface{S <: AbstractVector, I}
3- function BatchedInterface(syssyms ::Tuple...)
3+ function BatchedInterface(indp_syms ::Tuple...)
44
55A 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.
1010
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
1212`s2 = SymbolCache([:y, :z, :w])`, `BatchedInterface((s1, [:x, :y]), (s2, [:y, :z]))` will
1313associate `:x` and `:y` with `s1` and `:z` with `s2`. The information that `s1` had
1414associated symbols `:x` and `:y` and `s2` had associated symbols `:y` and `:z` will also
@@ -24,17 +24,17 @@ See also: [`associated_systems`](@ref).
2424struct BatchedInterface{S <: AbstractVector , I, T}
2525 " Order of symbols in the union."
2626 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."
2828 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."
3030 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."
3232 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."
3434 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 ."
3636 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 ."
3838 system_to_isstate:: Vector{BitVector}
3939end
4040
@@ -102,26 +102,27 @@ is_variable(bi::BatchedInterface, sym) = variable_index(bi, sym) !== nothing
102102 associated_systems(bi::BatchedInterface)
103103
104104Return 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
106106`variable_symbols(bi)`.
107107"""
108108associated_systems (bi:: BatchedInterface ) = bi. associated_systems
109109
110110"""
111111 getu(bi::BatchedInterface)
112112
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.
118119
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
120121`is_timeseries(prob) === NotTimeseries()`.
121122
122123The 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]`).
125126
126127See also: [`variable_symbols`](@ref), [`associated_systems`](@ref), [`is_timeseries`](@ref),
127128[`NotTimeseries`](@ref).
@@ -180,16 +181,16 @@ end
180181"""
181182 setu(bi::BatchedInterface)
182183
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.
186187
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
188189`is_timeseries(prob) === NotTimeseries()`.
189190
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.
193194
194195See also: [`is_timeseries`](@ref), [`NotTimeseries`](@ref).
195196"""
0 commit comments