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
10331033 $(TYPEDSIGNATURES)
10341034
10351035Return 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)`
10361042"""
1037- function observed_equations_used_by (sys:: AbstractSystem , exprs)
1043+ function observed_equations_used_by (sys:: AbstractSystem , exprs; involved_vars = vars (exprs) )
10381044 obs = observed (sys)
10391045
10401046 obsvars = getproperty .(obs, :lhs )
10411047 graph = observed_dependency_graph (obs)
10421048
1043- syms = vars (exprs)
1044-
10451049 obsidxs = BitSet ()
1046- for sym in syms
1050+ for sym in involved_vars
10471051 idx = findfirst (isequal (sym), obsvars)
10481052 idx === nothing && continue
1053+ idx in obsidxs && continue
10491054 parents = dfs_parents (graph, idx)
10501055 for i in eachindex (parents)
10511056 parents[i] == 0 && continue
You can’t perform that action at this time.
0 commit comments