@@ -8,7 +8,7 @@ function alias_eliminate_graph!(state::TransformationState; kwargs...)
88    end 
99
1010    @unpack  graph, var_to_diff, solvable_graph =  state. structure
11-     mm =  alias_eliminate_graph! (state, mm)
11+     mm =  alias_eliminate_graph! (state, mm; kwargs ... )
1212    s =  state. structure
1313    for  g in  (s. graph, s. solvable_graph)
1414        g ===  nothing  &&  continue 
@@ -347,27 +347,29 @@ function do_bareiss!(M, Mold, is_linear_variables, is_highest_diff)
347347    (rank1, rank2, rank3, pivots)
348348end 
349349
350- function  alias_eliminate_graph! (state:: TransformationState , ils:: SparseMatrixCLIL )
350+ function  alias_eliminate_graph! (state:: TransformationState , ils:: SparseMatrixCLIL ; fully_determined  =   true , kwargs ... )
351351    @unpack  structure =  state
352352    @unpack  graph, solvable_graph, var_to_diff, eq_to_diff =  state. structure
353353    #  Step 1: Perform Bareiss factorization on the adjacency matrix of the linear
354354    #          subsystem of the system we're interested in.
355355    # 
356356    ils, solvable_variables, (rank1, rank2, rank3, pivots) =  aag_bareiss! (structure, ils)
357357
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 
371373    end 
372374
373375    return  ils
0 commit comments