| 269 | } |
| 270 | |
| 271 | void 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 | |
| 299 | void InputQuery::removeEquation( Equation e ) |
| 300 | { |
no test coverage detected