MCPcopy Create free account
hub / github.com/NeuralNetworkVerification/Marabou / mergeIdenticalVariables

Method mergeIdenticalVariables

src/engine/InputQuery.cpp:271–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271void InputQuery::mergeIdenticalVariables( unsigned v1, unsigned v2 )
272{
273 // Handle equations
274 for ( auto &equation : getEquations() )
275 equation.updateVariableIndex( v1, v2 );
276
277 // Handle PL constraints
278 for ( auto &plConstraint : getPiecewiseLinearConstraints() )
279 {
280 if ( plConstraint->participatingVariable( v1 ) )
281 {
282 ASSERT( !plConstraint->participatingVariable( v2 ) );
283 plConstraint->updateVariableIndex( v1, v2 );
284 }
285 }
286
287 // Handle Nonlinear constraints
288 for ( auto &nlConstraint : getNonlinearConstraints() )
289 {
290 if ( nlConstraint->participatingVariable( v1 ) )
291 {
292 ASSERT( !nlConstraint->participatingVariable( v2 ) );
293 nlConstraint->updateVariableIndex( v1, v2 );
294 }
295 }
296 // TODO: update lower and upper bounds
297}
298
299void InputQuery::removeEquation( Equation e )
300{

Callers 1

Calls 2

updateVariableIndexMethod · 0.45
participatingVariableMethod · 0.45

Tested by

no test coverage detected