Skip to content

Commit dd71755

Browse files
refactor: remove outdated functions
refactor: remove `controls(sys)` refactor: remove `solved_unknowns(sys)`
1 parent 101097e commit dd71755

File tree

2 files changed

+2
-43
lines changed

2 files changed

+2
-43
lines changed

src/systems/abstractsystem.jl

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ function SymbolicIndexingInterface.variable_index(sys::AbstractSystem, sym::Symb
282282
end
283283

284284
function SymbolicIndexingInterface.variable_symbols(sys::AbstractSystem)
285-
return solved_unknowns(sys)
285+
return unknowns(sys)
286286
end
287287

288288
function SymbolicIndexingInterface.is_parameter(sys::AbstractSystem, sym)
@@ -1165,7 +1165,6 @@ end
11651165

11661166
namespace_variables(sys::AbstractSystem) = unknowns(sys, unknowns(sys))
11671167
namespace_parameters(sys::AbstractSystem) = parameters(sys, parameters(sys))
1168-
namespace_controls(sys::AbstractSystem) = controls(sys, controls(sys))
11691168

11701169
function namespace_defaults(sys)
11711170
defs = defaults(sys)
@@ -1547,12 +1546,6 @@ end
15471546
# required in `src/connectors.jl:437`
15481547
parameters(_) = []
15491548

1550-
function controls(sys::AbstractSystem)
1551-
ctrls = get_ctrls(sys)
1552-
systems = get_systems(sys)
1553-
isempty(systems) ? ctrls : [ctrls; reduce(vcat, namespace_controls.(systems))]
1554-
end
1555-
15561549
"""
15571550
$(TYPEDSIGNATURES)
15581551
@@ -1773,19 +1766,6 @@ function isaffine(sys::AbstractSystem)
17731766
all(isaffine(r, unknowns(sys)) for r in rhs)
17741767
end
17751768

1776-
"""
1777-
$(SIGNATURES)
1778-
1779-
Return a list of actual unknowns needed to be solved by solvers.
1780-
"""
1781-
function solved_unknowns(sys::AbstractSystem)
1782-
sts = unknowns(sys)
1783-
if has_solved_unknowns(sys)
1784-
sts = something(get_solved_unknowns(sys), sts)
1785-
end
1786-
return sts
1787-
end
1788-
17891769
###
17901770
### System utils
17911771
###
@@ -1978,18 +1958,6 @@ end
19781958

19791959
Base.write(io::IO, sys::AbstractSystem) = write(io, readable_code(toexpr(sys)))
19801960

1981-
function get_or_construct_tearing_state(sys)
1982-
if has_tearing_state(sys)
1983-
state = get_tearing_state(sys)
1984-
if state === nothing
1985-
state = TearingState(sys)
1986-
end
1987-
else
1988-
state = nothing
1989-
end
1990-
state
1991-
end
1992-
19931961
"""
19941962
n_expanded_connection_equations(sys::AbstractSystem)
19951963
@@ -2125,15 +2093,6 @@ function Base.show(
21252093
return nothing
21262094
end
21272095

2128-
function Graphs.incidence_matrix(sys)
2129-
if has_torn_matching(sys) && has_tearing_state(sys)
2130-
state = get_tearing_state(sys)
2131-
incidence_matrix(state.structure.graph, Num(Sym{Real}(:×)))
2132-
else
2133-
return nothing
2134-
end
2135-
end
2136-
21372096
function split_assign(expr)
21382097
if !(expr isa Expr && expr.head === :(=) && expr.args[2].head === :call)
21392098
throw(ArgumentError("expression should be of the form `sys = foo(a, b)`"))

src/systems/index_cache.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct IndexCache
6464
end
6565

6666
function IndexCache(sys::AbstractSystem)
67-
unks = solved_unknowns(sys)
67+
unks = unknowns(sys)
6868
unk_idxs = UnknownIndexMap()
6969
symbol_to_variable = Dict{Symbol, SymbolicParam}()
7070

0 commit comments

Comments
 (0)