@@ -8,7 +8,7 @@ function alias_eliminate_graph!(state::TransformationState; kwargs...)
8
8
end
9
9
10
10
@unpack graph, var_to_diff, solvable_graph = state. structure
11
- mm = alias_eliminate_graph! (state, mm)
11
+ mm = alias_eliminate_graph! (state, mm; kwargs ... )
12
12
s = state. structure
13
13
for g in (s. graph, s. solvable_graph)
14
14
g === nothing && continue
@@ -347,27 +347,29 @@ function do_bareiss!(M, Mold, is_linear_variables, is_highest_diff)
347
347
(rank1, rank2, rank3, pivots)
348
348
end
349
349
350
- function alias_eliminate_graph! (state:: TransformationState , ils:: SparseMatrixCLIL )
350
+ function alias_eliminate_graph! (state:: TransformationState , ils:: SparseMatrixCLIL ; fully_determined = true , kwargs ... )
351
351
@unpack structure = state
352
352
@unpack graph, solvable_graph, var_to_diff, eq_to_diff = state. structure
353
353
# Step 1: Perform Bareiss factorization on the adjacency matrix of the linear
354
354
# subsystem of the system we're interested in.
355
355
#
356
356
ils, solvable_variables, (rank1, rank2, rank3, pivots) = aag_bareiss! (structure, ils)
357
357
358
- # # Step 2: Simplify the system using the Bareiss factorization
359
- rk1vars = BitSet (@view pivots[1 : rank1])
360
- for v in solvable_variables
361
- v in rk1vars && continue
362
- @set! ils. nparentrows += 1
363
- push! (ils. nzrows, ils. nparentrows)
364
- push! (ils. row_cols, [v])
365
- push! (ils. row_vals, [convert (eltype (ils), 1 )])
366
- add_vertex! (graph, SRC)
367
- add_vertex! (solvable_graph, SRC)
368
- add_edge! (graph, ils. nparentrows, v)
369
- add_edge! (solvable_graph, ils. nparentrows, v)
370
- add_vertex! (eq_to_diff)
358
+ if fully_determined == true
359
+ # # Step 2: Simplify the system using the Bareiss factorization
360
+ rk1vars = BitSet (@view pivots[1 : rank1])
361
+ for v in solvable_variables
362
+ v in rk1vars && continue
363
+ @set! ils. nparentrows += 1
364
+ push! (ils. nzrows, ils. nparentrows)
365
+ push! (ils. row_cols, [v])
366
+ push! (ils. row_vals, [convert (eltype (ils), 1 )])
367
+ add_vertex! (graph, SRC)
368
+ add_vertex! (solvable_graph, SRC)
369
+ add_edge! (graph, ils. nparentrows, v)
370
+ add_edge! (solvable_graph, ils. nparentrows, v)
371
+ add_vertex! (eq_to_diff)
372
+ end
371
373
end
372
374
373
375
return ils
0 commit comments