| 590 | } |
| 591 | |
| 592 | void MILPFormulator::createMILPEncoding( const Map<unsigned, Layer *> &layers, |
| 593 | GurobiWrapper &gurobi, |
| 594 | unsigned lastLayer ) |
| 595 | { |
| 596 | // First, create the LP relaxation of the problem |
| 597 | _lpFormulator.createLPRelaxation( layers, gurobi, lastLayer ); |
| 598 | |
| 599 | // Now, add the MILP constraints |
| 600 | for ( const auto &layer : layers ) |
| 601 | { |
| 602 | if ( layer.second->getLayerIndex() > lastLayer ) |
| 603 | continue; |
| 604 | |
| 605 | addLayerToModel( gurobi, layer.second, _layerOwner ); |
| 606 | } |
| 607 | } |
| 608 | |
| 609 | void MILPFormulator::addLayerToModel( GurobiWrapper &gurobi, |
| 610 | const Layer *layer, |
no test coverage detected