File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1033,19 +1033,24 @@ end
1033
1033
$(TYPEDSIGNATURES)
1034
1034
1035
1035
Return the indexes of observed equations of `sys` used by expression `exprs`.
1036
+
1037
+ Keyword arguments:
1038
+ - `involved_vars`: A collection of the variables involved in `exprs`. This is the set of
1039
+ variables which will be explored to find dependencies on observed equations. Typically,
1040
+ providing this keyword is not necessary and is only useful to avoid repeatedly calling
1041
+ `vars(exprs)`
1036
1042
"""
1037
- function observed_equations_used_by (sys:: AbstractSystem , exprs)
1043
+ function observed_equations_used_by (sys:: AbstractSystem , exprs; involved_vars = vars (exprs) )
1038
1044
obs = observed (sys)
1039
1045
1040
1046
obsvars = getproperty .(obs, :lhs )
1041
1047
graph = observed_dependency_graph (obs)
1042
1048
1043
- syms = vars (exprs)
1044
-
1045
1049
obsidxs = BitSet ()
1046
- for sym in syms
1050
+ for sym in involved_vars
1047
1051
idx = findfirst (isequal (sym), obsvars)
1048
1052
idx === nothing && continue
1053
+ idx in obsidxs && continue
1049
1054
parents = dfs_parents (graph, idx)
1050
1055
for i in eachindex (parents)
1051
1056
parents[i] == 0 && continue
You can’t perform that action at this time.
0 commit comments